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
* fix(om2.0): fixes in type text format
The one major fix is that a gauge histogram doesn't have start time.
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
* fix(om2): make gauge histogram distinguishable from one line (#2904)
Change count and sum to `gcount` and `gsum` in the exposition for gauge
histograms. This mirrors OM 1.0 suffixes.
There's too many complications if we don't do this.
The only downside is that the histogram functions in PromQL don't have a
gauge version, but I think we can live with that. Or even add those
later if anyone needs them - which I doubt.
Also fix that gauge histograms model currently doesn't have start
timestamp, but our text format seemed to conflict with this.
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
* Apply suggestions from code review
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: George Krajcsovits <krajorama@users.noreply.github.com>
* make fmt
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
---------
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: George Krajcsovits <krajorama@users.noreply.github.com>
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
@@ -717,7 +722,7 @@ Label values MAY be any valid UTF-8 value, so escaping MUST be applied as per th
717
722
bar_seconds_count{a="x",b="escaping\" example \n "} 0
718
723
```
719
724
720
-
Metric names and label names MAY also be any valid UTF-8 value, and under certain circumstances they MUST be quoted and escaped per the ABNF. See the UTF-8 Quoting section for specifics.
725
+
Metric names and label names MAY also be any valid UTF-8 value, and under certain circumstances they MUST be quoted and escaped per the ABNF. See the [UTF-8 Quoting](#utf-8-quoting) section for specifics.
721
726
722
727
```openmetrics-add-eof
723
728
{"\"bar\".seconds.count","b\\"="escaping\" example \n "} 0
@@ -727,6 +732,8 @@ Metric names and label names MAY also be any valid UTF-8 value, and under certai
727
732
728
733
#### Gauge
729
734
735
+
The Sample's value MUST be a Number.
736
+
730
737
There are no recommended suffixes for the MetricFamily name for a MetricFamily of Type Gauge.
731
738
732
739
An example MetricFamily with a Metric with no labels and a Sample with no timestamp:
@@ -774,6 +781,8 @@ foo 18.0 456
774
781
775
782
#### Counter
776
783
784
+
The Sample's value MUST be a Number.
785
+
777
786
If present, the Sample's Start Timestamp MUST be inlined with the Sample with a `st@` prefix. If the value's timestamp is present, the Start Timestamp MUST be added right after it. If exemplar is present, the Start Timestamp MUST be added before it.
778
787
779
788
An example with a Metric with no labels, and a Sample with no timestamp and no Start Timestamp:
@@ -804,7 +813,7 @@ An example with a Metric with no labels, and a Sample with a timestamp and a Sta
804
813
foo_total 17.0 1520879607.789 st@1520430000.123
805
814
```
806
815
807
-
An example with a Metric with no labels, and a Sample without the `_total` suffix and with a timestamp and a start timestamp:
816
+
An example with a Metric with no labels, and without the `_total` suffix and a Sample with a Timestamp and a Start Timestamp:
808
817
809
818
```openmetrics-add-eof
810
819
# TYPE foo counter
@@ -929,14 +938,14 @@ If present the Sample's Start Timestamp MUST be inlined with the Sample with a `
929
938
930
939
The quantiles MUST be sorted in increasing order of the quantile.
931
940
932
-
An example of a Metric with no labels and a Sample with Sum, Count and Start Timestamp values:
941
+
An example of a Metric with no labels and a Sample with Sum, Count and Start Timestamp:
An example of a Metric with no labels and a Sample with two quantiles and Start Timestamp values:
948
+
An example of a Metric with no labels and a Sample with two quantiles and Start Timestamp:
940
949
941
950
```openmetrics-add-eof
942
951
# TYPE foo summary
@@ -974,6 +983,8 @@ If there are negative (and/or positive) Native Buckets, then the fields `negativ
974
983
975
984
Native Bucket values MUST be ordered by their index, and their values MUST be placed in the `negative_buckets` (and/or `positive_buckets`) fields.
976
985
986
+
> NOTE: Bucket values are absolute counts, as opposed to some implementations that store bucket values as deltas relative to the preceding bucket.
987
+
977
988
Native Buckets that have a value of 0 SHOULD NOT be present.
978
989
979
990
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.
The CompositeValue MUST include the Gcount, Gsum and Classic Bucket values as the fields `count`, `sum`, `bucket`, in this order.
1054
-
1055
-
Classic Buckets MUST be sorted in number increasing order of their threshold.
1062
+
GaugeHistogram Samples with Classic Buckets follow the same syntax as Histogram Samples with Classic Buckets, except that the Count and Sum are exposed as the fields `gcount` and `gsum` and GaugeHistograms do not have Start Timestamp.
1056
1063
1057
-
An example of a Metric with no labels, and one Sample value with no Exemplar with no Exemplars in the buckets:
1064
+
An example of a Metric with no labels, and one Sample value with no Timestamp, and no Exemplars:
GaugeHistogram Samples with Native Buckets follow the same syntax as Histogram Samples with Native Buckets.
1073
+
GaugeHistogram Samples with Native Buckets follow the same syntax as Histogram Samples with Native Buckets, except that the Count and Sum are exposed as the fields `gcount` and `gsum` and GaugeHistograms do not have Start Timestamp.
1074
+
1075
+
An example of a Metric with no labels, and one Sample value with no Timestamp, and no Exemplars:
#### GaugeHistogram with both Classic and Native buckets
1074
1083
1075
-
GaugeHistogram Samples with both Classic and Native Buckets follow the same syntax as Histogram Samples with both Classic and Native Buckets.
1084
+
GaugeHistogram Samples with both Classic and Native Buckets follow the same syntax as Histogram Samples with both Classic and Native Buckets, except that the Count and Sum are exposed as the fields `gcount` and `gsum` and GaugeHistograms do not have Start Timestamp.
1076
1085
1077
1086
#### Unknown
1078
1087
1088
+
The Sample's value MUST be a Number or a CompositeValue.
1089
+
1079
1090
There are no recommended suffixes for the MetricFamily name for a MetricFamily of Type Unknown.
1080
1091
1081
-
An example with a Metric with no labels and a Sample with no timestamp:
1092
+
An example with a Metric with no labels and a Sample with no Timestamp:
1082
1093
1083
1094
```openmetrics-add-eof
1084
1095
# TYPE foo unknown
1085
1096
foo 42.23
1086
1097
```
1087
1098
1099
+
An example with a Metric without MetricFamily metadata and a Sample with no Timestamp:
0 commit comments