Skip to content

Commit f24c2ab

Browse files
committed
Update OM 2.0 with proposal#43
Signed-off-by: Arthur Silva Sens <[email protected]>
1 parent 90377c2 commit f24c2ab

File tree

1 file changed

+45
-39
lines changed

1 file changed

+45
-39
lines changed

docs/specs/om/open_metrics_spec_2_0.md

Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ MetricFamily names beginning with underscores are RESERVED and MUST NOT be used
124124

125125
###### Suffixes
126126

127-
The name of a MetricFamily MUST NOT result in a potential clash for sample metric names as per the ABNF with another MetricFamily in the Text Format within a MetricSet. An example would be a gauge called "foo_created" as a counter called "foo" could create a "foo_created" in the text format.
127+
The name of a MetricFamily MUST NOT result in a potential clash for sample metric names as per the ABNF with another MetricFamily in the Text Format within a MetricSet. An example would be a gauge called "foo_total" as a counter called "foo" could create a "foo_total" in the text format.
128128

129129
Exposers SHOULD avoid names that could be confused with the suffixes that text format sample metric names use.
130130

131131
* Suffixes for the respective types are:
132-
* Counter: `_total`, `_created`
133-
* Summary: `_count`, `_sum`, `_created`, `` (empty)
134-
* Histogram: `_count`, `_sum`, `_bucket`, `_created`
132+
* Counter: `_total`
133+
* Summary: `_count`, `_sum`, `` (empty)
134+
* Histogram: `_count`, `_sum`, `_bucket`
135135
* GaugeHistogram: `_gcount`, `_gsum`, `_bucket`
136136
* Info: `_info`
137137
* Gauge: `` (empty)
@@ -403,12 +403,11 @@ An example of a complete exposition:
403403
# TYPE acme_http_router_request_seconds summary
404404
# UNIT acme_http_router_request_seconds seconds
405405
# HELP acme_http_router_request_seconds Latency though all of ACME's HTTP request router.
406-
acme_http_router_request_seconds_sum{path="/api/v1",method="GET"} 9036.32
407-
acme_http_router_request_seconds_count{path="/api/v1",method="GET"} 807283.0
408-
acme_http_router_request_seconds_created{path="/api/v1",method="GET"} 1605281325.0
409-
acme_http_router_request_seconds_sum{path="/api/v2",method="POST"} 479.3
410-
acme_http_router_request_seconds_count{path="/api/v2",method="POST"} 34.0
411-
acme_http_router_request_seconds_created{path="/api/v2",method="POST"} 1605281325.0
406+
acme_http_router_request_seconds_sum{path="/api/v1",method="GET"} 9036.32 [email protected]
407+
acme_http_router_request_seconds_count{path="/api/v1",method="GET"} 807283.0 [email protected]
408+
acme_http_router_request_seconds_created{path="/api/v1",method="GET"} 1605281325.0 [email protected]
409+
acme_http_router_request_seconds_sum{path="/api/v2",method="POST"} 479.3 [email protected]
410+
acme_http_router_request_seconds_count{path="/api/v2",method="POST"} 34.0 [email protected]
412411
# TYPE go_goroutines gauge
413412
# HELP go_goroutines Number of goroutines that currently exist.
414413
go_goroutines 69
@@ -633,7 +632,7 @@ foo 18.0 456
633632

634633
##### Counter
635634

636-
The MetricPoint's Total Value Sample MetricName MUST have the suffix `_total`. If present the MetricPoint's Created Value Sample MetricName MUST have the suffix `_created`.
635+
The MetricPoint's Total Value Sample MetricName MUST have the suffix `_total`. If present the MetricPoint's Created Value MUST be inlined with the Metric point with a `ct@` prefix. If the value's timestamp is present, the Created Value MUST be added right after it. If exemplars are present, the Created Value MUST be added before it.
637636

638637
An example with a Metric with no labels, and a MetricPoint with no timestamp and no created:
639638

@@ -653,20 +652,25 @@ An example with a Metric with no labels, and a MetricPoint with no timestamp and
653652

654653
```
655654
# TYPE foo counter
656-
foo_total 17.0
657-
foo_created 1520430000.123
655+
foo_total 17.0 [email protected]
658656
```
659657

660658
An example with a Metric with no labels, and a MetricPoint with a timestamp and a created:
661659

662660
```
663661
# TYPE foo counter
664-
foo_total 17.0 1520879607.789
665-
foo_created 1520430000.123 1520879607.789
662+
foo_total 17.0 1520879607.789 [email protected]
666663
```
667664

668665
Exemplars MAY be attached to the MetricPoint's Total sample.
669666

667+
An example with a Metric with no labels, and a MetricPoint with a timestamp and a created and an exemplar:
668+
669+
```
670+
# TYPE foo counter
671+
foo_total 17.0 1520879607.789 [email protected] # {trace_id="KOO5S4vxi0o"} 0.67
672+
```
673+
670674
##### StateSet
671675

