Skip to content

Commit b833118

Browse files
authored
Rename logs_level_enabled flag to spec_unstable_logs_enabled (#2291)
1 parent 0cc2cd5 commit b833118

File tree

21 files changed

+35
-29
lines changed

21 files changed

+35
-29
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ It's important to regularly review and remove the `otel_unstable` flag from the
169169
The potential features include:
170170

171171
- Stable and non-experimental features that compliant to specification, and have a feature flag to minimize compilation size. Example: feature flags for signals (like `logs`, `traces`, `metrics`) and runtimes (`rt-tokio`, `rt-tokio-current-thread`, `rt-async-std`).
172-
- Stable and non-experimental features, although not part of the specification, are crucial for enhancing the tracing/log crate's functionality or boosting performance. These features are also subject to discussion and approval by the OpenTelemetry Rust Maintainers. An example of such a feature is `logs_level_enabled`.
172+
- Stable and non-experimental features, although not part of the specification, are crucial for enhancing the tracing/log crate's functionality or boosting performance. These features are also subject to discussion and approval by the OpenTelemetry Rust Maintainers.
173173

174174
All such features should adhere to naming convention `<signal>_<feature_name>`
175175

opentelemetry-appender-log/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Bump MSRV to 1.70 [#2179](https://github.com/open-telemetry/opentelemetry-rust/pull/2179)
66
- [2193](https://github.com/open-telemetry/opentelemetry-rust/pull/2193) `opentelemetry-appender-log`: Output experimental code attributes
7+
- **Breaking** [2291](https://github.com/open-telemetry/opentelemetry-rust/pull/2291) Rename `logs_level_enabled flag` to `spec_unstable_logs_enabled`. Please enable this updated flag if the feature is needed. This flag will be removed once the feature is stabilized in the specifications.
78

89
## v0.26.0
910
Released 2024-Sep-30

opentelemetry-appender-log/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ opentelemetry-semantic-conventions = { path = "../opentelemetry-semantic-convent
2121
] }
2222

2323
[features]
24-
logs_level_enabled = ["opentelemetry/logs_level_enabled"]
24+
spec_unstable_logs_enabled = ["opentelemetry/spec_unstable_logs_enabled"]
2525
with-serde = ["log/kv_serde", "serde"]
2626
experimental_metadata_attributes = ["dep:opentelemetry-semantic-conventions"]
2727

2828
[dev-dependencies]
2929
opentelemetry_sdk = { path = "../opentelemetry-sdk", features = [
3030
"testing",
31-
"logs_level_enabled",
31+
"spec_unstable_logs_enabled",
3232
] }
3333
opentelemetry-stdout = { path = "../opentelemetry-stdout", features = ["logs"] }
3434
log = { workspace = true, features = ["kv_serde"] }

opentelemetry-appender-log/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
//!
9090
//! This library provides the following Cargo features:
9191
//!
92-
//! - `logs_level_enabled`: Allow users to control the log level.
92+
//! - `spec_unstable_logs_enabled`: Allow users to control the log level.
9393
//! - `with-serde`: Support complex values as attributes without stringifying them.
9494
//!
9595
//! [Logs Bridge API]: https://opentelemetry.io/docs/specs/otel/logs/bridge-api/
@@ -117,11 +117,11 @@ where
117117
L: Logger + Send + Sync,
118118
{
119119
fn enabled(&self, _metadata: &Metadata) -> bool {
120-
#[cfg(feature = "logs_level_enabled")]
120+
#[cfg(feature = "spec_unstable_logs_enabled")]
121121
return self
122122
.logger
123123
.event_enabled(severity_of_level(_metadata.level()), _metadata.target());
124-
#[cfg(not(feature = "logs_level_enabled"))]
124+
#[cfg(not(feature = "spec_unstable_logs_enabled"))]
125125
true
126126
}
127127

@@ -770,9 +770,9 @@ mod tests {
770770
// As a result of using `with_simple_exporter` while building the logger provider,
771771
// the processor used is a `SimpleLogProcessor` which has an implementation of `event_enabled`
772772
// that always returns true.
773-
#[cfg(feature = "logs_level_enabled")]
773+
#[cfg(feature = "spec_unstable_logs_enabled")]
774774
assert!(otel_log_appender.enabled(&log::Metadata::builder().build()));
775-
#[cfg(not(feature = "logs_level_enabled"))]
775+
#[cfg(not(feature = "spec_unstable_logs_enabled"))]
776776
assert!(otel_log_appender.enabled(&log::Metadata::builder().build()));
777777
}
778778

opentelemetry-appender-tracing/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## vNext
44

55
- Bump MSRV to 1.70 [#2179](https://github.com/open-telemetry/opentelemetry-rust/pull/2179)
6+
- **Breaking** [2291](https://github.com/open-telemetry/opentelemetry-rust/pull/2291) Rename `logs_level_enabled flag` to `spec_unstable_logs_enabled`. Please enable this updated flag if the feature is needed. This flag will be removed once the feature is stabilized in the specifications.
67

78
## v0.26.0
89
Released 2024-Sep-30

opentelemetry-appender-tracing/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ pprof = { version = "0.13", features = ["flamegraph", "criterion"] }
3333

3434
[features]
3535
experimental_metadata_attributes = ["dep:tracing-log"]
36-
logs_level_enabled = ["opentelemetry/logs_level_enabled"]
36+
spec_unstable_logs_enabled = ["opentelemetry/spec_unstable_logs_enabled"]
3737

3838

3939
[[bench]]
4040
name = "logs"
4141
harness = false
42-
required-features = ["logs_level_enabled"]
42+
required-features = ["spec_unstable_logs_enabled"]

opentelemetry-appender-tracing/src/layer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ where
184184
self.logger.emit(log_record);
185185
}
186186

187-
#[cfg(feature = "logs_level_enabled")]
187+
#[cfg(feature = "spec_unstable_logs_enabled")]
188188
fn event_enabled(
189189
&self,
190190
_event: &tracing_core::Event<'_>,

opentelemetry-sdk/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545

4646
- Users calling public APIs that return these constructs (e.g, LoggerProvider::shutdown(), MeterProvider::force_flush()) should now import them from the SDK instead of the API.
4747
- Developers creating custom exporters should ensure they import these constructs from the SDK, not the API.
48+
- [2291](https://github.com/open-telemetry/opentelemetry-rust/pull/2291) Rename `logs_level_enabled flag` to `spec_unstable_logs_enabled`. Please enable this updated flag if the feature is needed. This flag will be removed once the feature is stabilized in the specifications.
49+
4850

4951
- **BREAKING**: `Temporality` enum moved from `opentelemetry_sdk::metrics::data::Temporality` to `opentelemetry_sdk::metrics::Temporality`.
5052

opentelemetry-sdk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ default = ["trace", "metrics", "logs", "internal-logs"]
4646
trace = ["opentelemetry/trace", "rand", "async-trait", "percent-encoding"]
4747
jaeger_remote_sampler = ["trace", "opentelemetry-http", "http", "serde", "serde_json", "url"]
4848
logs = ["opentelemetry/logs", "async-trait", "serde_json"]
49-
logs_level_enabled = ["logs", "opentelemetry/logs_level_enabled"]
49+
spec_unstable_logs_enabled = ["logs", "opentelemetry/spec_unstable_logs_enabled"]
5050
metrics = ["opentelemetry/metrics", "glob", "async-trait"]
5151
testing = ["opentelemetry/testing", "trace", "metrics", "logs", "rt-async-std", "rt-tokio", "rt-tokio-current-thread", "tokio/macros", "tokio/rt-multi-thread"]
5252
rt-tokio = ["tokio", "tokio-stream"]

opentelemetry-sdk/src/export/logs/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::logs::LogRecord;
33
use crate::logs::{LogError, LogResult};
44
use crate::Resource;
55
use async_trait::async_trait;
6-
#[cfg(feature = "logs_level_enabled")]
6+
#[cfg(feature = "spec_unstable_logs_enabled")]
77
use opentelemetry::logs::Severity;
88
use opentelemetry::InstrumentationScope;
99
use std::fmt::Debug;
@@ -85,7 +85,7 @@ pub trait LogExporter: Send + Sync + Debug {
8585
async fn export(&mut self, batch: LogBatch<'_>) -> LogResult<()>;
8686
/// Shuts down the exporter.
8787
fn shutdown(&mut self) {}
88-
#[cfg(feature = "logs_level_enabled")]
88+
#[cfg(feature = "spec_unstable_logs_enabled")]
8989
/// Chek if logs are enabled.
9090
fn event_enabled(&self, _level: Severity, _target: &str, _name: &str) -> bool {
9191
// By default, all logs are enabled

0 commit comments

Comments
 (0)