Skip to content

Commit c36db50

Browse files
authored
Stdout to print temporality in user readable format (#1260)
1 parent 52dd8d3 commit c36db50

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

opentelemetry-stdout/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
- Timestamp is additionally exported in user-friendly format.
66
[#1192](https://github.com/open-telemetry/opentelemetry-rust/pull/1192).
7+
- MetricExporter - Temporality is exported in user-friendly format.
8+
[#1260](https://github.com/open-telemetry/opentelemetry-rust/pull/1260).
79

810
## v0.1.0
911

opentelemetry-stdout/src/metrics/transform.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,11 @@ impl Serialize for Temporality {
184184
where
185185
S: Serializer,
186186
{
187-
serializer.serialize_u8(*self as u32 as u8)
187+
match &self {
188+
Temporality::Cumulative => serializer.serialize_str("Cumulative"),
189+
Temporality::Delta => serializer.serialize_str("Delta"),
190+
Temporality::Unspecified => serializer.serialize_str("Unspecified"),
191+
}
188192
}
189193
}
190194

0 commit comments

Comments
 (0)