Skip to content

Commit ee584fd

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

File tree

1 file changed

+45
-39
lines changed

1 file changed

+45
-39
lines changed

content/docs/specs/om/open_metrics_spec_2_0.md

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

127127
###### Suffixes
128128

129-
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.
129+
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.
130130

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

133133
* Suffixes for the respective types are:
134-
* Counter: `_total`, `_created`
135-
* Summary: `_count`, `_sum`, `_created`, `` (empty)
136-
* Histogram: `_count`, `_sum`, `_bucket`, `_created`
134+
* Counter: `_total`
135+
* Summary: `_count`, `_sum`, `` (empty)
136+
* Histogram: `_count`, `_sum`, `_bucket`
137137
* GaugeHistogram: `_gcount`, `_gsum`, `_bucket`
138138
* Info: `_info`
139139
* Gauge: `` (empty)
@@ -405,12 +405,11 @@ An example of a complete exposition:
405405
# TYPE acme_http_router_request_seconds summary
406406
# UNIT acme_http_router_request_seconds seconds
407407
# HELP acme_http_router_request_seconds Latency though all of ACME's HTTP request router.
408-
acme_http_router_request_seconds_sum{path="/api/v1",method="GET"} 9036.32
409-
acme_http_router_request_seconds_count{path="/api/v1",method="GET"} 807283.0
410-
acme_http_router_request_seconds_created{path="/api/v1",method="GET"} 1605281325.0
411-
acme_http_router_request_seconds_sum{path="/api/v2",method="POST"} 479.3
412-
acme_http_router_request_seconds_count{path="/api/v2",method="POST"} 34.0
413-
acme_http_router_request_seconds_created{path="/api/v2",method="POST"} 1605281325.0
408+
acme_http_router_request_seconds_sum{path="/api/v1",method="GET"} 9036.32 [email protected]
409+
acme_http_router_request_seconds_count{path="/api/v1",method="GET"} 807283.0 [email protected]
410+
acme_http_router_request_seconds_created{path="/api/v1",method="GET"} 1605281325.0 [email protected]
411+
acme_http_router_request_seconds_sum{path="/api/v2",method="POST"} 479.3 [email protected]
412+
acme_http_router_request_seconds_count{path="/api/v2",method="POST"} 34.0 [email protected]
414413
# TYPE go_goroutines gauge
415414
# HELP go_goroutines Number of goroutines that currently exist.
416415
go_goroutines 69
@@ -635,7 +634,7 @@ foo 18.0 456
635634

636635
##### Counter
637636

638-
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`.
637+
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.
639638

640639
An example with a Metric with no labels, and a MetricPoint with no timestamp and no created:
641640

@@ -655,20 +654,25 @@ An example with a Metric with no labels, and a MetricPoint with no timestamp and
655654

656655
```
657656
# TYPE foo counter
658-
foo_total 17.0
659-
foo_created 1520430000.123
657+
foo_total 17.0 [email protected]
660658
```
661659

662660
An example with a Metric with no labels, and a MetricPoint with a timestamp and a created:
663661

664662
```
665663
# TYPE foo counter
666-
foo_total 17.0 1520879607.789
667-
foo_created 1520430000.123 1520879607.789
664+
foo_total 17.0 1520879607.789 [email protected]
668665
```
669666

670667
Exemplars MAY be attached to the MetricPoint's Total sample.
671668

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

674678
The Sample MetricName for the value of a MetricPoint for a MetricFamily of type StateSet MUST NOT have a suffix.
@@ -719,30 +723,34 @@ Metric labels and MetricPoint value labels MAY be in any order.
719723

720724
##### Summary
721725

722-
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.
726+
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.
727+
728+
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.
723729

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

726732
```
727733
# TYPE foo summary
728-
foo_count 17.0
729-
foo_sum 324789.3
730-
foo_created 1520430000.123
734+
foo_count 17.0 [email protected]
735+
foo_sum 324789.3 [email protected]
731736
```
732737

733-
An example of a Metric with no labels and a MetricPoint with two quantiles:
738+
An example of a Metric with no labels and a MetricPoint with two quantiles and Created values:
734739

735740
```
736741
# TYPE foo summary
737-
foo{quantile="0.95"} 123.7
738-
foo{quantile="0.99"} 150.0
742+
foo{quantile="0.95"} 123.7 [email protected]
743+
foo{quantile="0.99"} 150.0 [email protected]
739744
```
740745

741746
Quantiles MAY be in any order.
742747

743748
##### Histogram
744749

745-
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`.
750+
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`.
751+
752+
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.
753+
746754
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".
747755

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

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

770777
###### Exemplars
@@ -783,7 +790,6 @@ foo_bucket{le="10"} 17 # {trace_id="oHg5SJYRHA0"} 9.8 1520879607.789
783790
foo_bucket{le="+Inf"} 17
784791
foo_count 17
785792
foo_sum 324789.3
786-
foo_created 1520430000.123
787793
```
788794

789795
##### GaugeHistogram
@@ -1122,7 +1128,7 @@ my_time_since_boot_seconds 123
11221128
```
11231129

11241130
Conversely, there are no best practice restrictions on exemplars timestamps.
1125-
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.
1131+
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.
11261132

11271133
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.
11281134

0 commit comments

Comments
 (0)