opentelemetry-collector-contrib icon indicating copy to clipboard operation
opentelemetry-collector-contrib copied to clipboard

[prometheus components] For histograms without sums, leave the sum unset

Open dashpole opened this issue 3 years ago • 3 comments
trafficstars

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.

dashpole avatar Apr 08 '22 13:04 dashpole

cc @open-telemetry/wg-prometheus

dashpole avatar Apr 25 '22 12:04 dashpole

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar Jun 13 '22 05:06 github-actions[bot]

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar Jul 06 '22 05:07 github-actions[bot]

@dashpole needs a rebase, sorry for the issue.

bogdandrutu avatar Sep 02 '22 20:09 bogdandrutu