Skip to content

Commit e808703

Browse files
committed
Clarify what to do with buckets that have the value 0
Signed-off-by: György Krajcsovits <[email protected]>
1 parent 3f5f6dc commit e808703

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/specs/om/open_metrics_spec_2_0.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,8 @@ If present the MetricPoint's Created Timestamp MUST be inlined with the Metric p
879879

880880
Classic Buckets MUST be sorted in number increasing order of "le", and the value of the "le" label MUST follow the rules for Canonical Numbers.
881881

882+
All Classic Buckets MUST be present, even ones with the value 0.
883+
882884
An example of a Metric with no labels and a MetricPoint with Sum, Count, and Created Timestamp values, and with 12 Classic Buckets. A wide and atypical but valid variety of “le” values is shown on purpose:
883885

884886
```openmetrics-add-eof
@@ -916,6 +918,8 @@ With the exception of the `sum` and `zero_threshold` field, all numbers MUST be
916918

917919
Native Bucket values MUST be ordered by their index, and their values MUST be placed in the `negative_buckets` (and/or `positive_buckets`) fields.
918920

921+
Native Buckets that have a value of 0 SHOULD NOT be present.
922+
919923
To map the `negative_buckets` (and/or `positive_buckets`) 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_buckets` (and/or `positive_buckets`). 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.
920924

921925
An example of when to keep empty positive or negative Native Buckets is to reduce the number of spans needed to represent the case where the offset between two spans is just 1, meaning that with

0 commit comments

Comments
 (0)