Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metrics SDK defaults Histogram instruments to report monotonic sums, but allows negative measurements. #2009

Closed
jsuereth opened this issue Oct 12, 2021 · 0 comments · Fixed by #2010
Assignees
Labels
spec:metrics Related to the specification/metrics directory

Comments

@jsuereth
Copy link
Contributor

Currently, the APi does not specify that histograms record only non-negative instruments, but the DataModel requires the sum field to be a (positive) monotonic sum. These are incompatible with each other and limit prometheus compatibility.

I think we have a few solutions to this issue:

  • Update SDK specification for Histogram aggregation to denote that it cannot produce the sum field with Histogram instrument (only Counter instrument).
  • Update API specification to disallow negative measurements on Histogram instrument. Primary use case for histograms is latency and we don't expect many negative measurements for this key use case.
  • Create a new "Timer" instrument for the latency use case that doesn't support negative measurements and allow Histogram instrument to record negative measurements.

If we don't resolve this, histograms being exported to Prometheus will need explicit View configuration to denote monotonicity on histograms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec:metrics Related to the specification/metrics directory
Projects
None yet
2 participants