prometheus/cmd
George Krajcsovits 17be8f1ddf tsdb: add histograms-st-encoding feature flag (#18912)
* tsdb: add histograms-st-encoding feature flag

Decouple the ST-capable histogram chunk encodings (EncHistogramST,
EncFloatHistogramST) from the xor2-encoding feature flag and gate them
behind a new histograms-st-encoding flag instead. Previously
--enable-feature=xor2-encoding turned on both the float XOR2 encoding
and the histogram ST encodings via a single useXOR2 boolean; that
conflated two independent on-disk formats and made it impossible to opt
into one without the other.

ValueType.ChunkEncoding and NewChunk now take separate useXOR2 and
useHistogramST flags. Dispatch only consumes the relevant flag per
value type; data-driven callers that gate on actual ST presence in the
samples (storage/series.go, tsdb/querier.go, tsdb/chunks/chunks.go)
pass hasST for both. tsdb.Options gains EnableHistogramSTEncoding;
tsdb.HeadOptions gains a matching atomic.Bool. The new flag is
propagated through chunkOpts/headAppenderBase and read at every site
that currently reads EnableXOR2Encoding (head append v1/v2, head_wal
WAL/WBL replay, ooo_head_read).

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>

* update features testdata

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>

---------

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2026-06-17 09:37:47 -07:00
..
prometheus tsdb: add histograms-st-encoding feature flag (#18912) 2026-06-17 09:37:47 -07:00
promtool Add histogram chunk encoding with Start Timestamp support 2026-06-17 09:06:49 -07:00