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: content/docs/specs/om/open_metrics_spec_2_0.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,13 +68,13 @@ Metric values in OpenMetrics MUST be either numbers or complex data types.
68
68
69
69
Numbers MUST be either floating points or integers. Note that ingestors of the format MAY only support float64. The non-real values NaN, +Inf and -Inf MUST be supported. NaN MUST NOT be considered a missing value, but it MAY be used to signal a division by zero.
70
70
71
-
Complex data types MUST contain all information necessary to recreate a sample of a Metric Type, with the exception of Created time and Exemplars.
71
+
Complex data types MUST contain all information necessary to recreate a sample of a Metric Type, with the exception of Created Value and Exemplars.
72
72
73
73
List of complex data types:
74
74
- Integer counter native histograms for the Metric Type Histogram.
75
75
- Integer gauge native histograms for the Metric Type GaugeHistogram.
76
76
77
-
Complex data types MUST occure only in the corresponding MetricFamily. This means for example that a counter cannot have an integer counter native histogram value.
77
+
Complex data types MUST occur only in the corresponding MetricFamily. This means for example that a counter cannot have an integer counter native histogram value.
78
78
79
79
##### Booleans
80
80
@@ -230,17 +230,17 @@ Histograms measure distributions of discrete events. Common examples are the lat
230
230
231
231
A Histogram MetricPoint MUST contain Count, Sum values.
232
232
233
-
The Count value MUST equal the number of measurements taken by the Histogram. The Count is a counter semantically. The Count MUST be an integer and MUST NOT be NaN or negative.
233
+
The Count value MUST be equal to the number of measurements taken by the Histogram. The Count is a counter semantically. The Count MUST be an integer and MUST NOT be NaN or negative.
234
234
235
-
The Sum value MUST equal the Sum of all the measured event values. The Sum is only a counter semantically as long as there are no negative event values measured by the Histogram MetricPoint.
235
+
The Sum value MUST be equal to the Sum of all the measured event values. The Sum is only a counter semantically as long as there are no negative event values measured by the Histogram MetricPoint.
236
236
237
237
A Histogram MetricPoint MUST contain either [classic buckets](#classic-buckets) or [exponential buckets](#exponential-buckets) or both.
238
238
239
239
Every bucket MUST have well defined boundaries and a value. Boundaries of a bucket MUST NOT be NaN. Bucket values MUST be integers. Semantically, bucket values are counters so MUST NOT be NaN or negative.
240
240
241
-
A Histogram SHOULD refuse to measure NaN value as adding NaN to the Sum will make the Sum equal to NaN and mask the sum of the real measurements until the next reset of the counters. If a Histogram does allow NaN, it MUST be counted in the Count and MUST be added to the Sum, resulting in the Sum becoming NaN.
241
+
A Histogram SHOULD refuse to measure NaN value as adding NaN to the Sum will make the Sum equal to NaN and mask the sum of the real measurements until the next reset of the counters. If a Histogram does allow NaN, then NaN MUST be counted in the Count and MUST be added to the Sum, resulting in the Sum becoming NaN.
242
242
243
-
A Histogram MAY refuse to measure +Inf and -Inf values as adding these to the Sum will mask the sum of the real measurements until the next reset of the counters. If a Histogram measures +Inf or -Inf, they MUST be counted in the Count and MUST be added to the Sum, potentially resulting in +Inf, -Inf or NaN in the Sum, the later for example in case of adding +Inf to -Inf.
243
+
A Histogram MAY refuse to measure +Inf and -Inf values as adding these to the Sum will mask the sum of the real measurements until the next reset of the counters. If a Histogram measures +Inf or -Inf, then +Inf or -Inf MUST be counted in the Count and MUST be added to the Sum, potentially resulting in +Inf, -Inf or NaN in the Sum, the later for example in case of adding +Inf to -Inf.
244
244
245
245
A Histogram MetricPoint SHOULD have a Timestamp value called Created. This can help ingestors discern between new metrics and long-running ones it did not see before.
246
246
@@ -270,7 +270,7 @@ Histogram MetricPoints with exponential buckets MUST have a Schema value. The Sc
270
270
271
271
For any Standard Schema n, the Histogram MetricPoint MAY contain positive, negative exponential buckets and a single zero bucket. It is valid to have no exponentual buckets at all.
272
272
273
-
The boundaries of a positive or negative exponential bucket with index i MUST BE calculated as follows (using Python syntax):
273
+
The boundaries of a positive or negative exponential bucket with index i MUST be calculated as follows (using Python syntax):
274
274
275
275
The upper inclusive limit of a positive exponential bucket: `(2**2**-n)**i`
276
276
@@ -294,9 +294,9 @@ The next negative exponential bucket (index i+1 relative to the bucket from the
294
294
295
295
Exponential buckets beyond the +Inf and -Inf buckets described above MUST NOT be used.
296
296
297
-
If the zero bucket is present, the Historam MetricPoint MUST have a Zero threshold. The Zero threshold MUST BE a non-negative float64 value (threshold >= 0.0). The boundaries of the Zero native bucket are `[-threshold, threshold]` inclusive.
297
+
If the zero bucket is present, the Historam MetricPoint MUST have a Zero threshold. The Zero threshold MUST be a non-negative float64 value (threshold >= 0.0). The boundaries of the Zero native bucket are `[-threshold, threshold]` inclusive.
298
298
299
-
If the zero bucket is present, any measured value that falls into the zero bucket MUST BE counted towards the zero bucket and MUST NOT be counted in any other exponential bucket. The Zero threshold SHOULD be equal to a lower limit of an arbitraty exponential bucket.
299
+
If the zero bucket is present, any measured value that falls into the zero bucket MUST be counted towards the zero bucket and MUST NOT be counted in any other exponential bucket. The Zero threshold SHOULD be equal to a lower limit of an arbitraty exponential bucket.
300
300
301
301
If the NaN value is not allowed, then the Count value MUST be equal to the sum of the negative, positive and zero buckets.
302
302
@@ -890,23 +890,23 @@ foo_created 1520430000.123
890
890
891
891
##### Histogram with exponential buckets
892
892
893
-
The MetricPoint's value MUST BE a complex data type.
893
+
The MetricPoint's value MUST be a complex data type.
894
894
895
895
Histograms with exponential buckets use the integer native histogram data type.
896
896
897
-
The integer native histogram data type is a JSON like structure with fields. There MUST NOT BE any whitespace around fields.
897
+
The integer native histogram data type is a JSON like structure with fields. There MUST NOT be any whitespace around fields.
898
898
The integer native histogram data type MUST include the Count, Sum, Schema, Zero Threshold, Zero bucket value as the fields `count`, `sum`, `schema`, `zero_threshold`, `zero_count`.
899
899
900
-
If there are no negative exponential buckets, then the fields `negative_spans` and `negative_deltas` SHOULD BE omitted.
901
-
If there are no positive exponential buckets, then the fields `positive_spans` and `positive_deltas` SHOULD BE omitted.
900
+
If there are no negative exponential buckets, then the fields `negative_spans` and `negative_deltas` SHOULD be omitted.
901
+
If there are no positive exponential buckets, then the fields `positive_spans` and `positive_deltas` SHOULD be omitted.
902
902
903
-
If there are negative (and/or positive) exponential buckets then the fields `negative_spans`, `negative_deltas` (and/or `positive_spans`, `positive_deltas`) MUST BE present in this order after the `zero_count` field.
903
+
If there are negative (and/or positive) exponential buckets then the fields `negative_spans`, `negative_deltas` (and/or `positive_spans`, `positive_deltas`) MUST be present in this order after the `zero_count` field.
904
904
905
-
Exponential bucket values MUST BE ordered by their index, and their values MUST BE placed in the `negative_deltas` (and/or `positive_deltas`) field using delta encoding, that is the first bucket value is written as is and the following values only as a delta relative to the previous value. For example bucket values 1, 5, 4, 4 will become 1, 4, -1, 0.
905
+
Exponential bucket values MUST be ordered by their index, and their values MUST be placed in the `negative_deltas` (and/or `positive_deltas`) field using delta encoding, that is the first bucket value is written as is and the following values only as a delta relative to the previous value. For example bucket values 1, 5, 4, 4 will become 1, 4, -1, 0.
906
906
907
-
To map the `negative_deltas` (and/or `positive_deltas`) back to their indices, the `negative_spans` (and/or `positive_spans`) field MUST BE constructed in the following way: each span consists of a pair of numbers, an integer called offset and an non-negative integer called length. Only the first span in each list can have a negative offset. It defines the index of the first bucket in its corresponding `negative_deltas` (and/or `positive_deltas`). The length defines the number of consecutive buckets the bucket list starts with. The offsets of the following spans define the number of excluded (and thus unpopulated buckets). The lengths define the number of consecutive buckets in the list following the excluded buckets.
907
+
To map the `negative_deltas` (and/or `positive_deltas`) back to their indices, the `negative_spans` (and/or `positive_spans`) field MUST be constructed in the following way: each span consists of a pair of numbers, an integer called offset and an non-negative integer called length. Only the first span in each list can have a negative offset. It defines the index of the first bucket in its corresponding `negative_deltas` (and/or `positive_deltas`). The length defines the number of consecutive buckets the bucket list starts with. The offsets of the following spans define the number of excluded (and thus unpopulated buckets). The lengths define the number of consecutive buckets in the list following the excluded buckets.
908
908
909
-
The sum of all length values in each span list MUST BE equal to the length of the corresponding bucket list.
909
+
The sum of all length values in each span list MUST be equal to the length of the corresponding bucket list.
##### Histogram with both classic and exponential buckets
928
928
929
-
If a Histogram MetricPoint has both classic and exponential buckets, the exponential buckets MUST come first and the created time MUST NOT BE duplicated.
929
+
If a Histogram MetricPoint has both classic and exponential buckets, the exponential buckets MUST come first and the created time MUST NOT be duplicated.
930
930
931
931
The order ensures that implementations can easily skip the classic buckets if the exponential buckets are preferred.
##### GaugeHistogram with both classic and exponential buckets
996
996
997
-
If a GaugeHistogram MetricPoint has both classic and exponential buckets, the exponential buckets MUST come first and the created time MUST NOT BE duplicated.
997
+
If a GaugeHistogram MetricPoint has both classic and exponential buckets, the exponential buckets MUST come first and the created time MUST NOT be duplicated.
0 commit comments