Skip to content

Commit e8f069c

Browse files
committed
opentelemetry: Disable events for NoopLogger
NoopLogger should be using a little resources as possible ideally none. This should help accomplish that.
1 parent 6221d8d commit e8f069c

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

opentelemetry-sdk/CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
- **Breaking** Remove `TextMapCompositePropagator` [#1373](https://github.com/open-telemetry/opentelemetry-rust/pull/1373). Use `TextMapCompositePropagator` in opentelemetry API.
3131

3232
- [#1375](https://github.com/open-telemetry/opentelemetry-rust/pull/1375/) Fix metric collections during PeriodicReader shutdown
33-
- **Breaking** [#1480](https://github.com/open-telemetry/opentelemetry-rust/pull/1480) Remove fine grained `BatchConfig` configurations from `BatchLogProcessorBuilder` and `BatchSpanProcessorBuilder`. Use `BatchConfigBuilder` to construct a `BatchConfig` instance and pass it using `BatchLogProcessorBuilder::with_batch_config` or `BatchSpanProcessorBuilder::with_batch_config`.
33+
- **Breaking** [#1480](https://github.com/open-telemetry/opentelemetry-rust/pull/1480) Remove fine grained `BatchConfig` configurations from `BatchLogProcessorBuilder` and `BatchSpanProcessorBuilder`. Use `BatchConfigBuilder` to construct a `BatchConfig` instance and pass it using `BatchLogProcessorBuilder::with_batch_config` or `BatchSpanProcessorBuilder::with_batch_config`.
3434
- **Breaking** [#1480](https://github.com/open-telemetry/opentelemetry-rust/pull/1480) Remove mutating functions from `BatchConfig`, use `BatchConfigBuilder` to construct a `BatchConfig` instance.
3535
- **Breaking** [#1495](https://github.com/open-telemetry/opentelemetry-rust/pull/1495) Remove Batch LogRecord&Span Processor configuration via non-standard environment variables. Use the following table to migrate from the no longer supported non-standard environment variables to the standard ones.
3636

@@ -41,6 +41,11 @@
4141
| OTEL_BSP_SCHEDULE_DELAY_MILLIS | OTEL_BSP_SCHEDULE_DELAY |
4242
| OTEL_BSP_EXPORT_TIMEOUT_MILLIS | OTEL_BSP_EXPORT_TIMEOUT |
4343

44+
- **Breaking** [1455](https://github.com/open-telemetry/opentelemetry-rust/pull/1455) Make the LoggerProvider Owned
45+
- `Logger` now takes an Owned Logger instead of a `Weak<LoggerProviderInner>`
46+
- `LoggerProviderInner` is no longer `pub (crate)`
47+
- `Logger.provider()` now returns `&LoggerProvider` instead of an `Option<LoggerProvider>`
48+
4449
## v0.21.2
4550

4651
### Fixed

opentelemetry/CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
- [#1410](https://github.com/open-telemetry/opentelemetry-rust/pull/1410) Add experimental synchronous gauge. This is behind the feature flag, and can be enabled by enabling the feature `otel_unstable` for opentelemetry crate.
88

9-
- [#1410](https://github.com/open-telemetry/opentelemetry-rust/pull/1410) Guidelines to add new unstable/experimental features.
9+
- [#1410](https://github.com/open-telemetry/opentelemetry-rust/pull/1410) Guidelines to add new unstable/experimental features.
1010

1111
### Changed
1212

@@ -27,6 +27,8 @@ gains, and avoids `IndexMap` dependency. This affects `body` and `attributes` of
2727
`observe()` calls, and only accept a precreated `AttributeSet`
2828
value.
2929
[#1421](https://github.com/open-telemetry/opentelemetry-rust/pull/1421)
30+
- Turned off events for `NoopLogger` to save on operations
31+
[1455](https://github.com/open-telemetry/opentelemetry-rust/pull/1455)
3032

3133
### Removed
3234

opentelemetry/src/logs/noop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ impl Logger for NoopLogger {
4242
fn emit(&self, _record: LogRecord) {}
4343
#[cfg(feature = "logs_level_enabled")]
4444
fn event_enabled(&self, _level: super::Severity, _target: &str) -> bool {
45-
true
45+
false
4646
}
4747
}

0 commit comments

Comments
 (0)