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
Update OM 2.0 with proposal#43 Created Timestamp syntax (#2636)
* Update OM 2.0 with proposal#43
* Update ABNF representation of Created Values
Signed-off-by: Arthur Silva Sens <[email protected]>
Signed-off-by: George Krajcsovits <[email protected]>
Co-authored-by: George Krajcsovits <[email protected]>
Copy file name to clipboardExpand all lines: docs/specs/om/open_metrics_spec_2_0.md
+61-53Lines changed: 61 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,14 +124,14 @@ MetricFamily names beginning with underscores are RESERVED and MUST NOT be used
124
124
125
125
###### Suffixes
126
126
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.
128
128
129
129
Exposers SHOULD avoid names that could be confused with the suffixes that text format sample metric names use.
@@ -216,7 +216,7 @@ MetricFamilies of type Info MUST have an empty Unit string.
216
216
217
217
Histograms measure distributions of discrete events. Common examples are the latency of HTTP requests, function runtimes, or I/O request sizes.
218
218
219
-
A Histogram MetricPoint MUST contain at least one bucket, and SHOULD contain Sum, and Created values. Every bucket MUST have a threshold and a value.
219
+
A Histogram MetricPoint MUST contain at least one bucket, and SHOULD contain Sum, and Created Values. Every bucket MUST have a threshold and a value.
220
220
221
221
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.
# HELP go_goroutines Number of goroutines that currently exist.
414
415
go_goroutines 69
@@ -633,7 +634,7 @@ foo 18.0 456
633
634
634
635
##### Counter
635
636
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`.
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 exemplar is present, the Created Value MUST be added before it.
637
638
638
639
An example with a Metric with no labels, and a MetricPoint with no timestamp and no created:
639
640
@@ -642,31 +643,36 @@ An example with a Metric with no labels, and a MetricPoint with no timestamp and
642
643
foo_total 17.0
643
644
```
644
645
645
-
An example with a Metric with no labels, and a MetricPoint with a timestamp and no created:
646
+
An example with a Metric with no labels, and a MetricPoint with a timestamp and no Created Value:
646
647
647
648
```openmetrics-add-eof
648
649
# TYPE foo counter
649
650
foo_total 17.0 1520879607.789
650
651
```
651
652
652
-
An example with a Metric with no labels, and a MetricPoint with no timestamp and a created:
653
+
An example with a Metric with no labels, and a MetricPoint with no timestamp and a Created Value:
The Sample MetricName for the value of a MetricPoint for a MetricFamily of type StateSet MUST NOT have a suffix.
@@ -717,52 +723,55 @@ Metric labels and MetricPoint value labels MAY be in any order.
717
723
718
724
##### Summary
719
725
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.
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 exemplar is present, the Created Value MUST be added before it. Created Value MUST be appended to all Quantile Values, to the MetricPoint's Sum and MetricPoint's Count.
721
729
722
-
An example of a Metric with no labels and a MetricPoint with Sum, Count and Created values:
730
+
An example of a Metric with no labels and a MetricPoint with Sum, Count and Created Values:
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 exemplar is present, the Created Value MUST be added before it. Created Value MUST be appended to all Bucket Values, to the MetricPoint's Sum and MetricPoint's Count.
753
+
744
754
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".
745
755
746
756
Buckets MUST be sorted in number increasing order of "le", and the value of the "le" label MUST follow the rules for Canonical Numbers.
747
757
748
-
An example of a Metric with no labels and a MetricPoint with Sum, Count, and Created values, and with 12 buckets. A wide and atypical but valid variety of “le” values is shown on purpose:
758
+
An example of a Metric with no labels and a MetricPoint with Sum, Count, and Created Values, and with 12 buckets. A wide and atypical but valid variety of “le” values is shown on purpose:
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.
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.
1124
1132
1125
1133
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