You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(om2): histograms and negative observed values (#2627)
OM1.0 required that the Sum of Histograms is not represented when there are negative observations in a histogram.
This PR is removing this requirement in OM2.0. Due to:
The requirement was never implemented by the Go and Java instrumentation libraries. Enforcing it now would be breaking.
The requirement makes it impossible to implement the use case where the user wants to measure the Sum anyway. Which means for example that you'll not be able to calculate average from Sum/Count.
We already warned users in the documentation about the possibility of Sum decreasing and not being usable for rate() 10 years ago: PR.
And native histograms will not take Sum into account when calculating counter resets during rate() , thus this problem won't come up.
Note1: the python reference implementation did follow the requirement.
Note 2: this PR does not make Sum mandatory, that is a different question.
Signed-off-by: György Krajcsovits <[email protected]>
Copy file name to clipboardExpand all lines: docs/specs/om/open_metrics_spec_2_0.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -222,8 +222,11 @@ Histogram MetricPoints MUST have one bucket with an +Inf threshold. Buckets MUST
222
222
223
223
The +Inf bucket counts all requests. If present, the Sum value MUST equal the Sum of all the measured event values. Bucket thresholds within a MetricPoint MUST be unique.
224
224
225
-
Semantically, Sum, and buckets values are counters so MUST NOT be NaN or negative.
226
-
Negative threshold buckets MAY be used, but then the Histogram MetricPoint MUST NOT contain a sum value as it would no longer be a counter semantically. Bucket thresholds MUST NOT equal NaN. Count and bucket values MUST be integers.
225
+
Semantically, buckets values are counters so MUST NOT be NaN or negative.
226
+
227
+
The Sum is only a counter semantically as long as there are no negative event values measured by the Histogram MetricPoint. The Sum MUST NOT be NaN.
228
+
229
+
Negative threshold buckets MAY be used. Bucket thresholds MUST NOT equal NaN. Count and bucket values MUST be integers.
227
230
228
231
A Histogram MetricPoint SHOULD have a Timestamp value called Created Timestamp. This can help ingestors discern between new metrics and long-running ones it did not see before.
0 commit comments