Skip to content

Commit 4cf56db

Browse files
committed
update flag
1 parent a707bb9 commit 4cf56db

File tree

17 files changed

+29
-29
lines changed

17 files changed

+29
-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/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+
experimental_logs_level_enabled = ["opentelemetry/experimental_logs_level_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+
"experimental_logs_level_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+
//! - `experimental_logs_level_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 = "experimental_logs_level_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 = "experimental_logs_level_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 = "experimental_logs_level_enabled")]
774774
assert!(otel_log_appender.enabled(&log::Metadata::builder().build()));
775-
#[cfg(not(feature = "logs_level_enabled"))]
775+
#[cfg(not(feature = "experimental_logs_level_enabled"))]
776776
assert!(otel_log_appender.enabled(&log::Metadata::builder().build()));
777777
}
778778

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+
logs_level_enabled = ["opentelemetry/experimental_logs_level_enabled"]
3737

3838

3939
[[bench]]
4040
name = "logs"
4141
harness = false
42-
required-features = ["logs_level_enabled"]
42+
required-features = ["experimental_logs_level_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 = "experimental_logs_level_enabled")]
188188
fn event_enabled(
189189
&self,
190190
_event: &tracing_core::Event<'_>,

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+
experimental_logs_level_enabled = ["logs", "opentelemetry/experimental_logs_level_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 = "experimental_logs_level_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 = "experimental_logs_level_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

opentelemetry-sdk/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
//!
9090
//! For `logs` the following feature flags are available:
9191
//!
92-
//! * `logs_level_enabled`: control the log level
92+
//! * `experimental_logs_level_enabled`: control the log level
9393
//!
9494
//! Support for recording and exporting telemetry asynchronously and perform
9595
//! metrics aggregation can be added via the following flags:

opentelemetry-sdk/src/logs/log_emitter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::{export::logs::LogExporter, runtime::RuntimeChannel, Resource};
33
use crate::{logs::LogError, logs::LogResult};
44
use opentelemetry::{otel_debug, trace::TraceContextExt, Context, InstrumentationScope};
55

6-
#[cfg(feature = "logs_level_enabled")]
6+
#[cfg(feature = "experimental_logs_level_enabled")]
77
use opentelemetry::logs::Severity;
88

99
use std::time::SystemTime;
@@ -282,7 +282,7 @@ impl opentelemetry::logs::Logger for Logger {
282282
}
283283
}
284284

285-
#[cfg(feature = "logs_level_enabled")]
285+
#[cfg(feature = "experimental_logs_level_enabled")]
286286
fn event_enabled(&self, level: Severity, target: &str) -> bool {
287287
let provider = self.provider();
288288

opentelemetry-sdk/src/logs/log_processor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use futures_util::{
99
future::{self, Either},
1010
{pin_mut, stream, StreamExt as _},
1111
};
12-
#[cfg(feature = "logs_level_enabled")]
12+
#[cfg(feature = "experimental_logs_level_enabled")]
1313
use opentelemetry::logs::Severity;
1414
use opentelemetry::{otel_debug, otel_error, otel_warn, InstrumentationScope};
1515

@@ -61,7 +61,7 @@ pub trait LogProcessor: Send + Sync + Debug {
6161
/// After shutdown returns the log processor should stop processing any logs.
6262
/// It's up to the implementation on when to drop the LogProcessor.
6363
fn shutdown(&self) -> LogResult<()>;
64-
#[cfg(feature = "logs_level_enabled")]
64+
#[cfg(feature = "experimental_logs_level_enabled")]
6565
/// Check if logging is enabled
6666
fn event_enabled(&self, _level: Severity, _target: &str, _name: &str) -> bool {
6767
// By default, all logs are enabled

0 commit comments

Comments
 (0)