Commit graph

17623 commits

Author SHA1 Message Date
György Krajcsovits
db46de3dcb
feat(api): add histogram_format=native to query endpoints
Add a new optional histogram_format query parameter to /api/v1/query
and /api/v1/query_range. When set to native, native histograms in the
JSON response are emitted in a schema-aware shape.

For exponential schemas:

  {
    "count":          "<count>",
    "sum":            "<sum>",
    "schema":         <int>,
    "zero_threshold": "<threshold>",
    "zero_count":     "<count>",                       // when non-zero
    "negative_buckets": [ [ <index>, "<count>" ], ... ], // when non-empty
    "buckets":          [ [ <index>, "<count>" ], ... ]  // when non-empty
  }

zero_threshold is always emitted because, together with schema, it
fully describes the bucket layout. The negative/positive bucket
arrays carry the schema-defined bucket index and count, so empty
buckets that fall between non-empty ones are not transmitted.

For custom-bucket histograms (schema -53):

  {
    "count":      "<count>",
    "sum":        "<sum>",
    "schema":     -53,
    "boundaries": [ "<upper_bound>", ... ],
    "buckets":    [ [ <index>, "<count>" ], ... ]
  }

boundaries lists the bucket upper bounds; each bucket entry's index
is the 0-based index into boundaries.

This lets clients that already understand the schema (e.g. Grafana
rendering NHCB heatmaps) reconstruct every bucket including empty
custom-bucket slots, and is also substantially more compact than the
boundary-based representation for histograms with many buckets.

