opentelemetry-collector-contrib
opentelemetry-collector-contrib copied to clipboard
[prometheus components] For histograms without sums, leave the sum unset
Description:
Prometheus histograms don't have a sum if the histogram includes negative observations. Now that the protocol supports a notion of "unset" sums, use this in prometheus components to correctly handle setting the sum.
I tried to do this for the prometheus exporter as well, but NewConstHistogram requires a sum (i.e. doesn't support an unset sum). https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/prometheusexporter/collector.go#L200
Link to tracking Issue:
Part of https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/7546
Testing:
Added unit tests.
cc @open-telemetry/wg-prometheus
This PR was marked stale due to lack of activity. It will be closed in 14 days.
This PR was marked stale due to lack of activity. It will be closed in 14 days.
@dashpole needs a rebase, sorry for the issue.