Skip to content

Commit 1ecd1a8

Browse files
authored
fix: KeyValueMetadata to not expose its fields public (#2843)
1 parent 3e77a22 commit 1ecd1a8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

opentelemetry/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- `Baggage` can't be retrieved from the `Context` directly anymore and needs to be accessed via `context.baggage()`
1515
- `with_baggage()` and `current_with_baggage()` override any existing `Baggage` in the `Context`
1616
- `Baggage` keys can't be empty and only allow ASCII visual chars, except `"(),/:;<=>?@[\]{}` (see [RFC7230, Section 3.2.6](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6))
17+
- `KeyValueMetadata` does not publicly expose its fields. This should be transparent change to the users.
1718
- Changed `Context` to use a stack to properly handle out of order dropping of `ContextGuard`. This imposes a limit of `65535` nested contexts on a single thread. See #[2378](https://github.com/open-telemetry/opentelemetry-rust/pull/2284) and #[1887](https://github.com/open-telemetry/opentelemetry-rust/issues/1887).
1819
- Added additional `name: Option<&str>` parameter to the `event_enabled` method
1920
on the `Logger` trait. This allows implementations (SDK, processor, exporters)

opentelemetry/src/baggage.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,11 +458,11 @@ impl fmt::Display for BaggageMetadata {
458458
#[derive(Clone, Debug, PartialEq)]
459459
pub struct KeyValueMetadata {
460460
/// Dimension or event key
461-
pub key: Key,
461+
pub(crate) key: Key,
462462
/// Dimension or event value
463-
pub value: StringValue,
463+
pub(crate) value: StringValue,
464464
/// Metadata associate with this key value pair
465-
pub metadata: BaggageMetadata,
465+
pub(crate) metadata: BaggageMetadata,
466466
}
467467

468468
impl KeyValueMetadata {

0 commit comments

Comments
 (0)