From c8bda87a3287425c1820ffd81cd2cd77837f01b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gy=C3=B6rgy=20Krajcsovits?= Date: Thu, 12 Mar 2026 09:16:37 +0100 Subject: [PATCH] fix(om2.0): consistency between text and abnf on Summary fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In #2627 and #2634 we've made the Sum and Count mandatory fields in histograms. They became mandatory in Summary due to the ABNF as that has precedence. This PR changes the data model to follow the ABNF and be consistent with histograms. Note: this is probably the last chance to reverse course and make Sum and/or Count optional without a breaking change. Signed-off-by: György Krajcsovits # Conflicts: # docs/specs/om/open_metrics_spec_2_0.md --- docs/specs/om/open_metrics_spec_2_0.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/specs/om/open_metrics_spec_2_0.md b/docs/specs/om/open_metrics_spec_2_0.md index a17eb79ee..7aebd259a 100644 --- a/docs/specs/om/open_metrics_spec_2_0.md +++ b/docs/specs/om/open_metrics_spec_2_0.md @@ -384,12 +384,12 @@ Summaries also measure distributions of discrete events and MAY be used when His They MAY also be used for backwards compatibility, because some existing instrumentation libraries expose precomputed quantiles and do not support Histograms. Precomputed quantiles SHOULD NOT be used, because quantiles are not aggregatable and the user often can not deduce what timeframe they cover. -A Summary MetricPoint MAY consist of a Count, Sum, Start Timestamp, and a set of quantiles. +A Summary MetricPoint MUST contain a Count, Sum and a set of quantiles. Semantically, Count and Sum values are counters so MUST NOT be NaN or negative. Count MUST be an integer. -A MetricPoint in a Metric with the Type Summary which contains Count or Sum values SHOULD have a Timestamp value called Start Timestamp. This can help ingestors discern between new metrics and long-running ones it did not see before. Start Timestamp MUST NOT relate to the collection period of quantile values. +A Summary SHOULD have a Timestamp value called Start Timestamp. This can help ingestors discern between new metrics and long-running ones it did not see before. Start Timestamp MUST NOT relate to the collection period of quantile values. Quantiles are a map from a quantile to a value. An example is a quantile 0.95 with value 0.2 in a metric called myapp_http_request_duration_seconds which means that the 95th percentile latency is 200ms over an unknown timeframe. If there are no events in the relevant timeframe, the value for a quantile MUST be NaN. A Quantile's Metric's LabelSet MUST NOT have "quantile" label name.