Commit graph

17518 commits

Author SHA1 Message Date
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
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
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
Bryan Boreham
1e68b3b30e
Merge pull request #18596 from roidelapluie/merge-3.11
Merge 3.11
2026-05-05 12:20:39 +01:00
Julien
9c23509790
Merge pull request #18209 from Sanchit2662/validate-remote-write-queue-config
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
config: validate remote_write queue_config fields
2026-05-04 15:49:42 +02:00
Julien Pivotto
cdf0184419 Promote auto-reload-config stable
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-05-04 15:14:54 +02:00
Filip Boye-Kofi
6fc7f37c7a refactor: simplify of calling functions
Signed-off-by: Filip Boye-Kofi <Spuxy@seznam.cz>
2026-05-03 10:34:35 +02:00
Julien Pivotto
5e4c110c65 Merge branch 'release-3.11' into merge-3.11 2026-04-27 17:11:39 +02:00
Julien
eb173f5256
Merge pull request #18594 from roidelapluie/roidelapluie/cut-rel-3.11.3
Some checks failed
CI / Go tests (push) Has been cancelled
CI / More Go tests (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
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
Release 3.11.3
2026-04-27 16:40:41 +02:00
Julien Pivotto
9f2022e6f6 rules: fix flaky TestDependencyMapUpdatesOnGroupUpdate
The test called ruleManager.start() before ruleManager.Update(), so the
group goroutine skipped the <-m.block wait and began evaluating
immediately. The fixture has a recording rule, and if the first 10s
tick fired before defer ruleManager.Stop() ran, Eval was called with a
nil QueryFunc (and nil Appendable), causing a nil pointer dereference.

Fix by providing Appendable, Queryable, and QueryFunc in the
ManagerOptions, matching the pattern used by other tests that load real
rule files and start the manager.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-04-27 16:28:28 +02:00
Julien Pivotto
5ba3545753 Release 3.11.3
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-04-27 15:48:10 +02:00
Julien
16034ecf3b
Merge pull request #18592 from roidelapluie/roidelapluie/rw-decode-limit-cl
changelog: add security entry for snappy decode limit in 3.8.1
2026-04-27 15:45:24 +02:00
Julien Pivotto
6fb5831f81 changelog: add security entry for snappy decode limit in 3.8.1
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-04-27 14:58:51 +02:00
Julien
e48be9d71a
Merge pull request #18575 from roidelapluie/roidelapluie/duration-expression-stable
PromQL: Promote duration expressions as stable
2026-04-27 14:46:08 +02:00
Julien
26dae7f06b
Merge pull request #18590 from roidelapluie/roidelapluie/azadsecret
remote/azuread: use Secret type for OAuth client_secret
2026-04-27 13:42:46 +02:00
Julien
ecbde5fc10
Merge pull request #18588 from roidelapluie/roidelapluie/react-escape
ui: fix stored XSS in old UI heatmap chart tick labels
2026-04-27 13:23:07 +02:00
Julien
0a1c5622d6
Merge pull request #18586 from roidelapluie/roidelapluie/azadsecret
remote/azuread: use Secret type for OAuth client_secret
2026-04-27 12:48:28 +02:00
Julien
04055ee190
Merge pull request #18584 from roidelapluie/roidelapluie/snappylength
remote: validate snappy decoded length before allocation in read endpoint
2026-04-27 12:45:25 +02:00
Julius Volz
38f23b9075 ui: fix stored XSS in old UI heatmap chart tick labels
This fixes the stored XSS as described in:

https://github.com/prometheus/prometheus/security/advisories/GHSA-fw8g-cg8f-9j28

Signed-off-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-04-27 12:28:10 +02:00
Julien Pivotto
5ccebcdb3f remote/azuread: use Secret type for OAuth client_secret
The ClientSecret field in OAuthConfig was typed as plain string,
causing it to be exposed in plaintext via the /-/config HTTP endpoint.
Change it to config_util.Secret so Prometheus redacts it as <secret>.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-04-27 12:17:49 +02:00
Julien Pivotto
3273935170 remote: validate snappy decoded length before allocation in read endpoint
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-04-27 12:02:50 +02:00
Owen Williams
a5876a0143
tsdb: Reduce test flakiness (#18577)
I have seen some flakiness in these tests, including timeouts. LLM suggested these fixes to make them more deterministic.  They look good to me.

Signed-off-by: Owen Williams <owen.williams@grafana.com>
2026-04-27 10:19:15 +02:00
Linas Medžiūnas
45afb1d06e
perf(PromQL): make floatHistogram.KahanAdd inlineable on Go 1.26 (#18568)
* perf(PromQL): make kahansum.Inc inlineable on Go 1.26

Signed-off-by: linasm <linas.medziunas@gmail.com>
Signed-off-by: Linas Medžiūnas <linasm@users.noreply.github.com>
Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
2026-04-27 08:43:13 +02:00
Joe Adams
277d3c9009
Merge pull request #18579 from matt-gp/aws-external-id
[ENHANCEMENT] AWS SD: Add optional external_id field
2026-04-26 17:54:00 -04:00