The existing boundary-based representation is unchanged when
histogram_format is absent or set to any other value.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2026-05-22 19:13:40 +02:00
Julien
891e698992
Merge pull request #18740 from roidelapluie/roidelapluie/snapshot-explicit-encoding-cases
Some checks failed
buf.build / lint and publish (push) Has been cancelled
CI / Go tests (push) Has been cancelled
CI / More Go tests (push) Has been cancelled
CI / Go tests for 32-bit x86 (push) Has been cancelled
CI / Go tests for Prometheus upgrades and downgrades (push) Has been cancelled
CI / Go tests with previous Go version (push) Has been cancelled
CI / UI tests (push) Has been cancelled
CI / Go tests on Windows (push) Has been cancelled
CI / Mixins tests (push) Has been cancelled
CI / Compliance testing (push) Has been cancelled
CI / Build Prometheus for common architectures (push) Has been cancelled
CI / Build Prometheus for all architectures (push) Has been cancelled
CI / Check generated parser (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
CI / fuzzing (push) Has been cancelled
CI / codeql (push) Has been cancelled
govulncheck / Run govulncheck (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CI / Report status of build Prometheus for all architectures (push) Has been cancelled
CI / Publish main branch artifacts (push) Has been cancelled
CI / Publish release artefacts (push) Has been cancelled
CI / Publish UI on npm Registry (push) Has been cancelled
tsdb: replace default encoding cases with explicit cases in snapshot encode/decode
2026-05-21 14:02:40 +02:00
Julien Pivotto
fae25e1405 tsdb: replace default encoding cases with explicit cases in snapshot encode/decode
Replace the catch-all default branch in encodeToSnapshotRecord and
decodeSeriesFromChunkSnapshot with an explicit EncFloatHistogram case and a
default that panics (encode) or returns an error (decode), making unknown
encodings immediately visible rather than silently mishandling them.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-21 12:47:55 +02:00
Julien
aa260fcde5
Merge pull request #18687 from roidelapluie/roidelapluie/greatest_least
Duration expression: Rename min/max -> min_of, max_of
2026-05-21 10:34:29 +02:00
Julien
faca2f0325
Merge pull request #18744 from prometheus/deps-update/github.com-hashicorp-nomad-api-digest
Update github.com/hashicorp/nomad/api digest to afe1ed5
2026-05-21 09:56:37 +02:00
Owen Williams
5fe52643a0
tsdb: Rewrite TestCancelCompactions to run faster (#18632)
* Rewrite TestCancelCompactions to run faster

---------

Signed-off-by: Owen Williams <owen.williams@grafana.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2026-05-21 09:06:10 +02:00
renovate[bot]
a6ff96a2bc
Update github.com/hashicorp/nomad/api digest to afe1ed5 2026-05-21 02:07:28 +00:00
Julien
0f5727f420
tsdb: count EncXOR2 chunks as float samples; fix snapshot encoding (#18739)
Some checks are pending
buf.build / lint and publish (push) Waiting to run
CI / Go tests (push) Waiting to run
CI / More Go tests (push) Waiting to run
CI / Go tests for 32-bit x86 (push) Waiting to run
CI / Go tests for Prometheus upgrades and downgrades (push) Waiting to run
CI / Go tests with previous Go version (push) Waiting to run
CI / UI tests (push) Waiting to run
CI / Go tests on Windows (push) Waiting to run
CI / Mixins tests (push) Waiting to run
CI / Compliance testing (push) Waiting to run
CI / Build Prometheus for common architectures (push) Waiting to run
CI / Build Prometheus for all architectures (push) Waiting to run
CI / Report status of build Prometheus for all architectures (push) Blocked by required conditions
CI / Check generated parser (push) Waiting to run
CI / golangci-lint (push) Waiting to run
CI / fuzzing (push) Waiting to run
CI / codeql (push) Waiting to run
CI / Publish main branch artifacts (push) Blocked by required conditions
CI / Publish release artefacts (push) Blocked by required conditions
CI / Publish UI on npm Registry (push) Blocked by required conditions
govulncheck / Run govulncheck (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
EncXOR2 is a float encoding and must be treated like EncXOR in all
places that enumerate chunk types:

- compact.go: NumFloatSamples was not incremented for EncXOR2 chunks
  during compaction, leading to under-reported block stats.
- head_wal.go: encodeToSnapshotRecord fell through to the default
  (FloatHistogram) branch for EncXOR2 head chunks, which would corrupt
  chunk snapshots; the decode path already handled EncXOR2 correctly.
- ooo_head.go: update stale comment to mention EncXOR2.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-20 15:20:37 +00:00
Julien
ea787c89cb
Ensure that Query is closed for rules evaluations (#18733)
Some checks are pending
buf.build / lint and publish (push) Waiting to run
CI / Go tests (push) Waiting to run
CI / More Go tests (push) Waiting to run
CI / Go tests for 32-bit x86 (push) Waiting to run
CI / Go tests for Prometheus upgrades and downgrades (push) Waiting to run
CI / Go tests with previous Go version (push) Waiting to run
CI / UI tests (push) Waiting to run
CI / Go tests on Windows (push) Waiting to run
CI / Mixins tests (push) Waiting to run
CI / Compliance testing (push) Waiting to run
CI / Build Prometheus for common architectures (push) Waiting to run
CI / Build Prometheus for all architectures (push) Waiting to run
CI / Report status of build Prometheus for all architectures (push) Blocked by required conditions
CI / Check generated parser (push) Waiting to run
CI / golangci-lint (push) Waiting to run
CI / fuzzing (push) Waiting to run
CI / codeql (push) Waiting to run
CI / Publish main branch artifacts (push) Blocked by required conditions
CI / Publish release artefacts (push) Blocked by required conditions
CI / Publish UI on npm Registry (push) Blocked by required conditions
govulncheck / Run govulncheck (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
Signed-off-by: Andrew Hall <andrew.hall@grafana.com>
2026-05-20 10:11:24 +02:00
Andrew Hall
7659b8898b Ensure that Query is closed for rules evaluations
Signed-off-by: Andrew Hall <andrew.hall@grafana.com>
2026-05-20 14:43:21 +08:00
Julien
0df8ce7ac9
web/api: reject 0 for limit and batch_size in search endpoints (#18724)
Some checks are pending
buf.build / lint and publish (push) Waiting to run
CI / Go tests (push) Waiting to run
CI / More Go tests (push) Waiting to run
CI / Go tests for 32-bit x86 (push) Waiting to run
CI / Go tests for Prometheus upgrades and downgrades (push) Waiting to run
CI / Go tests with previous Go version (push) Waiting to run
CI / UI tests (push) Waiting to run
CI / Go tests on Windows (push) Waiting to run
CI / Mixins tests (push) Waiting to run
CI / Compliance testing (push) Waiting to run
CI / Build Prometheus for common architectures (push) Waiting to run
CI / Build Prometheus for all architectures (push) Waiting to run
CI / Report status of build Prometheus for all architectures (push) Blocked by required conditions
CI / Check generated parser (push) Waiting to run
CI / golangci-lint (push) Waiting to run
CI / fuzzing (push) Waiting to run
CI / codeql (push) Waiting to run
CI / Publish main branch artifacts (push) Blocked by required conditions
CI / Publish release artefacts (push) Blocked by required conditions
CI / Publish UI on npm Registry (push) Blocked by required conditions
govulncheck / Run govulncheck (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
* web/api: reject 0 for limit and batch_size in search endpoints

Treat 0 as invalid for limit and batch_size query parameters; clients
must supply a positive integer or omit the parameter to use the server
default of 100. Update OpenAPI descriptions accordingly.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>

* Update web/api/v1/openapi.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Signed-off-by: Julien <291750+roidelapluie@users.noreply.github.com>

---------

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
Signed-off-by: Julien <291750+roidelapluie@users.noreply.github.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2026-05-19 15:05:45 +00:00
Jyotishmoy Deka
300b4f495b
web/ui: fix lezer-promql module build on Windows (#18725)
Signed-off-by: jyotishmoy12 <jyotishmoydeka62@gmail.com>
2026-05-19 15:50:28 +02:00
Ogulcan Aydogan
4f9db4d29e
discovery/marathon: run tests in parallel (#18613)
Some checks are pending
buf.build / lint and publish (push) Waiting to run
CI / Go tests (push) Waiting to run
CI / More Go tests (push) Waiting to run
CI / Go tests for 32-bit x86 (push) Waiting to run
CI / Go tests for Prometheus upgrades and downgrades (push) Waiting to run
CI / Go tests with previous Go version (push) Waiting to run
CI / UI tests (push) Waiting to run
CI / Go tests on Windows (push) Waiting to run
CI / Mixins tests (push) Waiting to run
CI / Compliance testing (push) Waiting to run
CI / Build Prometheus for common architectures (push) Waiting to run
CI / Build Prometheus for all architectures (push) Waiting to run
CI / Report status of build Prometheus for all architectures (push) Blocked by required conditions
CI / Check generated parser (push) Waiting to run
CI / golangci-lint (push) Waiting to run
CI / fuzzing (push) Waiting to run
CI / codeql (push) Waiting to run
CI / Publish main branch artifacts (push) Blocked by required conditions
CI / Publish release artefacts (push) Blocked by required conditions
CI / Publish UI on npm Registry (push) Blocked by required conditions
govulncheck / Run govulncheck (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
Add t.Parallel() to the 13 top-level test functions in marathon_test.go.
Tests have no shared mutable state — each test creates its own registry,
metrics, and config — so parallelisation is safe and speeds up the suite.

Refs #15185

Signed-off-by: Ogulcan Aydogan <ogulcanaydogan@hotmail.com>
2026-05-19 14:04:03 +02:00
Ogulcan Aydogan
e01be38010
discovery/consul: run tests in parallel (#18611)
Each test creates its own httptest.Server and prometheus.Registry so
there is no shared global state between them. Adding t.Parallel() to
all 13 top-level test functions and the subtests in TestUnmarshalConfig
allows the Go test runner to overlap them, cutting wall-clock time.

Refs: #15185

Signed-off-by: Ogulcan Aydogan <ogulcanaydogan@hotmail.com>
2026-05-19 14:01:50 +02:00
Julien
e1f4380b2a
web/api: add search API endpoint (#18573)
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-19 13:58:00 +02:00
quyentonndbs
ee7fea7f14
docs: fix duplicated word in lookback parameter docs (#18686)
Signed-off-by: Kai Tanaka <275430420+quyentonndbs@users.noreply.github.com>
Co-authored-by: Kai Tanaka <275430420+quyentonndbs@users.noreply.github.com>
2026-05-19 13:25:53 +02:00
Julien Pivotto
a74f0b2e7a PromQL: Rename greatest, least, to max_of, min_of.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-19 13:07:16 +02:00
Julien
e3055ac41e
Merge pull request #18722 from roidelapluie/roidelapluie/guard-nil-funcall
promql: guard against nil function call in eval
2026-05-19 11:59:44 +02:00
Julien
141e0c00c7
Merge pull request #18576 from roidelapluie/roidelapluie/subsequence-rank
strutil/subsequence: rank exact matches above non-exact matches
2026-05-19 11:37:51 +02:00
Julien Pivotto
fbf32e349d promql: guard against nil function call in eval
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-19 11:35:44 +02:00
Julien
3e6f1cad54
Merge pull request #18688 from roidelapluie/roidelapluie/cleanup-funcmap
chore(promql): replace funcQueryContext with nil in FunctionCalls map
2026-05-19 11:04:45 +02:00
Bartlomiej Plotka
3fcd5e8d00
Merge pull request #18719 from prometheus/revert-18702-cut-3.12
Revert "chore: prepare 3.12.0-rc.0 release"
2026-05-19 09:42:07 +02:00
Bartlomiej Plotka
2a146bce7f
Revert "chore: prepare 3.12.0-rc.0 release" 2026-05-19 08:40:18 +01:00
Bartlomiej Plotka
d604966b9b
Merge pull request #18702 from prometheus/cut-3.12
chore: prepare 3.12.0-rc.0 release
2026-05-19 08:38:46 +02:00
Julien
06b569ae2a
Merge pull request #18564 from roidelapluie/roidelapluie/smoothed-histogram
Some checks are pending
buf.build / lint and publish (push) Waiting to run
CI / Go tests (push) Waiting to run
CI / More Go tests (push) Waiting to run
CI / Go tests for 32-bit x86 (push) Waiting to run
CI / Go tests for Prometheus upgrades and downgrades (push) Waiting to run
CI / Go tests with previous Go version (push) Waiting to run
CI / UI tests (push) Waiting to run
CI / Go tests on Windows (push) Waiting to run
CI / Mixins tests (push) Waiting to run
CI / Compliance testing (push) Waiting to run
CI / Build Prometheus for common architectures (push) Waiting to run
CI / Build Prometheus for all architectures (push) Waiting to run
CI / Report status of build Prometheus for all architectures (push) Blocked by required conditions
CI / Check generated parser (push) Waiting to run
CI / golangci-lint (push) Waiting to run
CI / fuzzing (push) Waiting to run
CI / codeql (push) Waiting to run
CI / Publish main branch artifacts (push) Blocked by required conditions
CI / Publish release artefacts (push) Blocked by required conditions
CI / Publish UI on npm Registry (push) Blocked by required conditions
govulncheck / Run govulncheck (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
promql: support native histograms with smoothed/anchored rate
2026-05-18 16:32:40 +02:00
Julien Pivotto
12db0a8456 chore: Fix formatting
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-18 15:50:45 +02:00
Julien Pivotto
04c35bfd27 promql: document schema-reduction asymmetry between histogramRate and extendedHistogramRate
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-18 15:48:50 +02:00
Julien Pivotto
9c69447bd7 promql: address review findings for smoothed/anchored histogram rate
- Fix copy-paste bug: smoothed branch in bare MatrixSelector eval now
  says "smoothed modifier is not supported with histograms" instead of
  "anchored".
- Change annosFromInterpolationError to take *annotations.Annotations,
  consistent with all other histogram helper functions.
- Rename delta to result in interpolateHistograms to avoid the misleading
  name (the variable holds the interpolated result, not a delta).
- Fix extendedRate doc comment: interpolates at boundaries, not
  extrapolates.
- Fix stale comment in correctForCounterResetsHistogram that referenced
  the nonexistent variable leftInterpolationHandledReset.
- Add comment explaining why right.Copy() is not redundant in
  extendedHistogramRate.
- Hoist s.Labels().Get(labels.MetricName) out of the per-step loop in
  smoothSeries; was called up to three times per step.
- Reset CounterResetHint to UnknownCounterReset on carry-forward
  histograms in smoothSeries; a Reset hint at a new timestamp is
  semantically misleading.
- Add TestInterpolateHistograms unit test covering exact-match, midpoint,
  counter, reset, and quarter-point cases.
- Add rate(hist_counter[1m] anchored) test.
- Add delta(hist_counter[1m] anchored/smoothed) tests with
  NativeHistogramNotGaugeWarning assertions.
- Add carry-forward test for smoothed vector selector.
- Add range eval test for rate(hist_counter[1m] smoothed).
- Add right-boundary reset interpolation test (right_boundary_reset).
- Fix stale test comment about "prev initialPrev path".

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-18 15:33:08 +02:00
Bartlomiej Plotka
611e744354
Apply suggestions from code review
Co-authored-by: Julien <291750+roidelapluie@users.noreply.github.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2026-05-18 13:30:07 +01:00
Bartlomiej Plotka
cb085a6281
Merge pull request #18703 from ogulcanaydogan/test/discovery-aws-parallel
discovery/aws: run tests in parallel
2026-05-18 14:24:16 +02:00
Bartlomiej Plotka
ccf503efe6
Merge pull request #18629 from prometheus/owilliams/flakefix
tsdb: fix init race that lets initialized() return true before maxTime is set
2026-05-18 14:21:59 +02:00
Bartlomiej Plotka
9a7d46e8b9
Merge pull request #18714 from prometheus/386flakiness
tests: split 32bit x86 tests to a separate job with parallel=1
2026-05-18 13:33:33 +02:00
bwplotka
ab5bb81532 tests: split 32bit x86 tests to a separate job with parallel=1
Signed-off-by: bwplotka <bwplotka@gmail.com>
2026-05-18 12:22:00 +01:00
bwplotka
bc598efafc improve generate_release_notes to skip author for consistency
Signed-off-by: bwplotka <bwplotka@gmail.com>
2026-05-18 12:14:36 +01:00
bwplotka
a987aef460 tests: split 32bit x86 tests to a separate job with parallel=1
Signed-off-by: bwplotka <bwplotka@gmail.com>
2026-05-18 12:07:18 +01:00
bwplotka
120808811e fixed changelog.
Signed-off-by: bwplotka <bwplotka@gmail.com>
2026-05-18 11:44:04 +01:00
Julien Pivotto
7af21f195c promql: add least() and greatest() scalar functions
Implement least(a, b) and greatest(a, b) as scalar-returning PromQL
functions backed by math.Min and math.Max respectively.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-18 11:15:31 +02:00
Julien Pivotto
ef264fdf97 promql: merge innerHistogramBounds into correctForCounterResetsHistogram
The previous split required callers to compute the inner slice before
calling correctForCounterResetsHistogram, which led to a bug where
h[lastSampleIndex] could be double-counted when it carries a reset hint
that equals the right boundary value.

Merge the boundary logic into correctForCounterResetsHistogram so the
function owns its own loop range, always excludes lastSampleIndex from
the inner loop, and initialises prev to h[firstSampleIndex+1] when the
left-boundary interpolation already spanned the first reset.

Add regression tests covering: reset at the last sample, two-sample
anchored windows, double-reset in smoothed mode, and the two-sample
smoothed window where both boundaries are interpolated from the same
reset segment.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-18 11:00:57 +02:00
bwplotka
fc3647f613 fix changelog.md
Signed-off-by: bwplotka <bwplotka@gmail.com>
2026-05-15 17:17:23 +01:00
Ogulcan Aydogan
1d1b670c40
discovery/aws: run tests in parallel
Each test function creates its own mock AWS client and operates on
independent data stores with no shared global state between them.
Adding t.Parallel() to the 33 top-level test functions across the
six test files (aws, ec2, ecs, elasticache, msk, rds) allows the
Go test runner to overlap their execution, cutting wall-clock time.

TestLoadRegion is excluded because its subtests use t.Setenv, which
panics when a parallel ancestor is detected (Go 1.25+).

Refs: #15185
Signed-off-by: Ogulcan Aydogan <ogulcanaydogan@hotmail.com>
2026-05-15 13:45:20 +01:00
Arve Knudsen
43e5fc6a24
perf(tsdb): inline oversize-chunk check in populateChunksFromIterable (#18699)
Some checks failed
buf.build / lint and publish (push) Has been cancelled
CI / Go tests (push) Has been cancelled
CI / More Go tests (push) Has been cancelled
CI / Go tests for Prometheus upgrades and downgrades (push) Has been cancelled
CI / Go tests with previous Go version (push) Has been cancelled
CI / UI tests (push) Has been cancelled
CI / Go tests on Windows (push) Has been cancelled
CI / Mixins tests (push) Has been cancelled
CI / Compliance testing (push) Has been cancelled
CI / Build Prometheus for common architectures (push) Has been cancelled
CI / Build Prometheus for all architectures (push) Has been cancelled
CI / Check generated parser (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
CI / fuzzing (push) Has been cancelled
CI / codeql (push) Has been cancelled
govulncheck / Run govulncheck (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CI / Report status of build Prometheus for all architectures (push) Has been cancelled
CI / Publish main branch artifacts (push) Has been cancelled
CI / Publish release artefacts (push) Has been cancelled
CI / Publish UI on npm Registry (push) Has been cancelled
The oversize-chunk trigger introduced in #18692 was implemented as a
closure defined inside the per-sample loop in
populateChunksFromIterable and invoked once at the `if` condition.
Replace it with a plain conditional and hoist
`len(currentChunk.Bytes())` out of the switch so the two encoding
cases don't repeat the same expression. The new shape preserves the
original `||` short-circuit: the size check is only evaluated when
neither the encoding nor the start-timestamp capability forces a new
chunk, which also keeps `currentChunk` non-nil at the point of read.

`gcflags=-m=2` reports the closure body inlined and the symbol table
shows no separate `func1` symbol, yet benchstat shows a measurable
speedup. The most likely explanation: the closure body inlines, but
the `funcval` struct (capturing `currentChunk` and `currentValueType`)
is still stack-constructed each iteration — invisible to escape
analysis, but a real per-iteration cost in a hot loop.

Benchmark, `go test -count=6 -benchmem -bench=BenchmarkQuerierSelectWithOutOfOrder -benchtime=5s -run=^$ ./tsdb/`,
Intel Xeon Platinum 8280 @ 2.70 GHz (linux/amd64), 1M-series head,
query selectivity varies:

                                          │   main      │           optimized                │
                                          │   sec/op    │    sec/op    vs base               │
Head/1of1000000-16                          301.5m ± 4%   257.0m ±  4%  -14.74% (p=0.002 n=6)
Head/10of1000000-16                         305.6m ± 3%   260.4m ±  2%  -14.80% (p=0.002 n=6)
Head/100of1000000-16                        303.9m ± 2%   259.7m ±  2%  -14.54% (p=0.002 n=6)
Head/1000of1000000-16                       303.8m ± 2%   267.0m ±  2%  -12.13% (p=0.002 n=6)
Head/10000of1000000-16                      318.1m ± 1%   278.9m ±  8%  -12.33% (p=0.002 n=6)
Head/100000of1000000-16                     364.1m ± 7%   352.8m ±  4%        ~ (p=0.065 n=6)
Head/1000000of1000000-16                     1.115 ± 2%    1.089 ± 26%        ~ (p=0.394 n=6)
geomean                                     377.8m        337.3m        -10.71%

allocs/op and B/op unchanged. The two largest-selectivity cases trend
faster but are dominated by the per-sample append cost so the relative
delta is smaller and lost in variance.

`TestChunkQuerier_OverlappingInOrderAndOOOChunks` continues to
exercise the overflow path.

```release-notes
NONE
```

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2026-05-15 11:40:31 +00:00
bwplotka
981aadfb02 make ui-bump-version
Signed-off-by: bwplotka <bwplotka@gmail.com>
2026-05-15 11:28:16 +01:00
bwplotka
54e80a8664 chore: prepare 3.12.0-rc.0 release
Signed-off-by: bwplotka <bwplotka@gmail.com>
2026-05-15 11:27:35 +01:00
Julius Volz
49cf97be7e
Merge pull request #18658 from officialasishkumar/fix-autocomplete-label-value-escaping
Some checks are pending
buf.build / lint and publish (push) Waiting to run
CI / Go tests (push) Waiting to run
CI / More Go tests (push) Waiting to run
CI / Go tests for Prometheus upgrades and downgrades (push) Waiting to run
CI / Go tests with previous Go version (push) Waiting to run
CI / UI tests (push) Waiting to run
CI / Go tests on Windows (push) Waiting to run
CI / Mixins tests (push) Waiting to run
CI / Compliance testing (push) Waiting to run
CI / Build Prometheus for common architectures (push) Waiting to run
CI / Build Prometheus for all architectures (push) Waiting to run
CI / Report status of build Prometheus for all architectures (push) Blocked by required conditions
CI / Check generated parser (push) Waiting to run
CI / golangci-lint (push) Waiting to run
CI / fuzzing (push) Waiting to run
CI / codeql (push) Waiting to run
CI / Publish main branch artifacts (push) Blocked by required conditions
CI / Publish release artefacts (push) Blocked by required conditions
CI / Publish UI on npm Registry (push) Blocked by required conditions
govulncheck / Run govulncheck (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
ui: escape label values in PromQL autocomplete
2026-05-15 07:45:48 +02:00
George Krajcsovits
8a9f4ff440
fix(tsdb): chunk overflow on ooo query (#18692)
Some checks are pending
buf.build / lint and publish (push) Waiting to run
CI / Go tests (push) Waiting to run
CI / More Go tests (push) Waiting to run
CI / Go tests for Prometheus upgrades and downgrades (push) Waiting to run
CI / Go tests with previous Go version (push) Waiting to run
CI / UI tests (push) Waiting to run
CI / Go tests on Windows (push) Waiting to run
CI / Mixins tests (push) Waiting to run
CI / Compliance testing (push) Waiting to run
CI / Build Prometheus for common architectures (push) Waiting to run
CI / Build Prometheus for all architectures (push) Waiting to run
CI / Report status of build Prometheus for all architectures (push) Blocked by required conditions
CI / Check generated parser (push) Waiting to run
CI / golangci-lint (push) Waiting to run
CI / fuzzing (push) Waiting to run
CI / codeql (push) Waiting to run
CI / Publish main branch artifacts (push) Blocked by required conditions
CI / Publish release artefacts (push) Blocked by required conditions
CI / Publish UI on npm Registry (push) Blocked by required conditions
govulncheck / Run govulncheck (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
* fix(tsdb): chunk overflow on ooo query

Protect against and fix overflow of chunks with more than 2^16-1 samples
in case we're recoding chunks due to for example in-order and ooo samples
overlap during compaction or query.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2026-05-14 22:22:52 +02:00
Asish Kumar
a21f58c2c0
test: expect label value completion apply text
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
2026-05-14 22:13:03 +05:30
Asish Kumar
0254e010b3
Address PromQL autocomplete review feedback
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
2026-05-14 22:11:04 +05:30
Asish Kumar
7c6bab8c58
ui: escape label values in PromQL autocomplete
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
2026-05-14 22:11:04 +05:30
Arve Knudsen
cf4505c6cd
tsdb: skip entire stripes in mmapHeadChunks via per-stripe ready count (#18541)
* tsdb: extract stripeSeries.refStripe helper

Extract the repeated ref-to-stripe-index calculation into a method on
stripeSeries, replacing five inline copies that used two different
casting styles (int and uint64). The helper computes with uint64
internally so it is correct on 32-bit architectures.

* tsdb: skip entire stripes in mmapHeadChunks via per-stripe ready count

Add a per-stripe mmapReady counter to stripeSeries that tracks how many
series in each stripe have headChunkCount >= 2 (i.e., are ready for
mmapping). mmapHeadChunks skips stripes where the counter is zero,
avoiding the RLock and map iteration entirely.

---------

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2026-05-14 18:24:56 +02:00
Bartlomiej Plotka
39580d86a1
Merge pull request #18279 from ridwanmsharif/feature/issue-14763-start-timestamp-synthesis
Some checks are pending
buf.build / lint and publish (push) Waiting to run
CI / Go tests (push) Waiting to run
CI / More Go tests (push) Waiting to run
CI / Go tests for Prometheus upgrades and downgrades (push) Waiting to run
CI / Go tests with previous Go version (push) Waiting to run
CI / UI tests (push) Waiting to run
CI / Go tests on Windows (push) Waiting to run
CI / Mixins tests (push) Waiting to run
CI / Compliance testing (push) Waiting to run
CI / Build Prometheus for common architectures (push) Waiting to run
CI / Build Prometheus for all architectures (push) Waiting to run
CI / Report status of build Prometheus for all architectures (push) Blocked by required conditions
CI / Check generated parser (push) Waiting to run
CI / golangci-lint (push) Waiting to run
CI / fuzzing (push) Waiting to run
CI / codeql (push) Waiting to run
CI / Publish main branch artifacts (push) Blocked by required conditions
CI / Publish release artefacts (push) Blocked by required conditions
CI / Publish UI on npm Registry (push) Blocked by required conditions
govulncheck / Run govulncheck (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
scrape: Add start timestamp synthesis for cumulative metrics in the scrape path.
2026-05-14 12:40:31 +02:00