17542 Commits

Author SHA1 Message Date
Owen Williams
9ec9b1e3c6
Comments to explain what's going on
Signed-off-by: Owen Williams <owen.williams@grafana.com>
2026-05-12 11:00:12 -04:00
Owen Williams
9e16c38214
Merge remote-tracking branch 'origin/main' into owilliams/flakefix 2026-05-12 10:42:09 -04:00
cui
54d4f527a0
textparse: fix NaN canonicalization check in OpenMetrics getFloatValue (#18399)
* textparse: fix NaN canonicalization check in OpenMetrics getFloatValue
* textparse: add tests for OpenMetrics summary NaN quantiles

getFloatValue was testing p.exemplarVal instead of the parsed float when normalizing NaN to the canonical representation, so metric values that were NaN were not normalized correctly.

Extend TestOpenMetricsParse with nansum summary lines and cmpopts.EquateNaNs in requireEntries so NaN float values compare equal after canonicalization.

Signed-off-by: Weixie Cui <cuiweixie@gmail.com>
Signed-off-by: cui <cuiweixie@gmail.com>
Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
2026-05-12 15:45:59 +02:00
Joe Adams
63f2bf9b9a
Merge pull request #16088 from rlees85/ipv6-only-ec2-sd
discovery: Allow EC2 Service Discovery to work with IPv6-only instances
2026-05-11 23:09:34 -04:00
renovate[bot]
a732c0793a
Update actions/upload-artifact action to v7 (#18674)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-11 18:11:18 +02:00
renovate[bot]
2ac56b3285
Update actions/setup-node action to v6.4.0 (#18671)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-11 18:10:52 +02:00
Bartlomiej Plotka
8da59ea03b
Merge pull request #18567 from ridwanmsharif/chore/staleness-diff-v2
scrape: fix staleness tracking for duplicate and out-of-order sample in AppenderV2
2026-05-11 17:45:34 +02:00
renovate[bot]
5cf214cf5e
Update actions/cache action to v5.0.5 (#18670)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-11 17:40:29 +02:00
Bartlomiej Plotka
5c16439c34
Merge pull request #18675 from prometheus/superq/more_renovate
Run Renovate twice a month
2026-05-11 17:06:02 +02:00
renovate[bot]
9ddc1fe475
Update github/codeql-action action to v4.35.4 (#18672)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-11 13:59:23 +00:00
Vilius Pranckaitis
129ee0d317
PromQL: resets() function considers start timestamp resets (#18627)
* PromQL: `resets()` function considers start timestamp resets

Signed-off-by: vpranckaitis <vpranckaitis@gmail.com>

* PR comment

Signed-off-by: vpranckaitis <vpranckaitis@gmail.com>

---------

Signed-off-by: vpranckaitis <vpranckaitis@gmail.com>
2026-05-11 15:50:36 +02:00
SuperQ
3b66ea611f
Run Renovate twice a month
Increase the frequency of Renovate to twice a month to keep up various
dependencies and avoid large drift.

Signed-off-by: SuperQ <superq@gmail.com>
2026-05-11 15:30:25 +02:00
Bartlomiej Plotka
c591287db3
Merge pull request #18642 from prometheus/upgrade3.12
chore: Upgrade Go deps before v3.12.0-rc.0
2026-05-11 13:43:41 +02:00
Bartlomiej Plotka
4b3323e413
Merge pull request #18660 from roidelapluie/roidelapluie/histogram-stats-schema
promql: set Schema in HistogramStatsIterator to detect schema mix
2026-05-11 13:11:40 +02:00
bwplotka
d36e9114cb chore: Upgrade Go deps
Signed-off-by: bwplotka <bwplotka@gmail.com>
2026-05-11 12:10:00 +01:00
Bartlomiej Plotka
24c06c068d
Merge pull request #18664 from prometheus/deps-update/go-github.com-prometheus-prometheus-vulnerability
Update module github.com/prometheus/prometheus to v0.311.3 [SECURITY]
2026-05-11 13:00:56 +02:00
Bartlomiej Plotka
42003b2e13
Merge pull request #18624 from roidelapluie/roidelapluie/dur-expr-in-parse-ast
web/api: emit duration expression trees
2026-05-11 12:59:41 +02:00
renovate[bot]
73844c223f
Update module github.com/prometheus/prometheus to v0.311.3 [SECURITY] 2026-05-11 10:20:11 +00:00
Julien Pivotto
51d7f024dd promql: set Schema in HistogramStatsIterator to detect schema mix
Without Schema being propagated in HistogramStatsIterator, histograms
served through the stats-only path (e.g. histogram_count(rate(...)))
all appear as Schema=0, causing the exponential/custom-bucket mismatch
detection to be silently skipped.

Add a test that exercises histogram_count(rate()) over a series with
mixed exponential and custom bucket schemas to verify the warning is
emitted.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-11 11:34:17 +02:00
Bartlomiej Plotka
6b07148046
Merge pull request #18628 from roidelapluie/roidelapluie/empty-dir-pc-duration
cmd/prometheus: allow retention percentage with new data path
2026-05-11 10:57:24 +02:00
Julien
ecab2f45a8
Merge pull request #18651 from roidelapluie/roidelapluie/fgprof-concurrency-limit
web: reject concurrent fgprof profiles with 500, aligning with pprof
2026-05-08 18:12:46 +02:00
Bartlomiej Plotka
db0c41410d
Merge pull request #18641 from prometheus/fix-tometadata-bounds-check-20260508
fix: check bounds on remote write receive when parsing symbolized metadata
2026-05-08 16:51:38 +01:00
Julien Pivotto
dd54642a47 web: reject concurrent fgprof profiles with 500, aligning with pprof
Add a mutex around the fgprof handler so that only one profile can
run at a time. A second concurrent request returns 500 with an error
message matching the pprof behaviour for CPU profiling already in use.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-08 17:41:27 +02:00
Bartlomiej Plotka
d3eb439eb6
Merge pull request #18643 from roidelapluie/roidelapluie/govulncheck
ci: restrict govulncheck PR runs
2026-05-08 16:12:34 +01:00
Bartlomiej Plotka
89cdc71788
Merge pull request #18649 from roidelapluie/roidelapluie/stackit
discovery/stackit: use config.Secret for ServiceAccountKey and Privatekey
2026-05-08 16:10:00 +01:00
Julien
7200c43796
Merge pull request #18647 from roidelapluie/roidelapluie/npm-3.12
chore: Update NPM deps for 3.12
2026-05-08 15:23:43 +02:00
Julien Pivotto
aa5927029e discovery/stackit: use config.Secret for ServiceAccountKey and PrivateKey
Fixes GHSA-39j6-789q-qxvh

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-08 15:16:54 +02:00
Julien
6299449664
Merge pull request #18639 from alexmchughdev/promql-duration-overflow-nan
promql: reject NaN/Inf and fix overflow bound in duration expressions
2026-05-08 14:18:56 +02:00
Julien Pivotto
64e465dddc chore: Update NPM deps for 3.12
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-08 13:59:50 +02:00
Julien
8c3cc3323c
Merge pull request #18646 from roidelapluie/roidelapluie/debugstatement
promql/parser: remove debug print statements from DurationExpr.Pretty
2026-05-08 13:43:27 +02:00
Julien Pivotto
a133c21326 promql/parser: remove debug print statements from DurationExpr.Pretty
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-08 13:13:34 +02:00
Julien Pivotto
a7fb856707 ci: restrict govulncheck PR runs
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-08 12:11:56 +02:00
Julien
21dc203599
Merge pull request #18578 from ProjectMutilation/promql-fix-potential-panic
promql: prevent nil pointer dereference in DurationExpr.PositionRange
2026-05-08 11:39:27 +02:00
bwplotka
1ae1172598 typo
Signed-off-by: bwplotka <bwplotka@gmail.com>
2026-05-08 10:18:42 +01:00
Bartlomiej Plotka
ef01f33a03
Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2026-05-08 10:17:57 +01:00
bwplotka
38ccf6e7fe fix: check bounds on remote write receive when parsing symbolized metadata
Signed-off-by: bwplotka <bwplotka@gmail.com>
2026-05-08 09:43:29 +01:00
alexmchughdev
d494701bf9 Retrigger CI
Signed-off-by: alexmchughdev <alexanderedwardmchugh@gmail.com>
2026-05-07 18:04:35 +01:00
alexmchughdev
22fbde5127 promql: reject NaN/Inf and fix overflow bound in duration expressions
calculateDuration converts a float64 seconds value into a time.Duration
nanoseconds value via "time.Duration(duration*1000) * time.Millisecond".
Two related issues let invalid input slip through:

1. The bounds check used "duration > 1<<63-1 || duration < -1<<63",
   comparing a value-in-seconds against the int64 nanosecond range. The
   safe input range is +/- math.MaxInt64 / 1e9 seconds (about 292 years),
   roughly 1e9 times tighter. Arithmetic on legal duration literals
   (e.g. constructed via MUL/POW operators in DurationExpr) could
   produce a finite value that passed the check but overflowed during
   the final time.Duration conversion, yielding an
   implementation-defined int64 silently flowing into selector Range,
   OriginalOffset, and Step.

2. NaN compares false against everything, so a NaN duration produced
   by math.Pow(-1, 0.5) (and similar) bypassed both the negative-value
   check and the magnitude check, again producing an
   implementation-defined int64 in the conversion.

Reject NaN and +/-Inf up front, and align the magnitude bound with the
parser's offset_duration_expr rule (1<<63 / 1e9), which already had the
correct unit. Add regression tests covering each new failure mode and
a happy-path case just below the new bound.

```release-notes
[BUGFIX] PromQL: Reject NaN, infinite, and out-of-range duration expressions instead of silently producing an out-of-range time.Duration.
```

Signed-off-by: alexmchughdev <alexanderedwardmchugh@gmail.com>
2026-05-07 17:27:24 +01:00
Bartlomiej Plotka
91c184a899
Add bwplotka as the 3.12 release shepherd (#18634)
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2026-05-07 10:48:02 +01:00
Maksim Korotkov
e4e65d1247 promql: prevent nil pointer dereference in DurationExpr.PositionRange
Fixed a bug in the `PositionRange` method where a panic occurred when `e.RHS` was nil.
Previously, the code checked `if e.RHS == nil` but then immediately
accessed `e.RHS.PositionRange().End`, causing a runtime error.

This commit updates the logic to correctly use `e.LHS.PositionRange().End`
when the RHS is missing.

Fixes: ee7d5158a ("Add step(), min(a,b) and max(a,b) in promql duration expressions")
Found by PostgresPro with the Svace static analyzer.

Signed-off-by: Maksim Korotkov <m.korotkov@postgrespro.ru>
2026-05-07 00:10:24 +03:00
Owen Williams
da1f89e736
tsdb(wal): st-per-sample for histograms initial code and benchmarks (#18221)
Implements ST for Histograms and Float Histograms (and their custom bucket cousins) in WAL. New tests, new benchmarks.

Part of https://github.com/prometheus/prometheus/issues/17790

```release-notes
[CHANGE] Adds Start Time value to all WAL Histogram samples in memory, and therefore may increase memory usage.
```

Signed-off-by: Owen Williams <owen.williams@grafana.com>
2026-05-06 14:33:03 -04:00
Owen Williams
1cdee43726
tsdb: fix init race that lets initialized() return true before maxTime is set
initTime previously set minTime first and maxTime second. Because
Head.initialized() keys only off minTime, a concurrent Head.Appender call
could observe initialized() == true while maxTime was still
math.MinInt64. h.appender() then computes appendableMinValidTime as
MaxTime() - chunkRange/2, which underflows to a large positive number
and rejects in-range samples with ErrOutOfBounds.

Set maxTime first, then minTime. The CAS-loser wait now spins on
minTime instead of maxTime, preserving the existing anti-deadlock
timeout. AppenderV2 shares the same gate, so this single change covers
both paths.

The TestHead_InitAppenderRace_ErrOutOfBounds test added in #17963 is now
stable across 1000 iterations (and 100 iterations under -race).

Relates to #17941
Builds on #17963

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Owen Williams <owen.williams@grafana.com>
2026-05-06 11:16:47 -04:00
Julien Pivotto
fc4d0af37a cmd/prometheus: allow retention percentage with new data path
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-06 15:27:32 +02:00
Julien
bd4758a835
Merge pull request #18623 from roidelapluie/promql-parser-range-duration-keyword
promql/parser: recognize range in duration expressions
2026-05-06 13:45:45 +02:00
Julien Pivotto
8739d37781 promql/parser: use map-based dispatch for duration keyword lexing
Replace the hardcoded switch over start characters and keyword names with
a map-driven approach. durationKeywordTokens maps lowercase keyword strings
to their token types, and isDurationKeywordStartChar derives the valid start
characters from that map, so adding a new duration keyword only requires one
change instead of three.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-06 13:16:56 +02:00
Julien Pivotto
483db9310d promql/parser: recognize range in duration expressions
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-06 12:42:42 +02:00
Julien Pivotto
20b5f16159 web/api: emit duration expression trees
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-06 12:10:03 +02:00
Julien
75ec141616
Merge pull request #18305 from charleskorn/duration-openapi-docs
fix: correctly document supported formats for duration query request parameters in OpenAPI spec
2026-05-05 14:29:13 +02:00
Julien
b8e540e3f8
Merge pull request #18620 from roidelapluie/roidelapluie/config-auto-reload-flag
Promote auto-reload-config as stable
2026-05-05 14:22:59 +02:00
Bryan Boreham
0919b89f56
Merge pull request #18617 from Spuxy/refactor_simplify_function_call
refactor: use UnixMilli instead of dividing
2026-05-05 12:28:31 +01:00