672676
The Sample MetricName for the value of a MetricPoint for a MetricFamily of type StateSet MUST NOT have a suffix.
@@ -717,30 +721,34 @@ Metric labels and MetricPoint value labels MAY be in any order.
717721

718722
##### Summary
719723

720-
If present, the MetricPoint's Sum Value Sample MetricName MUST have the suffix `_sum`. If present, the MetricPoint's Count Value Sample MetricName MUST have the suffix `_count`. If present, the MetricPoint's Created Value Sample MetricName MUST have the suffix `_created`. 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.
724+
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.
725+
726+
If present the MetricPoint's Created Value MUST be inlined with the Metric point with a `ct@` prefix. If the value's timestamp is present, the Created Value MUST be added right after it. If exemplars are present, the Created Value MUST be added before it. Createad Value MUST be appended to all Quantile Values, to the MetricPoint's Sum and MetricPoint's Count.
721727

722728
An example of a Metric with no labels and a MetricPoint with Sum, Count and Created values:
723729

724730
```
725731
# TYPE foo summary
726-
foo_count 17.0
727-
foo_sum 324789.3
728-
foo_created 1520430000.123
732+
foo_count 17.0 [email protected]
733+
foo_sum 324789.3 [email protected]
729734
```
730735

731-
An example of a Metric with no labels and a MetricPoint with two quantiles:
736+
An example of a Metric with no labels and a MetricPoint with two quantiles and Created values:
732737

733738
```
734739
# TYPE foo summary
735-
foo{quantile="0.95"} 123.7
736-
foo{quantile="0.99"} 150.0
740+
foo{quantile="0.95"} 123.7 [email protected]
741+
foo{quantile="0.99"} 150.0 [email protected]
737742
```
738743

739744
Quantiles MAY be in any order.
740745

741746
##### Histogram
742747

743-
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`. If present, the MetricPoint's Created Value Sample MetricName MUST have the suffix `_created`.
748+
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`.
749+
750+
If present the MetricPoint's Created Value MUST be inlined with the Metric point with a `ct@` prefix. If the value's timestamp is present, the Created Value MUST be added right after it. If exemplars are present, the Created Value MUST be added before it. Createad Value MUST be appended to all Bucket Values, to the MetricPoint's Sum and MetricPoint's Count.
751+
744752
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".
745753

746754
Buckets MUST be sorted in number increasing order of "le", and the value of the "le" label MUST follow the rules for Canonical Numbers.
@@ -749,20 +757,19 @@ An example of a Metric with no labels and a MetricPoint with Sum, Count, and Cre
749757

750758
```
751759
# TYPE foo histogram
752-
foo_bucket{le="0.0"} 0
753-
foo_bucket{le="1e-05"} 0
754-
foo_bucket{le="0.0001"} 5
755-
foo_bucket{le="0.1"} 8
756-
foo_bucket{le="1.0"} 10
757-
foo_bucket{le="10.0"} 11
758-
foo_bucket{le="100000.0"} 11
759-
foo_bucket{le="1e+06"} 15
760-
foo_bucket{le="1e+23"} 16
761-
foo_bucket{le="1.1e+23"} 17
762-
foo_bucket{le="+Inf"} 17
763-
foo_count 17
764-
foo_sum 324789.3
765-
foo_created 1520430000.123
760+
foo_bucket{le="0.0"} 0 [email protected]
761+
foo_bucket{le="1e-05"} 0 [email protected]
762+
foo_bucket{le="0.0001"} 5 [email protected]
763+
foo_bucket{le="0.1"} 8 [email protected]
764+
foo_bucket{le="1.0"} 10 [email protected]
765+
foo_bucket{le="10.0"} 11 [email protected]
766+
foo_bucket{le="100000.0"} 11 [email protected]
767+
foo_bucket{le="1e+06"} 15 [email protected]
768+
foo_bucket{le="1e+23"} 16 [email protected]
769+
foo_bucket{le="1.1e+23"} 17 [email protected]
770+
foo_bucket{le="+Inf"} 17 [email protected]
771+
foo_count 17 [email protected]
772+
foo_sum 324789.3 [email protected]
766773
```
767774

768775
###### Exemplars
@@ -781,7 +788,6 @@ foo_bucket{le="10"} 17 # {trace_id="oHg5SJYRHA0"} 9.8 1520879607.789
781788
foo_bucket{le="+Inf"} 17
782789
foo_count 17
783790
foo_sum 324789.3
784-
foo_created 1520430000.123
785791
```
786792

787793
##### GaugeHistogram
@@ -1120,7 +1126,7 @@ my_time_since_boot_seconds 123
11201126
```
11211127

11221128
Conversely, there are no best practice restrictions on exemplars timestamps.
1123-
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 "_created" for a MetricPoint could appear to be slightly after an exemplar or sample timestamp for that same MetricPoint.
1129+
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.
11241130

11251131
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.
11261132

0 commit comments

Comments
 (0)