Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions opentelemetry-proto/src/transform/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@
Array::I64(vals) => array_into_proto(vals),
Array::F64(vals) => array_into_proto(vals),
Array::String(vals) => array_into_proto(vals),
_ => unreachable!("Nonexistent array type"), // Needs to be updated when new array types are added

Check warning on line 155 in opentelemetry-proto/src/transform/common.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-proto/src/transform/common.rs#L155

Added line #L155 was not covered by tests
})),
_ => unreachable!("Nonexistent value type"), // Needs to be updated when new value types are added

Check warning on line 157 in opentelemetry-proto/src/transform/common.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-proto/src/transform/common.rs#L157

Added line #L157 was not covered by tests
},
}
}
Expand Down
2 changes: 2 additions & 0 deletions opentelemetry-stdout/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@
opentelemetry::Array::String(s) => {
Value::Array(s.into_iter().map(|s| Value::String(s.into())).collect())
}
_ => unreachable!("Nonexistent array type"), // Needs to be updated when new array types are added

Check warning on line 147 in opentelemetry-stdout/src/common.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stdout/src/common.rs#L147

Added line #L147 was not covered by tests
},
_ => unreachable!("Nonexistent value type"), // Needs to be updated when new value types are added

Check warning on line 149 in opentelemetry-stdout/src/common.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-stdout/src/common.rs#L149

Added line #L149 was not covered by tests
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion opentelemetry/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
- 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)
- 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)
- Removed `PartialOrd` and `Ord` implementations for `KeyValue`. [#2215](https://github.com/open-telemetry/opentelemetry-rust/pull/2215)
- - **Breaking change for log exporter authors:** Marked `AnyValue` enum as `non_exhaustive`. [#2230](https://github.com/open-telemetry/opentelemetry-rust/pull/2230)
- **Breaking change for exporter authors:** Marked `KeyValue` related structs and enums as `non_exhaustive`. [#2228](https://github.com/open-telemetry/opentelemetry-rust/pull/2228)
- **Breaking change for log exporter authors:** Marked `AnyValue` enum as `non_exhaustive`. [#2230](https://github.com/open-telemetry/opentelemetry-rust/pull/2230)

## v0.26.0
Released 2024-Sep-30
Expand Down
5 changes: 5 additions & 0 deletions opentelemetry/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::{fmt, hash};
/// See the [attribute naming] spec for guidelines.
///
/// [attribute naming]: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/general/attribute-naming.md
#[non_exhaustive]
#[derive(Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct Key(OtelString);

Expand Down Expand Up @@ -149,6 +150,7 @@ impl hash::Hash for OtelString {
}

/// A [Value::Array] containing homogeneous values.
#[non_exhaustive]
#[derive(Clone, Debug, PartialEq)]
pub enum Array {
/// Array of bools
Expand Down Expand Up @@ -212,6 +214,7 @@ into_array!(
);

/// The value part of attribute [KeyValue] pairs.
#[non_exhaustive]
#[derive(Clone, Debug, PartialEq)]
pub enum Value {
/// bool values
Expand All @@ -227,6 +230,7 @@ pub enum Value {
}

/// Wrapper for string-like values
#[non_exhaustive]
#[derive(Clone, PartialEq, Eq, Hash)]
pub struct StringValue(OtelString);

Expand Down Expand Up @@ -372,6 +376,7 @@ impl fmt::Display for Value {

/// A key-value pair describing an attribute.
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct KeyValue {
/// The attribute name
pub key: Key,
Expand Down
Loading