-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
enhancementNew feature or requestNew feature or requestpkg:exporter:prometheusRelated to the Prometheus exporter packageRelated to the Prometheus exporter package
Description
Problem Statement
We currently drop exponential histograms in the prometheus exporter:
opentelemetry-go/exporters/prometheus/exporter.go
Lines 226 to 239 in 48fedfa
switch v := m.Data.(type) { | |
case metricdata.Histogram[int64]: | |
addHistogramMetric(ch, v, m, keys, values, name, c.resourceKeyVals) | |
case metricdata.Histogram[float64]: | |
addHistogramMetric(ch, v, m, keys, values, name, c.resourceKeyVals) | |
case metricdata.Sum[int64]: | |
addSumMetric(ch, v, m, keys, values, name, c.resourceKeyVals) | |
case metricdata.Sum[float64]: | |
addSumMetric(ch, v, m, keys, values, name, c.resourceKeyVals) | |
case metricdata.Gauge[int64]: | |
addGaugeMetric(ch, v, m, keys, values, name, c.resourceKeyVals) | |
case metricdata.Gauge[float64]: | |
addGaugeMetric(ch, v, m, keys, values, name, c.resourceKeyVals) | |
} |
Proposed Solution
We should convert them to prometheus native histograms per https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md#exponential-histograms
Additional Context
Related to open-telemetry/opentelemetry-collector-contrib#33703
This is currently difficult to do because we use prometheus.NewConstHistogram here:
m, err := prometheus.NewConstHistogram(desc, dp.Count, float64(dp.Sum), buckets, values...) |
There is no NewConstNativeHistogram in the prometheus client. We would currently need to implement the prometheus.Metric interface directly, which is a bit more work.
krantideep95, coxley and GiedriusS
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestpkg:exporter:prometheusRelated to the Prometheus exporter packageRelated to the Prometheus exporter package
Type
Projects
Status
No status