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
Copy file name to clipboardExpand all lines: docs/specs/om/open_metrics_spec_2_0.md
+54-54Lines changed: 54 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -192,9 +192,9 @@ Counters measure discrete events. Common examples are the number of HTTP request
192
192
193
193
A MetricPoint in a Metric with the type Counter MUST have one value called Total. A Total is a non-NaN and MUST be monotonically non-decreasing over time, starting from 0.
194
194
195
-
A MetricPoint in a Metric with the type Counter 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.
195
+
A MetricPoint in a Metric with the type Counter 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.
196
196
197
-
A MetricPoint in a Metric's Counter's Total MAY reset to 0. If present, the corresponding Created Timestamp MUST also be set to the timestamp of the reset.
197
+
A MetricPoint in a Metric's Counter's Total MAY reset to 0. If present, the corresponding Start Timestamp MUST also be set to the timestamp of the reset.
198
198
199
199
A MetricPoint in a Metric's Counter's Total MAY have an exemplar.
200
200
@@ -230,7 +230,7 @@ MetricFamilies of type Info MUST have an empty Unit string.
230
230
231
231
Histograms measure distributions of discrete events. Common examples are the latency of HTTP requests, function runtimes, or I/O request sizes.
232
232
233
-
A Histogram MetricPoint MUST contain at least one bucket, and SHOULD contain Sum, and Created Timestamp values. Every bucket MUST have a threshold and a value.
233
+
A Histogram MetricPoint MUST contain at least one bucket, and SHOULD contain Sum, and Start Timestamp values. Every bucket MUST have a threshold and a value.
234
234
235
235
Histogram MetricPoints MUST have one bucket with an +Inf threshold. Buckets MUST be cumulative. As an example for a metric representing request latency in seconds its values for buckets with thresholds 1, 2, 3, and +Inf MUST follow value_1 <= value_2 <= value_3 <= value_+Inf. If ten requests took 1 second each, the values of the 1, 2, 3, and +Inf buckets MUST equal 10.
236
236
@@ -242,7 +242,7 @@ The Sum is only a counter semantically as long as there are no negative event va
242
242
243
243
Negative threshold buckets MAY be used. Bucket thresholds MUST NOT equal NaN. Count and bucket values MUST be integers.
244
244
245
-
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.
245
+
A Histogram MetricPoint 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.
246
246
247
247
A Histogram's Metric's LabelSet MUST NOT have a "le" label name.
248
248
@@ -276,12 +276,12 @@ Summaries also measure distributions of discrete events and MAY be used when His
276
276
277
277
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.
278
278
279
-
A Summary MetricPoint MAY consist of a Count, Sum, Created Timestamp, and a set of quantiles.
279
+
A Summary MetricPoint MAY consist of a Count, Sum, Start Timestamp, and a set of quantiles.
280
280
281
281
Semantically, Count and Sum values are counters so MUST NOT be NaN or negative.
282
282
Count MUST be an integer.
283
283
284
-
A MetricPoint in a Metric with the type Summary which contains Count or Sum values 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. Created Timestamp MUST NOT relate to the collection period of quantile values.
284
+
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.
285
285
286
286
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.
287
287
A Quantile's Metric's LabelSet MUST NOT have "quantile" label name.
# HELP go_goroutines Number of goroutines that currently exist.
437
437
go_goroutines 69
@@ -660,52 +660,52 @@ foo 18.0 456
660
660
661
661
##### Counter
662
662
663
-
The MetricPoint's Total Value Sample MetricName SHOULD have the suffix `_total`. If present, the MetricPoint's Created Timestamp MUST be inlined with the Metric point with a `ct@` prefix. If the value's timestamp is present, the Created Timestamp MUST be added right after it. If exemplar is present, the Created Timestamp MUST be added before it.
663
+
The MetricPoint's Total Value Sample MetricName SHOULD have the suffix `_total`. If present, the MetricPoint's Start Timestamp MUST be inlined with the Metric point with a `st@` prefix. If the value's timestamp is present, the Start Timestamp MUST be added right after it. If exemplar is present, the Start Timestamp MUST be added before it.
664
664
665
665
Be aware that exposing metrics without `_total` being a suffix of the MetricFamily name directly to end-users may reduce the usability due to confusion about what the metric's type is.
666
666
667
-
An example with a Metric with no labels, and a MetricPoint with no timestamp and no Created Timestamp:
667
+
An example with a Metric with no labels, and a MetricPoint with no timestamp and no Start Timestamp:
668
668
669
669
```openmetrics-add-eof
670
670
# TYPE foo counter
671
671
foo_total 17.0
672
672
```
673
673
674
-
An example with a Metric with no labels, and a MetricPoint with a timestamp and no Created Timestamp:
674
+
An example with a Metric with no labels, and a MetricPoint with a timestamp and no Start Timestamp:
675
675
676
676
```openmetrics-add-eof
677
677
# TYPE foo counter
678
678
foo_total 17.0 1520879607.789
679
679
```
680
680
681
-
An example with a Metric with no labels, and a MetricPoint with no timestamp and a Created Timestamp:
681
+
An example with a Metric with no labels, and a MetricPoint with no timestamp and a Start Timestamp:
682
682
683
683
```openmetrics-add-eof
684
684
# TYPE foo counter
685
-
foo_total 17.0 ct@1520430000.123
685
+
foo_total 17.0 st@1520430000.123
686
686
```
687
687
688
-
An example with a Metric with no labels, and a MetricPoint with a timestamp and a Created Timestamp:
688
+
An example with a Metric with no labels, and a MetricPoint with a timestamp and a Start Timestamp:
689
689
690
690
```openmetrics-add-eof
691
691
# TYPE foo counter
692
-
foo_total 17.0 1520879607.789 ct@1520430000.123
692
+
foo_total 17.0 1520879607.789 st@1520430000.123
693
693
```
694
694
695
-
An example with a Metric with no labels, and a MetricPoint without the `_total` suffix and with a timestamp and a created:
695
+
An example with a Metric with no labels, and a MetricPoint without the `_total` suffix and with a timestamp and a start timestamp:
696
696
697
697
```openmetrics-add-eof
698
698
# TYPE foo counter
699
-
foo 17.0 1520879607.789 ct@1520879607.789
699
+
foo 17.0 1520879607.789 st@1520879607.789
700
700
```
701
701
702
702
Exemplars MAY be attached to the MetricPoint's Total sample.
703
703
704
-
An example with a Metric with no labels, and a MetricPoint with a timestamp and a Created Timestamp and an exemplar:
704
+
An example with a Metric with no labels, and a MetricPoint with a timestamp and a Start Timestamp and an exemplar:
@@ -760,22 +760,22 @@ Metric labels and MetricPoint value labels MAY be in any order.
760
760
761
761
If present, the MetricPoint's Sum Value Sample MetricName MUST have the suffix `_sum`. If present, the MetricPoint's Count Value MetricName MUST have the suffix `_count`. If present, the MetricPoint's Quantile Values MUST specify the quantile measured using a label with a label name of "quantile" and with a label value of the quantile measured.
762
762
763
-
If present the MetricPoint's Created Timestamp MUST be inlined with the Metric point with a `ct@` prefix. If the value's timestamp is present, the Created Timestamp MUST be added right after it. If exemplar is present, the Created Timestamp MUST be added before it. Created Timestamp MUST be appended to all Quantile Values, to the MetricPoint's Sum and MetricPoint's Count.
763
+
If present the MetricPoint's Start Timestamp MUST be inlined with the Metric point with a `st@` prefix. If the value's timestamp is present, the Start Timestamp MUST be added right after it. If exemplar is present, the Start Timestamp MUST be added before it. Start Timestamp MUST be appended to all Quantile Values, to the MetricPoint's Sum and MetricPoint's Count.
764
764
765
-
An example of a Metric with no labels and a MetricPoint with Sum, Count and Created Timestamp values:
765
+
An example of a Metric with no labels and a MetricPoint with Sum, Count and Start Timestamp values:
766
766
767
767
```openmetrics-add-eof
768
768
# TYPE foo summary
769
-
foo_count 17.0 ct@1520430000.123
770
-
foo_sum 324789.3 ct@1520430000.123
769
+
foo_count 17.0 st@1520430000.123
770
+
foo_sum 324789.3 st@1520430000.123
771
771
```
772
772
773
-
An example of a Metric with no labels and a MetricPoint with two quantiles and Created Timestamp values:
773
+
An example of a Metric with no labels and a MetricPoint with two quantiles and Start Timestamp values:
774
774
775
775
```openmetrics-add-eof
776
776
# TYPE foo summary
777
-
foo{quantile="0.95"} 123.7 ct@1520430000.123
778
-
foo{quantile="0.99"} 150.0 ct@1520430000.123
777
+
foo{quantile="0.95"} 123.7 st@1520430000.123
778
+
foo{quantile="0.99"} 150.0 st@1520430000.123
779
779
```
780
780
781
781
Quantiles MAY be in any order.
@@ -784,29 +784,29 @@ Quantiles MAY be in any order.
784
784
785
785
The MetricPoint's Bucket Values Sample MetricNames MUST have the suffix `_bucket`. If present, the MetricPoint's Sum Value Sample MetricName MUST have the suffix `_sum`.
786
786
787
-
If present the MetricPoint's Created Timestamp MUST be inlined with the Metric point with a `ct@` prefix. If the value's timestamp is present, the Created Timestamp MUST be added right after it. If exemplar is present, the Created Timestamp MUST be added before it. Created Timestamp MUST be appended to all Bucket Values, to the MetricPoint's Sum and MetricPoint's Count.
787
+
If present the MetricPoint's Start Timestamp MUST be inlined with the Metric point with a `st@` prefix. If the value's timestamp is present, the Start Timestamp MUST be added right after it. If exemplar is present, the Start Timestamp MUST be added before it. Start Timestamp MUST be appended to all Bucket Values, to the MetricPoint's Sum and MetricPoint's Count.
788
788
789
789
If and only if a Sum Value is present in a MetricPoint, then the MetricPoint's +Inf Bucket value MUST also appear in a Sample with a MetricName with the suffix "_count".
790
790
791
791
Buckets MUST be sorted in number increasing order of "le", and the value of the "le" label MUST follow the rules for Canonical Numbers.
792
792
793
-
An example of a Metric with no labels and a MetricPoint with Sum, Count, and Created Timestamp values, and with 12 buckets. A wide and atypical but valid variety of “le” values is shown on purpose:
793
+
An example of a Metric with no labels and a MetricPoint with Sum, Count, and Start Timestamp values, and with 12 buckets. A wide and atypical but valid variety of “le” values is shown on purpose:
794
794
795
795
```openmetrics-add-eof
796
796
# TYPE foo histogram
797
-
foo_bucket{le="0.0"} 0 ct@1520430000.123
798
-
foo_bucket{le="1e-05"} 0 ct@1521430000.123
799
-
foo_bucket{le="0.0001"} 5 ct@1521430020.123
800
-
foo_bucket{le="0.1"} 8 ct@1520430321.123
801
-
foo_bucket{le="1.0"} 10 ct@1522430000.123
802
-
foo_bucket{le="10.0"} 11 ct@1520430123.123
803
-
foo_bucket{le="100000.0"} 11 ct@1521430010.123
804
-
foo_bucket{le="1e+06"} 15 ct@1520430301.123
805
-
foo_bucket{le="1e+23"} 16 ct@1521430001.123
806
-
foo_bucket{le="1.1e+23"} 17 ct@1522430220.123
807
-
foo_bucket{le="+Inf"} 17 ct@1520430000.123
808
-
foo_count 17 ct@1520430000.123
809
-
foo_sum 324789.3 ct@1520430000.123
797
+
foo_bucket{le="0.0"} 0 st@1520430000.123
798
+
foo_bucket{le="1e-05"} 0 st@1521430000.123
799
+
foo_bucket{le="0.0001"} 5 st@1521430020.123
800
+
foo_bucket{le="0.1"} 8 st@1520430321.123
801
+
foo_bucket{le="1.0"} 10 st@1522430000.123
802
+
foo_bucket{le="10.0"} 11 st@1520430123.123
803
+
foo_bucket{le="100000.0"} 11 st@1521430010.123
804
+
foo_bucket{le="1e+06"} 15 st@1520430301.123
805
+
foo_bucket{le="1e+23"} 16 st@1521430001.123
806
+
foo_bucket{le="1.1e+23"} 17 st@1522430220.123
807
+
foo_bucket{le="+Inf"} 17 st@1520430000.123
808
+
foo_count 17 st@1520430000.123
809
+
foo_sum 324789.3 st@1520430000.123
810
810
```
811
811
812
812
###### Exemplars
@@ -818,13 +818,13 @@ The "0.01" bucket has no Exemplar. The 0.1 bucket has an Exemplar with no Labels
Conversely, there are no best practice restrictions on exemplars timestamps.
1168
-
Keep in mind that due to race conditions or time not being perfectly synced across devices, that an exemplar timestamp may appear to be slightly in the future relative to a ingestor's system clock or other metrics from the same exposition. Similarly it is possible that a "ct@" for a MetricPoint could appear to be slightly after an exemplar or sample timestamp for that same MetricPoint.
1168
+
Keep in mind that due to race conditions or time not being perfectly synced across devices, that an exemplar timestamp may appear to be slightly in the future relative to a ingestor's system clock or other metrics from the same exposition. Similarly it is possible that a "st@" for a MetricPoint could appear to be slightly after an exemplar or sample timestamp for that same MetricPoint.
1169
1169
1170
1170
Keep in mind that there are monitoring systems in common use which support everything from nanosecond to second resolution, so having two MetricPoints that have the same timestamp when truncated to second resolution may cause an apparent duplicate in the ingestor. In this case the MetricPoint with the earliest timestamp MUST be used.
0 commit comments