Skip to content

Commit 2bb53b4

Browse files
authored
[Logs API] Mark Anyvalue enum as non-exhaustive (#2230)
1 parent ea4b5e4 commit 2bb53b4

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

opentelemetry-proto/src/transform/logs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ pub mod tonic {
5151
.collect(),
5252
}),
5353
LogsAnyValue::Bytes(v) => Value::BytesValue(*v),
54+
_ => unreachable!("Nonexistent value type"),
5455
}
5556
}
5657
}

opentelemetry-stdout/src/common.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ impl From<opentelemetry::logs::AnyValue> for Value {
169169
.collect(),
170170
),
171171
opentelemetry::logs::AnyValue::Bytes(b) => Value::BytesValue(*b),
172+
_ => unreachable!("Nonexistent value type"),
172173
}
173174
}
174175
}

opentelemetry/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Introduced `SyncInstrument` trait to replace the individual synchronous instrument traits (`SyncCounter`, `SyncGauge`, `SyncHistogram`, `SyncUpDownCounter`) which are meant for SDK implementation. [#2207](https://github.com/open-telemetry/opentelemetry-rust/pull/2207)
99
- Ensured that `observe` method on asynchronous instruments can only be called inside a callback. This was done by removing the implementation of `AsyncInstrument` trait for each of the asynchronous instruments. [#2210](https://github.com/open-telemetry/opentelemetry-rust/pull/2210)
1010
- Removed `PartialOrd` and `Ord` implementations for `KeyValue`. [#2215](https://github.com/open-telemetry/opentelemetry-rust/pull/2215)
11+
- - **Breaking change for log exporter authors:** Marked `AnyValue` enum as `non_exhaustive`. [#2230](https://github.com/open-telemetry/opentelemetry-rust/pull/2230)
1112

1213
## v0.26.0
1314
Released 2024-Sep-30

opentelemetry/src/logs/record.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ pub trait LogRecord {
6262

6363
/// Value types for representing arbitrary values in a log record.
6464
#[derive(Debug, Clone, PartialEq)]
65+
#[non_exhaustive]
6566
pub enum AnyValue {
6667
/// An integer value
6768
Int(i64),

0 commit comments

Comments
 (0)