Skip to content

tsdb: optimize head chunk access paths - #18300

Merged
aknuds1 merged 10 commits into
prometheus:mainfrom
aknuds1:arve/optimize-head-chunks
Jul 15, 2026
Merged

aknuds1 merged 10 commits into
prometheus:mainfrom
aknuds1:arve/optimize-head-chunks

Conversation

@aknuds1

@aknuds1 aknuds1 commented Mar 14, 2026 •

Copy link
Copy Markdown
Contributor

Which issue(s) does the PR fix:

Follow-up to #18302.

The TSDB head stores in-memory chunks as a newest-first linked list, while chunk IDs address chunks in oldest-first logical order after any m-mapped chunks. Several hot paths repeatedly walked that linked list to resolve chunk offsets or count chunks, turning series with many head chunks into O(n²) work. I found this while profiling Grafana Mimir ingesters in the cloud after spotting containers with extreme CPU utilization.

Changes

This PR optimizes head chunk access paths by collecting head chunks once in oldest-first order for paths that need to iterate or index all of them, instead of repeatedly walking the linked list. It applies that shape to mmap, series chunk metadata construction, iterator isolation accounting, and chunk lookup paths.

It also uses the tracked headChunkCount for O(1) count reads where callers only need the list length, and adds small helper methods so headChunks and headChunkCount stay synchronized when chunks are pushed, truncated, loaded, reset, or m-mapped.

For direct memSeries.chunk() lookups, the PR keeps the existing mmapped-chunk lookup behavior, adds a fast path for pre-collected head chunks, and uses the tracked count for the linked-list fallback. The common single-head-chunk case avoids the extra collection/cache path.

Compaction now enables the same head-chunk cache used by range-query chunk readers, so compaction from Head can resolve sequential chunk accesses without re-walking the list for each chunk.

The PR adds focused tests for chunk lookup, head chunk count/list synchronization, truncation behavior, cache invalidation, mmap-ready state, and compaction from Head with multiple head chunks. It also adds benchmarks covering chunk lookup, head chunk collection, metadata construction, truncation, mmap, and compaction scenarios.

Benchmarks

benchstat results
goos: linux
goarch: amd64
pkg: github.com/prometheus/prometheus/tsdb
cpu: Intel(R) Xeon(R) Platinum 8280 CPU @ 2.70GHz
                                                      │   main.txt    │         optimizations.txt          │
                                                      │    sec/op     │   sec/op     vs base               │
MmapHeadChunks/series=1000/ready=10-16                   402.8µ ±  2%   396.8µ ± 0%        ~ (p=0.065 n=6)
MmapHeadChunks/series=1000/ready=100-16                  481.1µ ±  2%   476.9µ ± 2%        ~ (p=0.394 n=6)
MmapHeadChunks/series=1000/ready=1000-16                 1.154m ±  2%   1.170m ± 3%        ~ (p=0.394 n=6)
MmapHeadChunks/series=10000/ready=100-16                 937.0µ ±  3%   883.2µ ± 2%   -5.74% (p=0.002 n=6)
MmapHeadChunks/series=10000/ready=1000-16                1.983m ±  2%   1.940m ± 5%        ~ (p=0.310 n=6)
MmapHeadChunks/series=10000/ready=10000-16               11.37m ±  1%   11.52m ± 2%   +1.27% (p=0.002 n=6)
MmapHeadChunks/series=100000/ready=1000-16               6.737m ±  9%   6.730m ± 8%        ~ (p=0.699 n=6)
MmapHeadChunks/series=100000/ready=10000-16              18.08m ±  1%   18.20m ± 4%        ~ (p=0.485 n=6)
MmapHeadChunks/series=100000/ready=100000-16             114.8m ±  2%   115.7m ± 4%        ~ (p=0.937 n=6)
SeriesChunkIteration/1-16                                4.825n ±  4%   4.274n ± 1%  -11.41% (p=0.002 n=6)
SeriesChunkIteration/4-16                                16.82n ±  2%   15.31n ± 1%   -8.95% (p=0.002 n=6)
SeriesChunkIteration/16-16                               64.45n ±  1%   59.29n ± 2%   -8.00% (p=0.002 n=6)
SeriesChunkIteration/64-16                               263.0n ±  5%   244.6n ± 1%   -7.00% (p=0.002 n=6)
SeriesChunkIteration/256-16                             1025.0n ±  1%   953.7n ± 1%   -6.96% (p=0.002 n=6)
AppendSeriesChunks/headOnly/1-16                         11.34n ±  1%   11.46n ± 1%   +1.15% (p=0.039 n=6)
AppendSeriesChunks/withMmapped/1-16                      19.54n ±  1%   19.47n ± 2%        ~ (p=0.485 n=6)
AppendSeriesChunks/headOnly/4-16                         152.5n ±  1%   151.8n ± 2%        ~ (p=0.732 n=6)
AppendSeriesChunks/withMmapped/4-16                      185.6n ±  0%   186.3n ± 1%        ~ (p=0.472 n=6)
AppendSeriesChunks/headOnly/16-16                        423.7n ±  2%   425.5n ± 1%        ~ (p=0.589 n=6)
AppendSeriesChunks/withMmapped/16-16                     568.2n ±  1%   562.0n ± 1%        ~ (p=0.093 n=6)
AppendSeriesChunks/headOnly/64-16                        1.353µ ±  2%   1.367µ ± 1%        ~ (p=0.180 n=6)
AppendSeriesChunks/withMmapped/64-16                     1.931µ ±  1%   1.942µ ± 1%        ~ (p=0.310 n=6)
AppendSeriesChunks/headOnly/256-16                       5.485µ ±  1%   5.513µ ± 3%        ~ (p=0.132 n=6)
AppendSeriesChunks/withMmapped/256-16                    8.062µ ±  1%   8.061µ ± 1%        ~ (p=1.000 n=6)
CollectHeadChunks/1-16                                   113.1n ±  2%   116.5n ± 2%   +2.96% (p=0.004 n=6)
CollectHeadChunks/4-16                                   119.7n ±  1%   124.0n ± 3%   +3.59% (p=0.002 n=6)
CollectHeadChunks/16-16                                  135.1n ±  1%   139.1n ± 1%   +2.96% (p=0.002 n=6)
CollectHeadChunks/64-16                                  630.9n ±  2%   646.7n ± 1%   +2.50% (p=0.009 n=6)
CollectHeadChunks/256-16                                 2.866µ ± 15%   2.885µ ± 3%        ~ (p=0.368 n=6)
SeriesChunk/1-16                                         4.852n ±  2%   3.959n ± 1%  -18.39% (p=0.002 n=6)
SeriesChunk/4-16                                         9.850n ±  1%   5.960n ± 2%  -39.49% (p=0.002 n=6)
SeriesChunk/16-16                                        18.25n ±  1%   11.04n ± 2%  -39.50% (p=0.002 n=6)
SeriesChunk/64-16                                        94.13n ±  2%   48.79n ± 2%  -48.17% (p=0.002 n=6)
SeriesChunk/256-16                                       574.0n ±  2%   272.6n ± 1%  -52.51% (p=0.002 n=6)
ChunkLookup/1-16                                         4.839n ±  4%   3.968n ± 2%  -18.00% (p=0.002 n=6)
ChunkLookup/4-16                                         7.924n ±  0%   4.876n ± 1%  -38.48% (p=0.002 n=6)
ChunkLookup/16-16                                       15.245n ±  1%   6.569n ± 7%  -56.91% (p=0.002 n=6)
ChunkLookup/64-16                                        81.95n ±  2%   24.45n ± 2%  -70.16% (p=0.002 n=6)
ChunkLookup/256-16                                       430.1n ±  2%   128.7n ± 2%  -70.07% (p=0.002 n=6)
TruncateChunksBefore/1-16                                55.68n ±  1%   55.90n ± 1%        ~ (p=0.331 n=6)
TruncateChunksBefore/4-16                                201.3n ±  1%   202.7n ± 2%        ~ (p=0.071 n=6)
TruncateChunksBefore/16-16                               751.9n ±  1%   740.6n ± 1%   -1.49% (p=0.009 n=6)
TruncateChunksBefore/64-16                               2.913µ ±  1%   2.913µ ± 1%        ~ (p=0.853 n=6)
TruncateChunksBefore/256-16                              11.67µ ±  2%   11.63µ ± 1%        ~ (p=0.310 n=6)
geomean                                                  4.782µ         4.151µ       -13.21%

                                                      │    main.txt     │          optimizations.txt           │
                                                      │      B/op       │     B/op      vs base                │
