@@ -318,9 +318,7 @@ the exponential bucketing featured by the standard schemas is a bad match for
318
318
the distribution to be represented by the histogram. Histograms with different
319
319
custom bucket boundaries are generally not mergeable with each other.
320
320
Therefore, schema -53 SHOULD only be used as an informed decision in specific
321
- use cases. (TODO: NHCB aren't fully merged into main as of now (2024-11-03).
322
- They are worked into this document as far as possible already. This information
323
- might not yet be relevant for released Prometheus versions.)
321
+ use cases.
324
322
325
323
### Buckets
326
324
@@ -688,8 +686,11 @@ message BucketSpan {
688
686
// [...]
689
687
```
690
688
691
- (TODO: The above does not yet contain the custom values needed for NHCBs. Update
692
- once merged into main.)
689
+ (TODO: The above does not yet contain the custom values needed for NHCBs. We do
690
+ not need it right now because NHCB can be ingested via scraping classic
691
+ histograms. However, it might still be useful to have custom buckets in the
692
+ exposition format eventually, e.g. for federation, and for future schemas that
693
+ might also utilize the custom values.)
693
694
694
695
Note the following:
695
696
@@ -1117,8 +1118,9 @@ as just one series with their unmodified name. (Example: A histogram called
1117
1118
### Scraping classic histograms as NHCBs
1118
1119
1119
1120
The aforementioned NHCB is capable of modeling a classic histogram as a native
1120
- histogram. Prometheus can be configured to ingest classic histograms as NHCBs
1121
- rather than classic histograms. (TODO: Explain how to do that once it is merged.)
1121
+ histogram. Via the boolean scrape config option
1122
+ ` convert_classic_histograms_to_nhcb ` , Prometheus can be configured to ingest
1123
+ classic histograms as NHCBs.
1122
1124
1123
1125
NHCBs have the same issue with limited mergeability as classic histograms, but
1124
1126
they are generally much less expensive to store.
@@ -1607,11 +1609,6 @@ the latter, refer to the PromQL documentation about
1607
1609
and
1608
1610
[ functions] ( https://prometheus.io/docs/prometheus/latest/querying/functions/ ) .
1609
1611
1610
- TODO: The Prometheus PromQL implementation is currently lagging behind what's
1611
- described in this section. This is not called out separately further down for
1612
- all cases. See [ tracking
1613
- issue] ( https://github.com/prometheus/prometheus/issues/13934 ) for details.
1614
-
1615
1612
### Annotations
1616
1613
1617
1614
The introduction of native histograms creates certain situations where a PromQL
@@ -1861,19 +1858,28 @@ native histogram:
1861
1858
- ` idelta() ` (For gauge histograms.)
1862
1859
- ` irate() ` (For counter histograms.)
1863
1860
1864
- TODO: ` idelta ` and ` irate ` are not yet implemented for histograms.
1865
-
1866
1861
These functions SHOULD be applied to either gauge histograms or counter
1867
1862
histograms as noted above. However, they all work with both flavors, but if at
1868
1863
least one histogram of an unsuitable flavor is contained in the range vector, a
1869
1864
warn-level annotation is added to the result.
1870
1865
1871
- All these functions return no result for series that contain a mix of float
1872
- samples and histogram samples within the range. A warn-level annotation is
1873
- added for each output element missing for that reason.
1866
+ ` delta() ` , ` increase() ` , and ` rate() ` return no result for series that contain
1867
+ a mix of float samples and histogram samples within the range. ` idelta() ` and
1868
+ ` irate() ` return no result for series where the last two samples within the
1869
+ range are a mix of a float sample and a histogram sample. In either case, a
1870
+ warn-level annotation is added for each output element missing for these
1871
+ reasons.
1874
1872
1875
1873
All these functions return gauge histograms as results.
1876
1874
1875
+ As usual, these functions attempt to reconcile different schemas by converting
1876
+ the schema to a common one as far as possible. However, the functions applied
1877
+ to counters (` increase() ` , ` rate() ` , ` irate() ` ) do not perform this conversion
1878
+ for the 1st sample if there is a counter reset between the 1st and 2nd sample.
1879
+ In this case, the 1st sample is not included in the calculation, so an
1880
+ incompatible bucket layout between the 1st sample and the other samples is
1881
+ simply ignored silently.
1882
+
1877
1883
TODO: Preventing [ extrapolation below
1878
1884
zero] ( https://github.com/prometheus/prometheus/blob/034d2b24bcae90fce3ac337b4ddd399bd2ff4bc4/promql/functions.go#L153-L159 )
1879
1885
is currently not yet implemented (and might actually not make sense) for native
@@ -1896,7 +1902,6 @@ histogram to gauge histogram and vice versa does not count as a change for
1896
1902
histograms, but the function still works with gauge histograms, applying
1897
1903
explicit counter reset detection in this case. Furthermore, a change from
1898
1904
counter histogram to gauge histogram and vice versa is counted as a reset.
1899
- (TODO: Not implemented yet.)
1900
1905
1901
1906
The ` histogram_quantile() ` function has a very special role as it is the only
1902
1907
function that treats a specific “magic” label specially, namely the ` le ` label
@@ -1991,8 +1996,7 @@ definition of the schema of the histogram.
1991
1996
1992
1997
The following functions do not interact directly with sample values and
1993
1998
therefore work with native histogram samples in the same way as they work with
1994
- float samples: (TODO: Still need to verify that this is true for all of the
1995
- functions below. Need to update the documentation for some of them.)
1999
+ float samples:
1996
2000
1997
2001
- ` absent() `
1998
2002
- ` absent_over_time() `
@@ -2007,14 +2011,12 @@ functions below. Need to update the documentation for some of them.)
2007
2011
- ` timestamp() `
2008
2012
2009
2013
All remaining functions not mentioned in this section do _ not_ work with native
2010
- histograms. Histogram elements in the input vector are silently ignored. (TODO:
2011
- Make sure this is the case, rather than treating histogram samples as floats
2012
- with value 0.) For ` deriv() ` , ` double_exponential_smoothing() ` ,
2013
- ` predict_linear() ` , and all the ` <aggregation>_over_time() ` functions not
2014
- mentioned before, native histogram samples are removed from the input range
2015
- vector. In case any series contains a mix of float samples and histogram
2016
- samples within the range, the removal of histograms is flagged by an info-level
2017
- annotation.
2014
+ histograms. Histogram elements in the input vector are silently ignored. For
2015
+ ` deriv() ` , ` double_exponential_smoothing() ` , ` predict_linear() ` , and all the
2016
+ ` <aggregation>_over_time() ` functions not mentioned before, native histogram
2017
+ samples are removed from the input range vector. In case any series contains a
2018
+ mix of float samples and histogram samples within the range, the removal of
2019
+ histograms is flagged by an info-level annotation.
2018
2020
2019
2021
### Recording rules
2020
2022
0 commit comments