Skip to content

Commit 31b9ffe

Browse files
authored
fix(metrics-exporter-prometheus): fix broken native histograms serialization (#649)
1 parent 330377f commit 31b9ffe

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

metrics-exporter-prometheus/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ prost-build = { workspace = true, optional = true }
7777

7878
[[example]]
7979
name = "native_histograms"
80-
required-features = ["http-listener"]
80+
required-features = ["http-listener", "protobuf"]
8181

8282
[[example]]
8383
name = "prometheus_push_gateway"

metrics-exporter-prometheus/src/protobuf.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ pub(crate) fn render_protobuf(
164164
}
165165
}
166166
Distribution::NativeHistogram(native_hist) => {
167+
metric_type = Some(pb::MetricType::Histogram);
167168
// Convert our native histogram into Prometheus native histogram format
168169
let positive_buckets = native_hist.positive_buckets();
169170
let negative_buckets = native_hist.negative_buckets();

0 commit comments

Comments
 (0)