CompactionFromHead/labelnames=1,labelvalues=100000-16   105.0Mi ±  0%     105.1Mi ± 0%  +0.13% (p=0.041 n=6)
CompactionFromHead/labelnames=10,labelvalues=10000-16   108.7Mi ±  0%     108.8Mi ± 0%       ~ (p=0.132 n=6)
CompactionFromHead/labelnames=100,labelvalues=1000-16   112.0Mi ±  0%     111.8Mi ± 0%       ~ (p=0.240 n=6)
CompactionFromHead/labelnames=1000,labelvalues=100-16   105.9Mi ±  0%     105.8Mi ± 0%       ~ (p=0.589 n=6)
CompactionFromHead/labelnames=10000,labelvalues=10-16   111.0Mi ±  1%     110.9Mi ± 0%       ~ (p=0.589 n=6)
MmapHeadChunks/series=1000/ready=10-16                  2.717Ki ±  3%     2.681Ki ± 4%       ~ (p=0.394 n=6)
MmapHeadChunks/series=1000/ready=100-16                 16.42Ki ±  3%     16.66Ki ± 3%       ~ (p=0.699 n=6)
MmapHeadChunks/series=1000/ready=1000-16                145.5Ki ±  1%     145.3Ki ± 6%       ~ (p=0.818 n=6)
MmapHeadChunks/series=10000/ready=100-16                17.74Ki ±  4%     16.76Ki ± 3%  -5.50% (p=0.009 n=6)
MmapHeadChunks/series=10000/ready=1000-16               150.9Ki ±  8%     139.2Ki ± 8%  -7.73% (p=0.026 n=6)
MmapHeadChunks/series=10000/ready=10000-16              1.345Mi ±  0%     1.345Mi ± 2%       ~ (p=0.450 n=6)
MmapHeadChunks/series=100000/ready=1000-16              165.4Ki ±  3%     164.4Ki ± 3%       ~ (p=0.981 n=6)
MmapHeadChunks/series=100000/ready=10000-16             1.474Mi ± 10%     1.473Mi ± 2%       ~ (p=0.900 n=6)
MmapHeadChunks/series=100000/ready=100000-16            13.64Mi ±  3%     13.64Mi ± 3%       ~ (p=1.000 n=6)
SeriesChunkIteration/1-16                                 0.000 ±  0%       0.000 ± 0%       ~ (p=1.000 n=6) ¹
SeriesChunkIteration/4-16                                 0.000 ±  0%       0.000 ± 0%       ~ (p=1.000 n=6) ¹
SeriesChunkIteration/16-16                                0.000 ±  0%       0.000 ± 0%       ~ (p=1.000 n=6) ¹
SeriesChunkIteration/64-16                                0.000 ±  0%       0.000 ± 0%       ~ (p=1.000 n=6) ¹
SeriesChunkIteration/256-16                               0.000 ±  0%       0.000 ± 0%       ~ (p=1.000 n=6) ¹
AppendSeriesChunks/headOnly/1-16                          0.000 ±  0%       0.000 ± 0%       ~ (p=1.000 n=6) ¹
AppendSeriesChunks/withMmapped/1-16                       0.000 ±  0%       0.000 ± 0%       ~ (p=1.000 n=6) ¹
AppendSeriesChunks/headOnly/4-16                          56.00 ±  0%       56.00 ± 0%       ~ (p=1.000 n=6) ¹
AppendSeriesChunks/withMmapped/4-16                       56.00 ±  0%       56.00 ± 0%       ~ (p=1.000 n=6) ¹
AppendSeriesChunks/headOnly/16-16                         248.0 ±  0%       248.0 ± 0%       ~ (p=1.000 n=6) ¹
AppendSeriesChunks/withMmapped/16-16                      248.0 ±  0%       248.0 ± 0%       ~ (p=1.000 n=6) ¹
AppendSeriesChunks/headOnly/64-16                        1016.0 ±  0%      1016.0 ± 0%       ~ (p=1.000 n=6) ¹
AppendSeriesChunks/withMmapped/64-16                     1016.0 ±  0%      1016.0 ± 0%       ~ (p=1.000 n=6) ¹
AppendSeriesChunks/headOnly/256-16                      4.367Ki ±  0%     4.367Ki ± 0%       ~ (p=1.000 n=6) ¹
AppendSeriesChunks/withMmapped/256-16                   4.367Ki ±  0%     4.367Ki ± 0%       ~ (p=1.000 n=6) ¹
CollectHeadChunks/1-16                                    152.0 ±  0%       152.0 ± 0%       ~ (p=1.000 n=6) ¹
CollectHeadChunks/4-16                                    152.0 ±  0%       152.0 ± 0%       ~ (p=1.000 n=6) ¹
CollectHeadChunks/16-16                                   152.0 ±  0%       152.0 ± 0%       ~ (p=1.000 n=6) ¹
CollectHeadChunks/64-16                                   920.0 ±  0%       920.0 ± 0%       ~ (p=1.000 n=6) ¹
CollectHeadChunks/256-16                                4.273Ki ±  0%     4.273Ki ± 0%       ~ (p=1.000 n=6) ¹
SeriesChunk/1-16                                          0.000 ±  0%       0.000 ± 0%       ~ (p=1.000 n=6) ¹
SeriesChunk/4-16                                          0.000 ±  0%       0.000 ± 0%       ~ (p=1.000 n=6) ¹
SeriesChunk/16-16                                         0.000 ±  0%       0.000 ± 0%       ~ (p=1.000 n=6) ¹
SeriesChunk/64-16                                         0.000 ±  0%       0.000 ± 0%       ~ (p=1.000 n=6) ¹
SeriesChunk/256-16                                        0.000 ±  0%       0.000 ± 0%       ~ (p=1.000 n=6) ¹
ChunkLookup/1-16                                          0.000 ±  0%       0.000 ± 0%       ~ (p=1.000 n=6) ¹
ChunkLookup/4-16                                          0.000 ±  0%       0.000 ± 0%       ~ (p=1.000 n=6) ¹
ChunkLookup/16-16                                         0.000 ±  0%       0.000 ± 0%       ~ (p=1.000 n=6) ¹
ChunkLookup/64-16                                         0.000 ±  0%       0.000 ± 0%       ~ (p=1.000 n=6) ¹
ChunkLookup/256-16                                        0.000 ±  0%       0.000 ± 0%       ~ (p=1.000 n=6) ¹
TruncateChunksBefore/1-16                                 48.00 ±  0%       48.00 ± 0%       ~ (p=1.000 n=6) ¹
TruncateChunksBefore/4-16                                 192.0 ±  0%       192.0 ± 0%       ~ (p=1.000 n=6) ¹
TruncateChunksBefore/16-16                                768.0 ±  0%       768.0 ± 0%       ~ (p=1.000 n=6) ¹
TruncateChunksBefore/64-16                              3.000Ki ±  0%     3.000Ki ± 0%       ~ (p=1.000 n=6) ¹
TruncateChunksBefore/256-16                             12.00Ki ±  0%     12.00Ki ± 0%       ~ (p=1.000 n=6) ¹
geomean                                                               ²                 -0.30%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                                      │   main.txt    │          optimizations.txt          │
                                                      │   allocs/op   │  allocs/op   vs base                │
CompactionFromHead/labelnames=1,labelvalues=100000-16   918.1k ± 0%     918.2k ± 0%       ~ (p=0.065 n=6)
CompactionFromHead/labelnames=10,labelvalues=10000-16   983.6k ± 0%     983.6k ± 0%       ~ (p=0.390 n=6)
CompactionFromHead/labelnames=100,labelvalues=1000-16   999.4k ± 0%     999.4k ± 0%       ~ (p=0.799 n=6)
CompactionFromHead/labelnames=1000,labelvalues=100-16   1.010M ± 0%     1.010M ± 0%       ~ (p=0.623 n=6)
CompactionFromHead/labelnames=10000,labelvalues=10-16   1.059M ± 0%     1.059M ± 0%       ~ (p=0.509 n=6)
MmapHeadChunks/series=1000/ready=10-16                   11.00 ± 0%      11.00 ± 0%       ~ (p=1.000 n=6) ¹
MmapHeadChunks/series=1000/ready=100-16                  105.5 ± 0%      105.0 ± 1%       ~ (p=1.000 n=6)
MmapHeadChunks/series=1000/ready=1000-16                1.037k ± 0%     1.037k ± 0%       ~ (p=1.000 n=6)
MmapHeadChunks/series=10000/ready=100-16                 107.0 ± 0%      107.0 ± 0%       ~ (p=1.000 n=6) ¹
MmapHeadChunks/series=10000/ready=1000-16               1.046k ± 0%     1.046k ± 0%       ~ (p=0.545 n=6)
MmapHeadChunks/series=10000/ready=10000-16              11.05k ± 0%     11.05k ± 0%       ~ (p=1.000 n=6)
MmapHeadChunks/series=100000/ready=1000-16              1.087k ± 0%     1.087k ± 0%       ~ (p=0.602 n=6)
MmapHeadChunks/series=100000/ready=10000-16             11.43k ± 1%     11.40k ± 1%       ~ (p=0.779 n=6)
MmapHeadChunks/series=100000/ready=100000-16            151.3k ± 6%     151.3k ± 6%       ~ (p=1.000 n=6)
SeriesChunkIteration/1-16                                0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=6) ¹
SeriesChunkIteration/4-16                                0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=6) ¹
SeriesChunkIteration/16-16                               0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=6) ¹
SeriesChunkIteration/64-16                               0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=6) ¹
SeriesChunkIteration/256-16                              0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=6) ¹
AppendSeriesChunks/headOnly/1-16                         0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=6) ¹
AppendSeriesChunks/withMmapped/1-16                      0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=6) ¹
AppendSeriesChunks/headOnly/4-16                         3.000 ± 0%      3.000 ± 0%       ~ (p=1.000 n=6) ¹
AppendSeriesChunks/withMmapped/4-16                      3.000 ± 0%      3.000 ± 0%       ~ (p=1.000 n=6) ¹
AppendSeriesChunks/headOnly/16-16                        5.000 ± 0%      5.000 ± 0%       ~ (p=1.000 n=6) ¹
AppendSeriesChunks/withMmapped/16-16                     5.000 ± 0%      5.000 ± 0%       ~ (p=1.000 n=6) ¹
AppendSeriesChunks/headOnly/64-16                        7.000 ± 0%      7.000 ± 0%       ~ (p=1.000 n=6) ¹
AppendSeriesChunks/withMmapped/64-16                     7.000 ± 0%      7.000 ± 0%       ~ (p=1.000 n=6) ¹
AppendSeriesChunks/headOnly/256-16                       9.000 ± 0%      9.000 ± 0%       ~ (p=1.000 n=6) ¹
AppendSeriesChunks/withMmapped/256-16                    9.000 ± 0%      9.000 ± 0%       ~ (p=1.000 n=6) ¹
CollectHeadChunks/1-16                                   2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=6) ¹
CollectHeadChunks/4-16                                   2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=6) ¹
CollectHeadChunks/16-16                                  2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=6) ¹
CollectHeadChunks/64-16                                  4.000 ± 0%      4.000 ± 0%       ~ (p=1.000 n=6) ¹
CollectHeadChunks/256-16                                 6.000 ± 0%      6.000 ± 0%       ~ (p=1.000 n=6) ¹
SeriesChunk/1-16                                         0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=6) ¹
SeriesChunk/4-16                                         0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=6) ¹
SeriesChunk/16-16                                        0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=6) ¹
SeriesChunk/64-16                                        0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=6) ¹
SeriesChunk/256-16                                       0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=6) ¹
ChunkLookup/1-16                                         0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=6) ¹
ChunkLookup/4-16                                         0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=6) ¹
ChunkLookup/16-16                                        0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=6) ¹
ChunkLookup/64-16                                        0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=6) ¹
ChunkLookup/256-16                                       0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=6) ¹
TruncateChunksBefore/1-16                                1.000 ± 0%      1.000 ± 0%       ~ (p=1.000 n=6) ¹
TruncateChunksBefore/4-16                                4.000 ± 0%      4.000 ± 0%       ~ (p=1.000 n=6) ¹
TruncateChunksBefore/16-16                               16.00 ± 0%      16.00 ± 0%       ~ (p=1.000 n=6) ¹
TruncateChunksBefore/64-16                               64.00 ± 0%      64.00 ± 0%       ~ (p=1.000 n=6) ¹
TruncateChunksBefore/256-16                              256.0 ± 0%      256.0 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                                             ²                -0.01%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean
benchstat results: compaction
goos: linux
goarch: amd64
pkg: github.com/prometheus/prometheus/tsdb
cpu: Intel(R) Xeon(R) Platinum 8280 CPU @ 2.70GHz
                                                               │ main-compaction.txt │    optimizations-compaction.txt    │
                                                               │       sec/op        │   sec/op     vs base               │
