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: Monotonic option to express cumulatives #465

Closed
jmacd opened this issue Feb 13, 2020 · 3 comments · Fixed by open-telemetry/oteps#98
Closed

Metrics: Monotonic option to express cumulatives #465

jmacd opened this issue Feb 13, 2020 · 3 comments · Fixed by open-telemetry/oteps#98
Assignees
Labels
spec:metrics Related to the specification/metrics directory
Milestone

Comments

@jmacd
Copy link
Contributor

jmacd commented Feb 13, 2020

In the 0.3 spec release, we removed options to say an instrument accepts only non-negative values and to say that an instrument accepts only ascending values. Both of these options are about monotonicity: in Counters, a non-negative input defines a monotonic sum. In Observers, there is a desire to report cumulative statistics (e.g., CPU usage). In both cases, the user should have a way to declare this option so that exporters know how to export these events.

We have discussed introducing new metric instruments instead of options for this, e.g., let Counter be restricted to non-negatives, and introduce UpDownCounter for counters that rise and fall.

Resolve in the 0.4 release. See the comment: #430 (comment)

@jmacd jmacd added this to the v0.4 milestone Feb 13, 2020
@jmacd jmacd added the spec:metrics Related to the specification/metrics directory label Feb 13, 2020
@bogdandrutu
Copy link
Member

I missed this decision, but this is critical for systems like Prometheus.

@jmacd
Copy link
Contributor Author

jmacd commented Feb 20, 2020

Our current thinking is:
(1) Counter should accept only non-negative values, thus always defines a monotonic sum (and Prometheus will know it)
(2) We can introduce an "UpDownCounter" if users complain about wanting it.
(3) We let "Observer" be unrestricted, not monotonic.
(4) We add "MonotonicObserver" to get the behavior that Prometheus wants.

This is consistent with a general approach of "no instrument options, only optional instruments".

@jmacd
Copy link
Contributor Author

jmacd commented Apr 28, 2020

This will close when OTEP 98 is approved and merged into the specification.
Please review: open-telemetry/oteps#98

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
Development

Successfully merging a pull request may close this issue.

2 participants