CompactionFromHead/labelnames=1,labelvalues=100000-16                    658.0m ± 1%   668.6m ± 1%   +1.60% (p=0.009 n=6)
CompactionFromHead/labelnames=10,labelvalues=10000-16                    663.5m ± 1%   681.1m ± 2%   +2.66% (p=0.002 n=6)
CompactionFromHead/labelnames=100,labelvalues=1000-16                    667.2m ± 1%   675.6m ± 1%   +1.27% (p=0.009 n=6)
CompactionFromHead/labelnames=1000,labelvalues=100-16                    658.9m ± 0%   669.1m ± 1%   +1.55% (p=0.002 n=6)
CompactionFromHead/labelnames=10000,labelvalues=10-16                    693.8m ± 3%   702.1m ± 1%        ~ (p=0.132 n=6)
CompactionFromHead/many_head_chunks/series=100000,chunks=1-16            852.6m ± 1%   851.9m ± 2%        ~ (p=0.818 n=6)
CompactionFromHead/many_head_chunks/series=100000,chunks=10-16            1.371 ± 2%    1.389 ± 3%        ~ (p=0.180 n=6)
CompactionFromHead/many_head_chunks/series=10,chunks=100-16              230.3m ± 2%   231.2m ± 3%        ~ (p=0.394 n=6)
CompactionFromHead/many_head_chunks/series=10,chunks=1000-16             271.7m ± 1%   238.1m ± 2%  -12.37% (p=0.002 n=6)
geomean                                                                  597.8m        595.5m        -0.38%

                                                               │ main-compaction.txt │    optimizations-compaction.txt    │
                                                               │        B/op         │     B/op      vs base              │
CompactionFromHead/labelnames=1,labelvalues=100000-16                   105.1Mi ± 0%   105.1Mi ± 0%       ~ (p=0.937 n=6)
CompactionFromHead/labelnames=10,labelvalues=10000-16                   108.7Mi ± 0%   108.8Mi ± 0%       ~ (p=0.589 n=6)
CompactionFromHead/labelnames=100,labelvalues=1000-16                   111.9Mi ± 1%   111.8Mi ± 0%       ~ (p=0.310 n=6)
CompactionFromHead/labelnames=1000,labelvalues=100-16                   106.0Mi ± 0%   105.9Mi ± 0%       ~ (p=0.818 n=6)
CompactionFromHead/labelnames=10000,labelvalues=10-16                   111.1Mi ± 1%   111.0Mi ± 1%       ~ (p=0.699 n=6)
CompactionFromHead/many_head_chunks/series=100000,chunks=1-16           163.3Mi ± 0%   163.3Mi ± 0%       ~ (p=0.937 n=6)
CompactionFromHead/many_head_chunks/series=100000,chunks=10-16          239.0Mi ± 0%   239.0Mi ± 0%       ~ (p=0.177 n=6)
CompactionFromHead/many_head_chunks/series=10,chunks=100-16             32.59Mi ± 0%   32.61Mi ± 0%  +0.06% (p=0.002 n=6)
CompactionFromHead/many_head_chunks/series=10,chunks=1000-16            33.67Mi ± 0%   33.85Mi ± 0%  +0.54% (p=0.002 n=6)
geomean                                                                 95.25Mi        95.28Mi       +0.04%

                                                               │ main-compaction.txt │   optimizations-compaction.txt    │
                                                               │      allocs/op      │  allocs/op   vs base              │
CompactionFromHead/labelnames=1,labelvalues=100000-16                    918.2k ± 0%   918.2k ± 0%       ~ (p=0.937 n=6)
CompactionFromHead/labelnames=10,labelvalues=10000-16                    983.6k ± 0%   983.6k ± 0%       ~ (p=0.485 n=6)
CompactionFromHead/labelnames=100,labelvalues=1000-16                    999.3k ± 0%   999.3k ± 0%       ~ (p=0.608 n=6)
CompactionFromHead/labelnames=1000,labelvalues=100-16                    1.010M ± 0%   1.010M ± 0%       ~ (p=0.619 n=6)
CompactionFromHead/labelnames=10000,labelvalues=10-16                    1.059M ± 0%   1.059M ± 0%       ~ (p=0.589 n=6)
CompactionFromHead/many_head_chunks/series=100000,chunks=1-16            2.102M ± 0%   2.102M ± 0%       ~ (p=0.734 n=6)
CompactionFromHead/many_head_chunks/series=100000,chunks=10-16           3.002M ± 0%   3.002M ± 0%  +0.00% (p=0.015 n=6)
CompactionFromHead/many_head_chunks/series=10,chunks=100-16              1.864k ± 0%   1.902k ± 0%  +2.04% (p=0.002 n=6)
CompactionFromHead/many_head_chunks/series=10,chunks=1000-16             10.97k ± 0%   11.04k ± 0%  +0.63% (p=0.002 n=6)
geomean                                                                  368.3k        369.3k       +0.29%

Does this PR introduce a user-facing change?

[PERF] TSDB: Fix O(n²) head chunk iteration and optimize chunk lookups using tracked head chunk counts and pre-collected head chunks

@aknuds1 aknuds1 changed the title tsdb: fix O(n²) headChunks linked-list iteration in query path tsdb: fix O(n²) headChunks linked-list iteration in query and mmap path Mar 14, 2026
@aknuds1 aknuds1 changed the title tsdb: fix O(n²) headChunks linked-list iteration in query and mmap path tsdb: fix O(n²) headChunks linked-list iteration in query and mmap paths Mar 14, 2026
@aknuds1
aknuds1 force-pushed the arve/optimize-head-chunks branch 2 times, most recently from 51b10e4 to 1f17fe2 Compare March 14, 2026 13:14
@aknuds1

aknuds1 commented Mar 14, 2026

Copy link
Copy Markdown
Contributor Author

/prombench main

@prombot

prombot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

⏱️ Welcome to Prometheus Benchmarking Tool. ⏱️

Compared versions: PR-18300 and main

After the successful deployment (check status here), the benchmarking results can be viewed at:

Available Commands:

  • To restart benchmark: /prombench restart main
  • To stop benchmark: /prombench cancel
  • To print help: /prombench help

@aknuds1
aknuds1 marked this pull request as ready for review March 14, 2026 13:24
@aknuds1
aknuds1 force-pushed the arve/optimize-head-chunks branch from 1f17fe2 to 4bf5c79 Compare March 14, 2026 16:07
@aknuds1
aknuds1 marked this pull request as draft March 14, 2026 16:20
@aknuds1
aknuds1 force-pushed the arve/optimize-head-chunks branch from c03444e to 36d775f Compare March 14, 2026 17:33
@aknuds1

aknuds1 commented Mar 14, 2026

Copy link
Copy Markdown
Contributor Author

/prombench restart main

@prombot

prombot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

⏱️ Welcome (again) to Prometheus Benchmarking Tool. ⏱️

Compared versions: PR-18300 and main

After successful deployment (check status here), the benchmarking results can be viewed at:

Available Commands:

  • To restart benchmark: /prombench restart main
  • To stop benchmark: /prombench cancel
  • To print help: /prombench help

@aknuds1 aknuds1 changed the title tsdb: fix O(n²) headChunks linked-list iteration in query and mmap paths tsdb: optimize head chunk access paths Mar 14, 2026
@aknuds1

aknuds1 commented Mar 15, 2026

Copy link
Copy Markdown
Contributor Author

/prombench cancel

@prombot

prombot commented Mar 15, 2026

Copy link
Copy Markdown
Contributor

Benchmark cancel is in progress.

@aknuds1
aknuds1 force-pushed the arve/optimize-head-chunks branch from 36d775f to c46c547 Compare March 15, 2026 09:42
@aknuds1 aknuds1 changed the title tsdb: optimize head chunk access paths WIP: tsdb: optimize head chunk access paths Mar 15, 2026
@aknuds1
aknuds1 force-pushed the arve/optimize-head-chunks branch 3 times, most recently from 9cd1b3d to 5ed8cfe Compare April 14, 2026 16:48
@aknuds1 aknuds1 changed the title WIP: tsdb: optimize head chunk access paths tsdb: optimize head chunk access paths Apr 18, 2026
@aknuds1
aknuds1 force-pushed the arve/optimize-head-chunks branch from 4998f2c to 68c21b7 Compare July 9, 2026 10:22
@aknuds1
aknuds1 marked this pull request as ready for review July 9, 2026 10:25
@aknuds1

aknuds1 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Dependencies are merged, so ready for review again.

@krajorama krajorama left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, a few nit comments plus for coverage let's add to the end of TestMemSeries_chunk_FastPath line 498:

	// Out-of-range ID via the fast path must return ErrNotFound (covers the fast-path bounds check).
	_, _, _, err = series.chunk(chunks.HeadChunkID(totalChunks), chunkDiskMapper, memChunkPool, hc)
	require.ErrorIs(t, err, storage.ErrNotFound)

Comment thread tsdb/head_read.go Resolved
Comment thread tsdb/head_read.go Resolved
Comment thread tsdb/head_read.go Resolved
Comment thread tsdb/head_append.go Resolved
aknuds1 and others added 10 commits July 15, 2026 14:22
Replace O(n²) linked-list traversals with O(n) or O(1) alternatives in
head chunk operations.

Apply collectHeadChunks() to mmapChunks and iterator, replacing atOffset()
loops that re-walked from the head on every call. Replace .headChunks.len()
walks in deleteSeriesByID and gcStaleSeries with O(1) headChunkCount.Load()
reads. Replace chk.len() in truncateChunksBefore with headChunkCount
arithmetic. Add an H=1 fast path in s.chunk() for the common single-head-
chunk case. Remove the now-unused atOffset() method.

Signed-off-by: Arve Knudsen <[email protected]>
Compaction reads all chunks of each series sequentially via
populateWithDelGenericSeriesIterator, which calls chunkFromSeries →
s.chunk() for each chunk. Without the cache, each lookup walks the
head chunks linked list — O(n) per chunk, O(n²) per series.

Enable the chunkCacheToggler on the ChunkReader during compaction's
block population loop. This gives O(1) indexed lookups for head chunks,
matching what range queries already get.

This reduces the CPU spike during the periodic 2-hour head compaction,
which was observed at +2-6 cores above baseline in production profiling.

Signed-off-by: Arve Knudsen <[email protected]>
Co-authored-by: George Krajcsovits <[email protected]>
Signed-off-by: Arve Knudsen <[email protected]>
Co-authored-by: George Krajcsovits <[email protected]>
Signed-off-by: Arve Knudsen <[email protected]>
- Restore "If any head chunk is truncated" comment in truncateChunksBefore.
- Extract collectHeadChunksBufSize constant for the stack buffer size.
- Document cache invalidation on parallel appends in EnableChunkCache.
- Exclude setup from BenchmarkTruncateChunksBefore measurement.
- Assert head chunk count in compaction benchmark setup.

Signed-off-by: Arve Knudsen <[email protected]>
- Replace stack-allocated [16]*memChunk buffers with make() using
  headChunkCount for exact sizing (Go 1.25+ can stack-allocate these).
- Rename chunkCacheToggler -> chunkCacheEnabler (it latches, not toggles).
- Remove H=1 fast path in s.chunk() (the loop handles it with zero
  iterations).
- Rewrite ix comment to describe the full logical chunk index, not just
  the mmappedChunks slice.
- Simplify "Head chunk lookup" comment.
- Move chain ordering example to collectHeadChunks doc comment.
- Use typed benchmark sinks to avoid interface boxing overhead.

Signed-off-by: Arve Knudsen <[email protected]>
Walk the head-chunk list directly instead of materializing it into a
slice, using headChunkCount for the position arithmetic like
memSeries.chunk already does.

Co-authored-by: György Krajcsovits <[email protected]>
Signed-off-by: Arve Knudsen <[email protected]>
Signed-off-by: Arve Knudsen <[email protected]>
Co-authored-by: George Krajcsovits <[email protected]>
Signed-off-by: Arve Knudsen <[email protected]>
Restore the detailed chunk-ordering explanation and cover an out-of-range lookup through the pre-collected head chunk fast path.

Co-authored-by: George Krajcsovits <[email protected]>
Signed-off-by: Arve Knudsen <[email protected]>
@aknuds1
aknuds1 force-pushed the arve/optimize-head-chunks branch from a3659db to 89c7f2c Compare July 15, 2026 13:08

@krajorama krajorama left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aknuds1
aknuds1 merged commit 9caf2ca into prometheus:main Jul 15, 2026
37 checks passed
@aknuds1
aknuds1 deleted the arve/optimize-head-chunks branch July 15, 2026 14:03
julienduchesne added a commit to grafana/mimir that referenced this pull request Aug 13, 2026
## Summary

Vendor the mimir-prometheus `mimir-release-2.17` tip so GEM/Mimir 2.17
picks up the head-chunk access optimization from
grafana/mimir-prometheus#1272 (prometheus/prometheus#18300), cutting the
O(n²) `memChunk.len` cost seen during ingester `PopulateBlock`.

- Bump replace to `mimir-prometheus` `9bc72b19` (includes
grafana/mimir-prometheus#1272 plus the supporting head-chunk
cache/#19139 stack already on that branch)
- Enables the head-chunk cache during compaction and uses tracked
`headChunkCount` / pre-collected head chunks for lookups

### Context

Ingester CPU profiles on fat heads showed ~21% flat time in
`memChunk.len` under `compactHead` → `PopulateBlock`. That path walks
the in-memory head-chunk linked list on every chunk lookup; the vendored
fix replaces those walks with O(1)/cached access on the first compaction
after deploy.


```
goos: darwin
goarch: arm64
pkg: github.com/prometheus/prometheus/tsdb
cpu: Apple M3 Pro
                                                          │ before-6.txt │           after-6.txt            │
                                                          │    sec/op    │   sec/op     vs base             │
HeadChunkCompaction/baseline/series=50000,chunks=1-11         459.6m ±20%   418.6m ±12%   -8.91% (p=0.041 n=6)
HeadChunkCompaction/moderate/series=1000,chunks=50-11         312.7m ±12%   301.9m ±10%        ~ (p=0.589 n=6)
HeadChunkCompaction/pathological/series=10,chunks=5000-11    1194.6m ± 3%   303.9m ±17%  -74.56% (p=0.002 n=6)
HeadChunkCompaction/heavy/series=10,chunks=20000-11         19347.3m ± 0%   300.7m ±15%  -98.45% (p=0.002 n=6)
geomean                                                        1.350       327.8m        -75.72%

                                                          │ before-6.txt │          after-6.txt           │
                                                          │     B/op     │    B/op      vs base           │
HeadChunkCompaction/baseline/series=50000,chunks=1-11       158.7Mi ±0%   158.7Mi ±0%       ~ (p=0.818 n=6)
HeadChunkCompaction/moderate/series=1000,chunks=50-11       41.37Mi ±0%   41.37Mi ±0%       ~ (p=0.909 n=6)
HeadChunkCompaction/pathological/series=10,chunks=5000-11   41.23Mi ±0%   43.10Mi ±0%  +4.53% (p=0.002 n=6)
HeadChunkCompaction/heavy/series=10,chunks=20000-11         88.95Mi ±0%   97.77Mi ±0%  +9.91% (p=0.002 n=6)
geomean                                                     70.05Mi       72.52Mi       +3.52%

                                                          │ before-6.txt │         after-6.txt          │
                                                          │  allocs/op   │ allocs/op   vs base          │
HeadChunkCompaction/baseline/series=50000,chunks=1-11       1.551M ±0%   1.551M ±0%       ~ (p=0.937 n=6)
HeadChunkCompaction/moderate/series=1000,chunks=50-11       86.46k ±0%   86.47k ±0%  +0.01% (p=0.026 n=6)
HeadChunkCompaction/pathological/series=10,chunks=5000-11   50.85k ±0%   51.02k ±0%  +0.34% (p=0.002 n=6)
HeadChunkCompaction/heavy/series=10,chunks=20000-11         200.9k ±0%   201.1k ±0%  +0.11% (p=0.002 n=6)
geomean                                                     192.4k       192.6k       +0.11%
```

Co-authored-by: Cursor <[email protected]>
renovate Bot added a commit to sdwilsh/ansible-playbooks that referenced this pull request Aug 21, 2026
##### [\`v3.14.0\`](https://github.com/prometheus/prometheus/releases/tag/v3.14.0)

- \[CHANGE] API: Deprecate the `stats` query parameter of `/api/v1/query` and `/api/v1/query_range` for values other than `true` and `all`. Other values still enable basic statistics but now return a deprecation warning; they will be rejected in the next major release. [#19124](prometheus/prometheus#19124)
- \[CHANGE] API: `/api/v1/status/config` now correctly shows `separator: ""` and `replacement: ""` in relabel configs when explicitly set to empty, instead of omitting them. [#18653](prometheus/prometheus#18653)
- \[CHANGE] Discovery/Hetzner: Drop the `__meta_hetzner_datacenter` label for `hcloud` targets, following its removal from the Hetzner Cloud API. [#19269](prometheus/prometheus#19269)
- \[CHANGE] PromQL: Enable duration expressions by default. The `promql-duration-expr` feature flag is now a no-op. [#19033](prometheus/prometheus#19033)
- \[CHANGE] PromQL: Promote `first_over_time` to stable. It no longer requires the `promql-experimental-functions` feature flag. [#19093](prometheus/prometheus#19093)
- \[FEATURE] Discovery: Add Oracle Cloud Infrastructure compute service discovery (`oci_sd_configs`). [#18919](prometheus/prometheus#18919)
- \[FEATURE] PromQL: Add experimental `start_timestamp(instant-vector)` function returning the start timestamp of each sample in the given vector. Requires the `use-start-timestamps` feature flag. [#19089](prometheus/prometheus#19089)
- \[FEATURE] PromQL: Allow `rate()` and `increase()` to use start timestamps as an alternative for rate extrapolation. Hidden behind the `use-start-timestamps` feature flag. [#18619](prometheus/prometheus#18619)
- \[FEATURE] TSDB: Add experimental support for encoding start timestamps in histograms and float histograms. Hidden behind the `histograms-st-encoding` feature flag. [#18609](prometheus/prometheus#18609)
- \[ENHANCEMENT] OTLP: Emit a warning when OTLP attribute names collide into the same Prometheus label after sanitization (e.g. `k8s.pod.name` and `k8s_pod_name` both become `k8s_pod_name`), and expose the `prometheus_api_otlp_translation_warnings_total` counter labelled by `category` to track such warnings. [#18957](prometheus/prometheus#18957)
- \[ENHANCEMENT] Promtool: Add `--remote-write.path` flag to `push metrics` for backends that use a non-default remote-write endpoint. [#19086](prometheus/prometheus#19086)
- \[ENHANCEMENT] Remote write: Forward histogram start timestamps in the remote write V2 protocol. [#18903](prometheus/prometheus#18903)
- \[ENHANCEMENT] TSDB: Add `prometheus_tsdb_head_native_histogram_series` and `prometheus_tsdb_head_native_histogram_buckets` gauges tracking the number of native histogram series and buckets in the head. [#19170](prometheus/prometheus#19170)
- \[ENHANCEMENT] UI: Add syntax highlighting, autocompletion, and linting for PromQL duration expressions (`step()`, `range()`, `min_of()`, `max_of()`) in range selectors and subqueries. [#18625](prometheus/prometheus#18625)
- \[ENHANCEMENT] UI: Add copy button next to rule names on the Rules and Alerts pages. [#18706](prometheus/prometheus#18706)
- \[ENHANCEMENT] UI: Improve rule group title contrast on the Rules page. [#19181](prometheus/prometheus#19181)
- \[PERF] Speed up regex label matchers matching a set of literal values (e.g. `{job=~"foo|bar|baz"}`). [#18833](prometheus/prometheus#18833)
- \[PERF] Remote read: Improve remote read throughput by removing unnecessary per-write flushing. [#18470](prometheus/prometheus#18470)
- \[PERF] Scrape: Parse text and OpenMetrics formats without recursion, preventing stack overflow from deeply nested or malicious exposition input. [#19143](prometheus/prometheus#19143)
- \[PERF] Scrape: Reduce native histogram scrape parsing allocations by \~49%. [#19282](prometheus/prometheus#19282)
- \[PERF] TSDB: Speed up queries on series with many in-memory chunks. [#18300](prometheus/prometheus#18300)
- \[BUGFIX] Alerting: Fix 100% CPU usage on shutdown that could delay graceful shutdown and trigger timeout-based kills. [#17859](prometheus/prometheus#17859)
- \[BUGFIX] Discovery/AWS: Stop `promtool check config` from making AWS metadata service (IMDS) network calls when the `region` field is omitted in EC2, ECS, RDS, MSK, ElastiCache, and Lightsail service discovery configs. [#19037](prometheus/prometheus#19037)
- \[BUGFIX] Discovery/Docker: Set a request timeout for `docker_sd` and `dockerswarm_sd` on `unix`, `npipe`, and `tcp` hosts. Previously an unresponsive daemon could freeze discovery indefinitely, silently pinning targets to a stale snapshot. [#19237](prometheus/prometheus#19237)
- \[BUGFIX] Discovery/Docker: Fix panic in Docker Swarm service discovery when a service runs as a plugin or network-attachment. [#19102](prometheus/prometheus#19102)
- \[BUGFIX] Discovery/Docker: Fix discovery of IPv6-only containers. [#18778](prometheus/prometheus#18778)
- \[BUGFIX] PromQL: Fix case-insensitive regex label matchers silently dropping matching values. [#19167](prometheus/prometheus#19167)
- \[BUGFIX] PromQL: Fix `mad_over_time` returning 0 instead of `NaN` when the range contains a `NaN` sample. [#19040](prometheus/prometheus#19040)
- \[BUGFIX] Promtool: Accept `--enable-feature=promql-binop-fill-modifiers` in `check rules`, which previously rejected valid `fill()`/`fill_left()`/`fill_right()` expressions. [#19153](prometheus/prometheus#19153)
- \[BUGFIX] Remote write: Respect the `AZURE_FEDERATED_TOKEN_FILE` environment variable for workload identity authentication instead of hardcoding the token file path. [#18973](prometheus/prometheus#18973)
- \[BUGFIX] Rules: Clean up stale `rule_group_last_rule_duration_sum_seconds` and `rule_group_last_restore_duration_seconds` series when a rule group is removed or renamed on reload. Previously each reload leaked two series per dropped group, growing `/metrics` cardinality over time. [#19107](prometheus/prometheus#19107)
- \[BUGFIX] Scrape: Fix scrape manager spinning at 100% CPU on shutdown. [#19149](prometheus/prometheus#19149)
- \[BUGFIX] TSDB: Fix silent data loss and potential crash loop when `stale_series_compaction_threshold` is used in the config file. [#19016](prometheus/prometheus#19016)
- \[BUGFIX] TSDB: Fix potential data loss on restart when out-of-order ingestion is enabled and blocks are compacted. [#19016](prometheus/prometheus#19016)
- \[BUGFIX] TSDB: Fix `prometheus_tsdb_head_stale_series` over-counting and early eviction of series that change between float, integer histogram, and float histogram sample types. [#19183](prometheus/prometheus#19183)
- \[BUGFIX] TSDB: Fix goroutine and file handle leaks when Prometheus fails to open a corrupt TSDB. On Windows, the leaked directory handle also prevented TSDB directory removal. [#18291](prometheus/prometheus#18291)
- \[BUGFIX] TSDB: Fix out-of-order queries blocking compaction for hours, causing memory usage to grow. [#19013](prometheus/prometheus#19013)
- \[BUGFIX] TSDB: Fix deleted series causing missing samples and errors after restart. [#19140](prometheus/prometheus#19140)
- \[BUGFIX] TSDB: Fix native histogram data becoming incorrect after restart. [#19202](prometheus/prometheus#19202)
- \[BUGFIX] TSDB: Surface query errors that were previously silently discarded. [#19120](prometheus/prometheus#19120)
- \[BUGFIX] TSDB: Honour the configured float chunk encoding when compaction rewrites chunks; previously chunks encoded with `--enable-feature=xor2-encoding` could silently revert to XOR after compaction. [#19145](prometheus/prometheus#19145)
- \[BUGFIX] UI: Show the delete-series form on the TSDB Status page when `--web.enable-admin-api` is enabled. [#19025](prometheus/prometheus#19025)
renovate Bot added a commit to sdwilsh/ansible-playbooks that referenced this pull request Aug 21, 2026
##### [\`v3.14.0\`](https://github.com/prometheus/prometheus/releases/tag/v3.14.0)

- \[CHANGE] API: Deprecate the `stats` query parameter of `/api/v1/query` and `/api/v1/query_range` for values other than `true` and `all`. Other values still enable basic statistics but now return a deprecation warning; they will be rejected in the next major release. [#19124](prometheus/prometheus#19124)
- \[CHANGE] API: `/api/v1/status/config` now correctly shows `separator: ""` and `replacement: ""` in relabel configs when explicitly set to empty, instead of omitting them. [#18653](prometheus/prometheus#18653)
- \[CHANGE] Discovery/Hetzner: Drop the `__meta_hetzner_datacenter` label for `hcloud` targets, following its removal from the Hetzner Cloud API. [#19269](prometheus/prometheus#19269)
- \[CHANGE] PromQL: Enable duration expressions by default. The `promql-duration-expr` feature flag is now a no-op. [#19033](prometheus/prometheus#19033)
- \[CHANGE] PromQL: Promote `first_over_time` to stable. It no longer requires the `promql-experimental-functions` feature flag. [#19093](prometheus/prometheus#19093)
- \[FEATURE] Discovery: Add Oracle Cloud Infrastructure compute service discovery (`oci_sd_configs`). [#18919](prometheus/prometheus#18919)
- \[FEATURE] PromQL: Add experimental `start_timestamp(instant-vector)` function returning the start timestamp of each sample in the given vector. Requires the `use-start-timestamps` feature flag. [#19089](prometheus/prometheus#19089)
- \[FEATURE] PromQL: Allow `rate()` and `increase()` to use start timestamps as an alternative for rate extrapolation. Hidden behind the `use-start-timestamps` feature flag. [#18619](prometheus/prometheus#18619)
- \[FEATURE] TSDB: Add experimental support for encoding start timestamps in histograms and float histograms. Hidden behind the `histograms-st-encoding` feature flag. [#18609](prometheus/prometheus#18609)
- \[ENHANCEMENT] OTLP: Emit a warning when OTLP attribute names collide into the same Prometheus label after sanitization (e.g. `k8s.pod.name` and `k8s_pod_name` both become `k8s_pod_name`), and expose the `prometheus_api_otlp_translation_warnings_total` counter labelled by `category` to track such warnings. [#18957](prometheus/prometheus#18957)
- \[ENHANCEMENT] Promtool: Add `--remote-write.path` flag to `push metrics` for backends that use a non-default remote-write endpoint. [#19086](prometheus/prometheus#19086)
- \[ENHANCEMENT] Remote write: Forward histogram start timestamps in the remote write V2 protocol. [#18903](prometheus/prometheus#18903)
- \[ENHANCEMENT] TSDB: Add `prometheus_tsdb_head_native_histogram_series` and `prometheus_tsdb_head_native_histogram_buckets` gauges tracking the number of native histogram series and buckets in the head. [#19170](prometheus/prometheus#19170)
- \[ENHANCEMENT] UI: Add syntax highlighting, autocompletion, and linting for PromQL duration expressions (`step()`, `range()`, `min_of()`, `max_of()`) in range selectors and subqueries. [#18625](prometheus/prometheus#18625)
- \[ENHANCEMENT] UI: Add copy button next to rule names on the Rules and Alerts pages. [#18706](prometheus/prometheus#18706)
- \[ENHANCEMENT] UI: Improve rule group title contrast on the Rules page. [#19181](prometheus/prometheus#19181)
- \[PERF] Speed up regex label matchers matching a set of literal values (e.g. `{job=~"foo|bar|baz"}`). [#18833](prometheus/prometheus#18833)
- \[PERF] Remote read: Improve remote read throughput by removing unnecessary per-write flushing. [#18470](prometheus/prometheus#18470)
- \[PERF] Scrape: Parse text and OpenMetrics formats without recursion, preventing stack overflow from deeply nested or malicious exposition input. [#19143](prometheus/prometheus#19143)
- \[PERF] Scrape: Reduce native histogram scrape parsing allocations by \~49%. [#19282](prometheus/prometheus#19282)
- \[PERF] TSDB: Speed up queries on series with many in-memory chunks. [#18300](prometheus/prometheus#18300)
- \[BUGFIX] Alerting: Fix 100% CPU usage on shutdown that could delay graceful shutdown and trigger timeout-based kills. [#17859](prometheus/prometheus#17859)
- \[BUGFIX] Discovery/AWS: Stop `promtool check config` from making AWS metadata service (IMDS) network calls when the `region` field is omitted in EC2, ECS, RDS, MSK, ElastiCache, and Lightsail service discovery configs. [#19037](prometheus/prometheus#19037)
- \[BUGFIX] Discovery/Docker: Set a request timeout for `docker_sd` and `dockerswarm_sd` on `unix`, `npipe`, and `tcp` hosts. Previously an unresponsive daemon could freeze discovery indefinitely, silently pinning targets to a stale snapshot. [#19237](prometheus/prometheus#19237)
- \[BUGFIX] Discovery/Docker: Fix panic in Docker Swarm service discovery when a service runs as a plugin or network-attachment. [#19102](prometheus/prometheus#19102)
- \[BUGFIX] Discovery/Docker: Fix discovery of IPv6-only containers. [#18778](prometheus/prometheus#18778)
- \[BUGFIX] PromQL: Fix case-insensitive regex label matchers silently dropping matching values. [#19167](prometheus/prometheus#19167)
- \[BUGFIX] PromQL: Fix `mad_over_time` returning 0 instead of `NaN` when the range contains a `NaN` sample. [#19040](prometheus/prometheus#19040)
- \[BUGFIX] Promtool: Accept `--enable-feature=promql-binop-fill-modifiers` in `check rules`, which previously rejected valid `fill()`/`fill_left()`/`fill_right()` expressions. [#19153](prometheus/prometheus#19153)
- \[BUGFIX] Remote write: Respect the `AZURE_FEDERATED_TOKEN_FILE` environment variable for workload identity authentication instead of hardcoding the token file path. [#18973](prometheus/prometheus#18973)
- \[BUGFIX] Rules: Clean up stale `rule_group_last_rule_duration_sum_seconds` and `rule_group_last_restore_duration_seconds` series when a rule group is removed or renamed on reload. Previously each reload leaked two series per dropped group, growing `/metrics` cardinality over time. [#19107](prometheus/prometheus#19107)
- \[BUGFIX] Scrape: Fix scrape manager spinning at 100% CPU on shutdown. [#19149](prometheus/prometheus#19149)
- \[BUGFIX] TSDB: Fix silent data loss and potential crash loop when `stale_series_compaction_threshold` is used in the config file. [#19016](prometheus/prometheus#19016)
- \[BUGFIX] TSDB: Fix potential data loss on restart when out-of-order ingestion is enabled and blocks are compacted. [#19016](prometheus/prometheus#19016)
- \[BUGFIX] TSDB: Fix `prometheus_tsdb_head_stale_series` over-counting and early eviction of series that change between float, integer histogram, and float histogram sample types. [#19183](prometheus/prometheus#19183)
- \[BUGFIX] TSDB: Fix goroutine and file handle leaks when Prometheus fails to open a corrupt TSDB. On Windows, the leaked directory handle also prevented TSDB directory removal. [#18291](prometheus/prometheus#18291)
- \[BUGFIX] TSDB: Fix out-of-order queries blocking compaction for hours, causing memory usage to grow. [#19013](prometheus/prometheus#19013)
- \[BUGFIX] TSDB: Fix deleted series causing missing samples and errors after restart. [#19140](prometheus/prometheus#19140)
- \[BUGFIX] TSDB: Fix native histogram data becoming incorrect after restart. [#19202](prometheus/prometheus#19202)
- \[BUGFIX] TSDB: Surface query errors that were previously silently discarded. [#19120](prometheus/prometheus#19120)
- \[BUGFIX] TSDB: Honour the configured float chunk encoding when compaction rewrites chunks; previously chunks encoded with `--enable-feature=xor2-encoding` could silently revert to XOR after compaction. [#19145](prometheus/prometheus#19145)
- \[BUGFIX] UI: Show the delete-series form on the TSDB Status page when `--web.enable-admin-api` is enabled. [#19025](prometheus/prometheus#19025)
renovate Bot added a commit to sdwilsh/ansible-playbooks that referenced this pull request Aug 21, 2026
##### [\`v3.14.0\`](https://github.com/prometheus/prometheus/releases/tag/v3.14.0)

- \[CHANGE] API: Deprecate the `stats` query parameter of `/api/v1/query` and `/api/v1/query_range` for values other than `true` and `all`. Other values still enable basic statistics but now return a deprecation warning; they will be rejected in the next major release. [#19124](prometheus/prometheus#19124)
- \[CHANGE] API: `/api/v1/status/config` now correctly shows `separator: ""` and `replacement: ""` in relabel configs when explicitly set to empty, instead of omitting them. [#18653](prometheus/prometheus#18653)
- \[CHANGE] Discovery/Hetzner: Drop the `__meta_hetzner_datacenter` label for `hcloud` targets, following its removal from the Hetzner Cloud API. [#19269](prometheus/prometheus#19269)
- \[CHANGE] PromQL: Enable duration expressions by default. The `promql-duration-expr` feature flag is now a no-op. [#19033](prometheus/prometheus#19033)
- \[CHANGE] PromQL: Promote `first_over_time` to stable. It no longer requires the `promql-experimental-functions` feature flag. [#19093](prometheus/prometheus#19093)
- \[FEATURE] Discovery: Add Oracle Cloud Infrastructure compute service discovery (`oci_sd_configs`). [#18919](prometheus/prometheus#18919)
- \[FEATURE] PromQL: Add experimental `start_timestamp(instant-vector)` function returning the start timestamp of each sample in the given vector. Requires the `use-start-timestamps` feature flag. [#19089](prometheus/prometheus#19089)
- \[FEATURE] PromQL: Allow `rate()` and `increase()` to use start timestamps as an alternative for rate extrapolation. Hidden behind the `use-start-timestamps` feature flag. [#18619](prometheus/prometheus#18619)
- \[FEATURE] TSDB: Add experimental support for encoding start timestamps in histograms and float histograms. Hidden behind the `histograms-st-encoding` feature flag. [#18609](prometheus/prometheus#18609)
- \[ENHANCEMENT] OTLP: Emit a warning when OTLP attribute names collide into the same Prometheus label after sanitization (e.g. `k8s.pod.name` and `k8s_pod_name` both become `k8s_pod_name`), and expose the `prometheus_api_otlp_translation_warnings_total` counter labelled by `category` to track such warnings. [#18957](prometheus/prometheus#18957)
- \[ENHANCEMENT] Promtool: Add `--remote-write.path` flag to `push metrics` for backends that use a non-default remote-write endpoint. [#19086](prometheus/prometheus#19086)
- \[ENHANCEMENT] Remote write: Forward histogram start timestamps in the remote write V2 protocol. [#18903](prometheus/prometheus#18903)
- \[ENHANCEMENT] TSDB: Add `prometheus_tsdb_head_native_histogram_series` and `prometheus_tsdb_head_native_histogram_buckets` gauges tracking the number of native histogram series and buckets in the head. [#19170](prometheus/prometheus#19170)
- \[ENHANCEMENT] UI: Add syntax highlighting, autocompletion, and linting for PromQL duration expressions (`step()`, `range()`, `min_of()`, `max_of()`) in range selectors and subqueries. [#18625](prometheus/prometheus#18625)
- \[ENHANCEMENT] UI: Add copy button next to rule names on the Rules and Alerts pages. [#18706](prometheus/prometheus#18706)
- \[ENHANCEMENT] UI: Improve rule group title contrast on the Rules page. [#19181](prometheus/prometheus#19181)
- \[PERF] Speed up regex label matchers matching a set of literal values (e.g. `{job=~"foo|bar|baz"}`). [#18833](prometheus/prometheus#18833)
- \[PERF] Remote read: Improve remote read throughput by removing unnecessary per-write flushing. [#18470](prometheus/prometheus#18470)
- \[PERF] Scrape: Parse text and OpenMetrics formats without recursion, preventing stack overflow from deeply nested or malicious exposition input. [#19143](prometheus/prometheus#19143)
- \[PERF] Scrape: Reduce native histogram scrape parsing allocations by \~49%. [#19282](prometheus/prometheus#19282)
- \[PERF] TSDB: Speed up queries on series with many in-memory chunks. [#18300](prometheus/prometheus#18300)
- \[BUGFIX] Alerting: Fix 100% CPU usage on shutdown that could delay graceful shutdown and trigger timeout-based kills. [#17859](prometheus/prometheus#17859)
- \[BUGFIX] Discovery/AWS: Stop `promtool check config` from making AWS metadata service (IMDS) network calls when the `region` field is omitted in EC2, ECS, RDS, MSK, ElastiCache, and Lightsail service discovery configs. [#19037](prometheus/prometheus#19037)
- \[BUGFIX] Discovery/Docker: Set a request timeout for `docker_sd` and `dockerswarm_sd` on `unix`, `npipe`, and `tcp` hosts. Previously an unresponsive daemon could freeze discovery indefinitely, silently pinning targets to a stale snapshot. [#19237](prometheus/prometheus#19237)
- \[BUGFIX] Discovery/Docker: Fix panic in Docker Swarm service discovery when a service runs as a plugin or network-attachment. [#19102](prometheus/prometheus#19102)
- \[BUGFIX] Discovery/Docker: Fix discovery of IPv6-only containers. [#18778](prometheus/prometheus#18778)
- \[BUGFIX] PromQL: Fix case-insensitive regex label matchers silently dropping matching values. [#19167](prometheus/prometheus#19167)
- \[BUGFIX] PromQL: Fix `mad_over_time` returning 0 instead of `NaN` when the range contains a `NaN` sample. [#19040](prometheus/prometheus#19040)
- \[BUGFIX] Promtool: Accept `--enable-feature=promql-binop-fill-modifiers` in `check rules`, which previously rejected valid `fill()`/`fill_left()`/`fill_right()` expressions. [#19153](prometheus/prometheus#19153)
- \[BUGFIX] Remote write: Respect the `AZURE_FEDERATED_TOKEN_FILE` environment variable for workload identity authentication instead of hardcoding the token file path. [#18973](prometheus/prometheus#18973)
- \[BUGFIX] Rules: Clean up stale `rule_group_last_rule_duration_sum_seconds` and `rule_group_last_restore_duration_seconds` series when a rule group is removed or renamed on reload. Previously each reload leaked two series per dropped group, growing `/metrics` cardinality over time. [#19107](prometheus/prometheus#19107)
- \[BUGFIX] Scrape: Fix scrape manager spinning at 100% CPU on shutdown. [#19149](prometheus/prometheus#19149)
- \[BUGFIX] TSDB: Fix silent data loss and potential crash loop when `stale_series_compaction_threshold` is used in the config file. [#19016](prometheus/prometheus#19016)
- \[BUGFIX] TSDB: Fix potential data loss on restart when out-of-order ingestion is enabled and blocks are compacted. [#19016](prometheus/prometheus#19016)
- \[BUGFIX] TSDB: Fix `prometheus_tsdb_head_stale_series` over-counting and early eviction of series that change between float, integer histogram, and float histogram sample types. [#19183](prometheus/prometheus#19183)
- \[BUGFIX] TSDB: Fix goroutine and file handle leaks when Prometheus fails to open a corrupt TSDB. On Windows, the leaked directory handle also prevented TSDB directory removal. [#18291](prometheus/prometheus#18291)
- \[BUGFIX] TSDB: Fix out-of-order queries blocking compaction for hours, causing memory usage to grow. [#19013](prometheus/prometheus#19013)
- \[BUGFIX] TSDB: Fix deleted series causing missing samples and errors after restart. [#19140](prometheus/prometheus#19140)
- \[BUGFIX] TSDB: Fix native histogram data becoming incorrect after restart. [#19202](prometheus/prometheus#19202)
- \[BUGFIX] TSDB: Surface query errors that were previously silently discarded. [#19120](prometheus/prometheus#19120)
- \[BUGFIX] TSDB: Honour the configured float chunk encoding when compaction rewrites chunks; previously chunks encoded with `--enable-feature=xor2-encoding` could silently revert to XOR after compaction. [#19145](prometheus/prometheus#19145)
- \[BUGFIX] UI: Show the delete-series form on the TSDB Status page when `--web.enable-admin-api` is enabled. [#19025](prometheus/prometheus#19025)
renovate Bot added a commit to sdwilsh/ansible-playbooks that referenced this pull request Aug 21, 2026
##### [\`v3.14.0\`](https://github.com/prometheus/prometheus/releases/tag/v3.14.0)

- \[CHANGE] API: Deprecate the `stats` query parameter of `/api/v1/query` and `/api/v1/query_range` for values other than `true` and `all`. Other values still enable basic statistics but now return a deprecation warning; they will be rejected in the next major release. [#19124](prometheus/prometheus#19124)
- \[CHANGE] API: `/api/v1/status/config` now correctly shows `separator: ""` and `replacement: ""` in relabel configs when explicitly set to empty, instead of omitting them. [#18653](prometheus/prometheus#18653)
- \[CHANGE] Discovery/Hetzner: Drop the `__meta_hetzner_datacenter` label for `hcloud` targets, following its removal from the Hetzner Cloud API. [#19269](prometheus/prometheus#19269)
- \[CHANGE] PromQL: Enable duration expressions by default. The `promql-duration-expr` feature flag is now a no-op. [#19033](prometheus/prometheus#19033)
- \[CHANGE] PromQL: Promote `first_over_time` to stable. It no longer requires the `promql-experimental-functions` feature flag. [#19093](prometheus/prometheus#19093)
- \[FEATURE] Discovery: Add Oracle Cloud Infrastructure compute service discovery (`oci_sd_configs`). [#18919](prometheus/prometheus#18919)
- \[FEATURE] PromQL: Add experimental `start_timestamp(instant-vector)` function returning the start timestamp of each sample in the given vector. Requires the `use-start-timestamps` feature flag. [#19089](prometheus/prometheus#19089)
- \[FEATURE] PromQL: Allow `rate()` and `increase()` to use start timestamps as an alternative for rate extrapolation. Hidden behind the `use-start-timestamps` feature flag. [#18619](prometheus/prometheus#18619)
- \[FEATURE] TSDB: Add experimental support for encoding start timestamps in histograms and float histograms. Hidden behind the `histograms-st-encoding` feature flag. [#18609](prometheus/prometheus#18609)
- \[ENHANCEMENT] OTLP: Emit a warning when OTLP attribute names collide into the same Prometheus label after sanitization (e.g. `k8s.pod.name` and `k8s_pod_name` both become `k8s_pod_name`), and expose the `prometheus_api_otlp_translation_warnings_total` counter labelled by `category` to track such warnings. [#18957](prometheus/prometheus#18957)
- \[ENHANCEMENT] Promtool: Add `--remote-write.path` flag to `push metrics` for backends that use a non-default remote-write endpoint. [#19086](prometheus/prometheus#19086)
- \[ENHANCEMENT] Remote write: Forward histogram start timestamps in the remote write V2 protocol. [#18903](prometheus/prometheus#18903)
- \[ENHANCEMENT] TSDB: Add `prometheus_tsdb_head_native_histogram_series` and `prometheus_tsdb_head_native_histogram_buckets` gauges tracking the number of native histogram series and buckets in the head. [#19170](prometheus/prometheus#19170)
- \[ENHANCEMENT] UI: Add syntax highlighting, autocompletion, and linting for PromQL duration expressions (`step()`, `range()`, `min_of()`, `max_of()`) in range selectors and subqueries. [#18625](prometheus/prometheus#18625)
- \[ENHANCEMENT] UI: Add copy button next to rule names on the Rules and Alerts pages. [#18706](prometheus/prometheus#18706)
- \[ENHANCEMENT] UI: Improve rule group title contrast on the Rules page. [#19181](prometheus/prometheus#19181)
- \[PERF] Speed up regex label matchers matching a set of literal values (e.g. `{job=~"foo|bar|baz"}`). [#18833](prometheus/prometheus#18833)
- \[PERF] Remote read: Improve remote read throughput by removing unnecessary per-write flushing. [#18470](prometheus/prometheus#18470)
- \[PERF] Scrape: Parse text and OpenMetrics formats without recursion, preventing stack overflow from deeply nested or malicious exposition input. [#19143](prometheus/prometheus#19143)
- \[PERF] Scrape: Reduce native histogram scrape parsing allocations by \~49%. [#19282](prometheus/prometheus#19282)
- \[PERF] TSDB: Speed up queries on series with many in-memory chunks. [#18300](prometheus/prometheus#18300)
- \[BUGFIX] Alerting: Fix 100% CPU usage on shutdown that could delay graceful shutdown and trigger timeout-based kills. [#17859](prometheus/prometheus#17859)
- \[BUGFIX] Discovery/AWS: Stop `promtool check config` from making AWS metadata service (IMDS) network calls when the `region` field is omitted in EC2, ECS, RDS, MSK, ElastiCache, and Lightsail service discovery configs. [#19037](prometheus/prometheus#19037)
- \[BUGFIX] Discovery/Docker: Set a request timeout for `docker_sd` and `dockerswarm_sd` on `unix`, `npipe`, and `tcp` hosts. Previously an unresponsive daemon could freeze discovery indefinitely, silently pinning targets to a stale snapshot. [#19237](prometheus/prometheus#19237)
- \[BUGFIX] Discovery/Docker: Fix panic in Docker Swarm service discovery when a service runs as a plugin or network-attachment. [#19102](prometheus/prometheus#19102)
- \[BUGFIX] Discovery/Docker: Fix discovery of IPv6-only containers. [#18778](prometheus/prometheus#18778)
- \[BUGFIX] PromQL: Fix case-insensitive regex label matchers silently dropping matching values. [#19167](prometheus/prometheus#19167)
- \[BUGFIX] PromQL: Fix `mad_over_time` returning 0 instead of `NaN` when the range contains a `NaN` sample. [#19040](prometheus/prometheus#19040)
- \[BUGFIX] Promtool: Accept `--enable-feature=promql-binop-fill-modifiers` in `check rules`, which previously rejected valid `fill()`/`fill_left()`/`fill_right()` expressions. [#19153](prometheus/prometheus#19153)
- \[BUGFIX] Remote write: Respect the `AZURE_FEDERATED_TOKEN_FILE` environment variable for workload identity authentication instead of hardcoding the token file path. [#18973](prometheus/prometheus#18973)
- \[BUGFIX] Rules: Clean up stale `rule_group_last_rule_duration_sum_seconds` and `rule_group_last_restore_duration_seconds` series when a rule group is removed or renamed on reload. Previously each reload leaked two series per dropped group, growing `/metrics` cardinality over time. [#19107](prometheus/prometheus#19107)
- \[BUGFIX] Scrape: Fix scrape manager spinning at 100% CPU on shutdown. [#19149](prometheus/prometheus#19149)
- \[BUGFIX] TSDB: Fix silent data loss and potential crash loop when `stale_series_compaction_threshold` is used in the config file. [#19016](prometheus/prometheus#19016)
- \[BUGFIX] TSDB: Fix potential data loss on restart when out-of-order ingestion is enabled and blocks are compacted. [#19016](prometheus/prometheus#19016)
- \[BUGFIX] TSDB: Fix `prometheus_tsdb_head_stale_series` over-counting and early eviction of series that change between float, integer histogram, and float histogram sample types. [#19183](prometheus/prometheus#19183)
- \[BUGFIX] TSDB: Fix goroutine and file handle leaks when Prometheus fails to open a corrupt TSDB. On Windows, the leaked directory handle also prevented TSDB directory removal. [#18291](prometheus/prometheus#18291)
- \[BUGFIX] TSDB: Fix out-of-order queries blocking compaction for hours, causing memory usage to grow. [#19013](prometheus/prometheus#19013)
- \[BUGFIX] TSDB: Fix deleted series causing missing samples and errors after restart. [#19140](prometheus/prometheus#19140)
- \[BUGFIX] TSDB: Fix native histogram data becoming incorrect after restart. [#19202](prometheus/prometheus#19202)
- \[BUGFIX] TSDB: Surface query errors that were previously silently discarded. [#19120](prometheus/prometheus#19120)
- \[BUGFIX] TSDB: Honour the configured float chunk encoding when compaction rewrites chunks; previously chunks encoded with `--enable-feature=xor2-encoding` could silently revert to XOR after compaction. [#19145](prometheus/prometheus#19145)
- \[BUGFIX] UI: Show the delete-series form on the TSDB Status page when `--web.enable-admin-api` is enabled. [#19025](prometheus/prometheus#19025)
renovate Bot added a commit to sdwilsh/ansible-playbooks that referenced this pull request Aug 22, 2026
##### [\`v3.14.0\`](https://github.com/prometheus/prometheus/releases/tag/v3.14.0)

- \[CHANGE] API: Deprecate the `stats` query parameter of `/api/v1/query` and `/api/v1/query_range` for values other than `true` and `all`. Other values still enable basic statistics but now return a deprecation warning; they will be rejected in the next major release. [#19124](prometheus/prometheus#19124)
- \[CHANGE] API: `/api/v1/status/config` now correctly shows `separator: ""` and `replacement: ""` in relabel configs when explicitly set to empty, instead of omitting them. [#18653](prometheus/prometheus#18653)
- \[CHANGE] Discovery/Hetzner: Drop the `__meta_hetzner_datacenter` label for `hcloud` targets, following its removal from the Hetzner Cloud API. [#19269](prometheus/prometheus#19269)
- \[CHANGE] PromQL: Enable duration expressions by default. The `promql-duration-expr` feature flag is now a no-op. [#19033](prometheus/prometheus#19033)
- \[CHANGE] PromQL: Promote `first_over_time` to stable. It no longer requires the `promql-experimental-functions` feature flag. [#19093](prometheus/prometheus#19093)
- \[FEATURE] Discovery: Add Oracle Cloud Infrastructure compute service discovery (`oci_sd_configs`). [#18919](prometheus/prometheus#18919)
- \[FEATURE] PromQL: Add experimental `start_timestamp(instant-vector)` function returning the start timestamp of each sample in the given vector. Requires the `use-start-timestamps` feature flag. [#19089](prometheus/prometheus#19089)
- \[FEATURE] PromQL: Allow `rate()` and `increase()` to use start timestamps as an alternative for rate extrapolation. Hidden behind the `use-start-timestamps` feature flag. [#18619](prometheus/prometheus#18619)
- \[FEATURE] TSDB: Add experimental support for encoding start timestamps in histograms and float histograms. Hidden behind the `histograms-st-encoding` feature flag. [#18609](prometheus/prometheus#18609)
- \[ENHANCEMENT] OTLP: Emit a warning when OTLP attribute names collide into the same Prometheus label after sanitization (e.g. `k8s.pod.name` and `k8s_pod_name` both become `k8s_pod_name`), and expose the `prometheus_api_otlp_translation_warnings_total` counter labelled by `category` to track such warnings. [#18957](prometheus/prometheus#18957)
- \[ENHANCEMENT] Promtool: Add `--remote-write.path` flag to `push metrics` for backends that use a non-default remote-write endpoint. [#19086](prometheus/prometheus#19086)
- \[ENHANCEMENT] Remote write: Forward histogram start timestamps in the remote write V2 protocol. [#18903](prometheus/prometheus#18903)
- \[ENHANCEMENT] TSDB: Add `prometheus_tsdb_head_native_histogram_series` and `prometheus_tsdb_head_native_histogram_buckets` gauges tracking the number of native histogram series and buckets in the head. [#19170](prometheus/prometheus#19170)
- \[ENHANCEMENT] UI: Add syntax highlighting, autocompletion, and linting for PromQL duration expressions (`step()`, `range()`, `min_of()`, `max_of()`) in range selectors and subqueries. [#18625](prometheus/prometheus#18625)
- \[ENHANCEMENT] UI: Add copy button next to rule names on the Rules and Alerts pages. [#18706](prometheus/prometheus#18706)
- \[ENHANCEMENT] UI: Improve rule group title contrast on the Rules page. [#19181](prometheus/prometheus#19181)
- \[PERF] Speed up regex label matchers matching a set of literal values (e.g. `{job=~"foo|bar|baz"}`). [#18833](prometheus/prometheus#18833)
- \[PERF] Remote read: Improve remote read throughput by removing unnecessary per-write flushing. [#18470](prometheus/prometheus#18470)
- \[PERF] Scrape: Parse text and OpenMetrics formats without recursion, preventing stack overflow from deeply nested or malicious exposition input. [#19143](prometheus/prometheus#19143)
- \[PERF] Scrape: Reduce native histogram scrape parsing allocations by \~49%. [#19282](prometheus/prometheus#19282)
- \[PERF] TSDB: Speed up queries on series with many in-memory chunks. [#18300](prometheus/prometheus#18300)
- \[BUGFIX] Alerting: Fix 100% CPU usage on shutdown that could delay graceful shutdown and trigger timeout-based kills. [#17859](prometheus/prometheus#17859)
- \[BUGFIX] Discovery/AWS: Stop `promtool check config` from making AWS metadata service (IMDS) network calls when the `region` field is omitted in EC2, ECS, RDS, MSK, ElastiCache, and Lightsail service discovery configs. [#19037](prometheus/prometheus#19037)
- \[BUGFIX] Discovery/Docker: Set a request timeout for `docker_sd` and `dockerswarm_sd` on `unix`, `npipe`, and `tcp` hosts. Previously an unresponsive daemon could freeze discovery indefinitely, silently pinning targets to a stale snapshot. [#19237](prometheus/prometheus#19237)
- \[BUGFIX] Discovery/Docker: Fix panic in Docker Swarm service discovery when a service runs as a plugin or network-attachment. [#19102](prometheus/prometheus#19102)
- \[BUGFIX] Discovery/Docker: Fix discovery of IPv6-only containers. [#18778](prometheus/prometheus#18778)
- \[BUGFIX] PromQL: Fix case-insensitive regex label matchers silently dropping matching values. [#19167](prometheus/prometheus#19167)
- \[BUGFIX] PromQL: Fix `mad_over_time` returning 0 instead of `NaN` when the range contains a `NaN` sample. [#19040](prometheus/prometheus#19040)
- \[BUGFIX] Promtool: Accept `--enable-feature=promql-binop-fill-modifiers` in `check rules`, which previously rejected valid `fill()`/`fill_left()`/`fill_right()` expressions. [#19153](prometheus/prometheus#19153)
- \[BUGFIX] Remote write: Respect the `AZURE_FEDERATED_TOKEN_FILE` environment variable for workload identity authentication instead of hardcoding the token file path. [#18973](prometheus/prometheus#18973)
- \[BUGFIX] Rules: Clean up stale `rule_group_last_rule_duration_sum_seconds` and `rule_group_last_restore_duration_seconds` series when a rule group is removed or renamed on reload. Previously each reload leaked two series per dropped group, growing `/metrics` cardinality over time. [#19107](prometheus/prometheus#19107)
- \[BUGFIX] Scrape: Fix scrape manager spinning at 100% CPU on shutdown. [#19149](prometheus/prometheus#19149)
- \[BUGFIX] TSDB: Fix silent data loss and potential crash loop when `stale_series_compaction_threshold` is used in the config file. [#19016](prometheus/prometheus#19016)
- \[BUGFIX] TSDB: Fix potential data loss on restart when out-of-order ingestion is enabled and blocks are compacted. [#19016](prometheus/prometheus#19016)
- \[BUGFIX] TSDB: Fix `prometheus_tsdb_head_stale_series` over-counting and early eviction of series that change between float, integer histogram, and float histogram sample types. [#19183](prometheus/prometheus#19183)
- \[BUGFIX] TSDB: Fix goroutine and file handle leaks when Prometheus fails to open a corrupt TSDB. On Windows, the leaked directory handle also prevented TSDB directory removal. [#18291](prometheus/prometheus#18291)
- \[BUGFIX] TSDB: Fix out-of-order queries blocking compaction for hours, causing memory usage to grow. [#19013](prometheus/prometheus#19013)
- \[BUGFIX] TSDB: Fix deleted series causing missing samples and errors after restart. [#19140](prometheus/prometheus#19140)
- \[BUGFIX] TSDB: Fix native histogram data becoming incorrect after restart. [#19202](prometheus/prometheus#19202)
- \[BUGFIX] TSDB: Surface query errors that were previously silently discarded. [#19120](prometheus/prometheus#19120)
- \[BUGFIX] TSDB: Honour the configured float chunk encoding when compaction rewrites chunks; previously chunks encoded with `--enable-feature=xor2-encoding` could silently revert to XOR after compaction. [#19145](prometheus/prometheus#19145)
- \[BUGFIX] UI: Show the delete-series form on the TSDB Status page when `--web.enable-admin-api` is enabled. [#19025](prometheus/prometheus#19025)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants