17320 Commits

Author SHA1 Message Date
Frederic Branczyk
b014aa101d
Merge pull request #17601 from joelkbiju12/ft-kubernetes-nodeready-label
discovery: adding kubernetes node condition labels
2026-04-01 18:05:27 +02:00
Ayoub Mrini
0dd834e924
Merge pull request #18406 from machine424/depll
test: migrate TestDelayedCompaction to synctest to eliminate flakiness
2026-04-01 16:40:50 +02:00
Julien
320901614e
Merge pull request #18419 from roidelapluie/roidelapluie/fix-fuzzing-corpus-timestamp
util/fuzzing: fix changed field name CreatedTimestamp in protobuf corpus
2026-04-01 15:39:19 +02:00
Julien Pivotto
81403bc785 util/fuzzing: fix changed field name CreatedTimestamp in protobuf corpus
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-04-01 15:08:33 +02:00
Julien
06aaeedca7
Merge pull request #18414 from roidelapluie/roidelapluie/fix-proto-histogram-panics
histogram, textparse: fix two panics in compactBuckets for malformed input
2026-04-01 14:42:01 +02:00
Julien
72b49e6f55
Merge pull request #18415 from roidelapluie/roidelapluie/proto-fuzz
fuzzing: add FuzzParseProtobuf fuzz target and corpus generation
2026-04-01 14:41:42 +02:00
Björn Rabenstein
4280662cdf
Merge pull request #18304 from crawfordxx/fix-typos-in-comments
Fix typos in comments and metric help strings
2026-04-01 13:45:59 +02:00
Jorge Creixell
4b562bba6e
tsdb: fix prometheus_tsdb_head_chunks going negative after WAL replay (#18401)
* tsdb: fix prometheus_tsdb_head_chunks going negative after WAL replay

  When truncateStaleSeries deletes a series (writing a full-range tombstone
  to the WAL) and the same label set is immediately re-created, WAL replay
  queues the following sequence on the same processor shard for the shared
  memSeries pointer:

    reset(mSeries, M mmappedChunks, walRef=old)
    deleteSeriesByID(old)
    reset(mSeries, N mmappedChunks, walRef=new)

  deleteSeriesByID correctly subtracts M from the gauge but does not clear
  series.mmappedChunks. The subsequent reset subtracts M again, driving
  prometheus_tsdb_head_chunks negative when M > N.

  Fix by setting series.mmappedChunks = nil in deleteSeriesByID after
  accounting for those chunks.

  Fixes #10884

  Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Signed-off-by: Jorge Creixell <jcreixell@gmail.com>

* Simplify test

  - Re-use appending helper
  - Cleanup comments

Signed-off-by: Jorge Creixell <jcreixell@gmail.com>

* Improve comments in test

Signed-off-by: Jorge Creixell <jcreixell@gmail.com>

* Fix formatting

Signed-off-by: Jorge Creixell <jcreixell@gmail.com>

* Improve comment

Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
Signed-off-by: Jorge Creixell <jcreixell@gmail.com>

---------

Signed-off-by: Jorge Creixell <jcreixell@gmail.com>
Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
2026-04-01 11:30:33 +02:00
Rushabh Mehta
a2172f91c1
tsdb: Find the last series ID on startup from the last series id file and WAL scan (#18333)
* Add logic to Head.Init(...) for fast startup

Signed-off-by: Rushabh Mehta <mehtarushabh2005@gmail.com>

* Add unit tests

Signed-off-by: Rushabh Mehta <mehtarushabh2005@gmail.com>

* Empty commit to retrigger CI

Signed-off-by: Rushabh Mehta <mehtarushabh2005@gmail.com>

* Empty commit to retrigger CI

Signed-off-by: Rushabh Mehta <mehtarushabh2005@gmail.com>

* Make readSeriesStateFile return a struct directly, fix small nits, remove test

Signed-off-by: Rushabh Mehta <mehtarushabh2005@gmail.com>

* Fix test for readSeriesStateFile function

Signed-off-by: Rushabh Mehta <mehtarushabh2005@gmail.com>

* Fix some more nits, add extra testcase

Signed-off-by: Rushabh Mehta <mehtarushabh2005@gmail.com>

---------

Signed-off-by: Rushabh Mehta <mehtarushabh2005@gmail.com>
2026-03-31 21:45:53 -07:00
Ayoub Mrini
71be0ff0ba
Merge pull request #16550 from machine424/changever-e2e
Add e2e upgrade testing utils and LTS upgrade/downgrade test
2026-03-31 16:31:55 +00:00
Aurélien Duboc
fa5960bf08
feat(discovery): add Outscale VM service discovery (#18139)
Add Outscale VM service discovery using osc-sdk-go, including optional secret_key_file support, metrics, docs, and configuration examples. Document the default region (eu-west-2).

Signed-off-by: Aurelien Duboc <aurelienduboc96@gmail.com>
2026-03-31 18:03:51 +02:00
Carrie Edwards
4326d54760
Rename created timestamp to start timestamp in proto (#18368)
Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>
2026-03-31 08:38:45 -07:00
Julien Pivotto
c9dd34ac6b histogram, textparse: fix two panics in compactBuckets for malformed input
Two cases in compactBuckets caused a panic when fed malformed histogram
data (e.g. via a crafted protobuf message):

1. All spans have zero length: after the zero-length span removal pass,
   spans becomes empty. The subsequent loop called emptyBucketsHere(),
   which accessed spans[0] and panicked with index out of range.
   Fixed by the early return added in the previous commit (already on
   this branch via the roidelapluie/histogram-compact-zero-spans fix).

2. More buckets than spans describe: iSpan can reach len(spans) before
   all buckets are consumed, causing emptyBucketsHere() to access
   spans[iSpan] out of bounds.
   Fixed by adding iSpan < len(spans) to the loop guard.

Both fixes in compactBuckets are defensive layers. The primary fix is
in the protobuf parser: checkNativeHistogramConsistency now validates
that span total length matches bucket count before calling Compact(),
returning a proper error for malformed input instead of panicking.

Found by FuzzParseProtobuf.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-03-31 17:37:09 +02:00
Julien Pivotto
aba887e21e fuzzing: add FuzzParseProtobuf fuzz target and corpus generation
Add a new FuzzParseProtobuf fuzz target that exercises the protobuf
exposition-format parser

Reduce per-target fuzz time to 4m to keep budget acceptable with
the additional target.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-03-31 17:25:26 +02:00
Bartlomiej Plotka
fb38463dfb
Merge pull request #18321 from atoulme/aix
aix: support the aix/ppc64 compilation target
2026-03-31 16:42:20 +02:00
Vamsi Mathala
3d6d1cf056
fix(PromQL): preserve DropName flag from subquery in last_over_time (#18409)
When last_over_time or first_over_time is applied to a subquery that
contains functions like abs(), round(), etc., the DropName flag should
be preserved. Previously, the flag was unconditionally overwritten based
solely on the function name, ignoring the input series state.

This fix checks if the input series (from a subquery) already has
DropName=true and respects that flag by using OR logic.

Before this fix:
  last_over_time(abs(metric)[10m:]) incorrectly returned {__name__="metric", ...}

After this fix:
  last_over_time(abs(metric)[10m:]) correctly returns {...} without __name__

The same behavior applies to first_over_time().

Fixes #18397

---------

Signed-off-by: Vamsi Mathala <vmathala@redhat.com>
2026-03-31 15:39:42 +02:00
Julien
4b4d5157b8
chunkenc: add tests for XOR2 active ST delta and value branches (#18363)
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-03-31 15:15:48 +02:00
Kyle Eckhart
37d85980a3
tsdb/agent: fix getOrCreate race (#18292)
* tsdb/agent: fix race in getOrCreate and consolidate series lookup
* tsdb/agent: fix transition window race in SetUnlessAlreadySet
* tsdb/agent: address review feedback and improve BenchmarkGetOrCreate

Signed-off-by: Kyle Eckhart <kgeckhart@users.noreply.github.com>

---------

Signed-off-by: Kyle Eckhart <kgeckhart@users.noreply.github.com>
2026-03-31 15:08:58 +02:00
Julien
f99f3bb65d
Merge pull request #18382 from roidelapluie/roidelapluie/fix-summary-no-quantiles-panic
textparse: fix panic in protobuf parser for summary with no quantiles
2026-03-31 14:51:14 +02:00
Julien
7fd7a393b6
convertnhcb: reject NaN bucket boundary in SetBucketCount (#18383)
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-03-31 14:23:17 +02:00
Bryan Boreham
ffb296eed7
Merge pull request #16155 from LukoJy3D/docs/migration/clarify_on_content_type_headers
docs(migration): clarify on content-type headers
2026-03-31 12:58:48 +01:00
Bryan Boreham
7990f2bbde
Merge pull request #18407 from prapti222/patch-1
docs: fix minor grammar issues in README
2026-03-31 12:10:49 +01:00
Bryan Boreham
04b36ba9a6
Merge pull request #18410 from sTomerG/chore/bump-libopenapi-jsonparser-cve
chore: bump libopenapi to pull jsonparser v1.1.2 to address CVE-2026-32285.
2026-03-31 12:07:09 +01:00
Tomer Gabay
40320810df chore: bump libopenapi to pull jsonparser v1.1.2
Bump github.com/pb33f/libopenapi to v0.34.4, which upgrades github.com/buger/jsonparser
to v1.1.2 to address CVE-2026-32285.

Signed-off-by: Tomer Gabay <10978711+sTomerG@users.noreply.github.com>
2026-03-31 12:03:40 +02:00
Julien
7b5a4090e3
Merge pull request #18408 from roidelapluie/roidelapluie/otlp-read-limit
storage/remote: add OTLP request body read limit
2026-03-31 11:41:39 +02:00
Julien Pivotto
5d695516ba storage/remote: add OTLP request body read limit
Apply the same io.LimitReader guard (decodeReadLimit = 32 MiB) to the
OTLP write decoder that remote read already use, so that a gzip-encoded request
body cannot decompress to unbounded memory.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-03-31 11:11:47 +02:00
Prapti Gupta
f0963cb510
docs: fix minor grammar issues in README
This PR fixes minor grammar and wording issues in the README to improve clarity and readability.

Changes include:
- Fix capitalization ("You" → "you")
- Improve sentence clarity

No functional changes.

Signed-off-by: Prapti Gupta <gupta.prapti509@gmail.com>
2026-03-31 12:22:34 +05:30
Julius Volz
74bfffc471
Merge pull request #18396 from roidelapluie/roidelapluie/fix-query-log-test-flakiness
cmd/prometheus: fix flaky TestQueryLog console test
2026-03-31 07:25:13 +01:00
machine424
86215cf91f
test: migrate TestDelayedCompaction to synctest to eliminate flakiness
The previous implementation relied on real wall-clock time and busy-loops
(time.Sleep + polling loops) to detect when compaction had finished, making
it both slow and flaky especially on busy CI envs and also  on Windows due to timer imprecision).

Now both the subtests run on windows.

The delay value can be increased (1s → 5s) at zero cost to test runtime

Also cleaned up shared logic into small helpers and split the no-delay and
delay-enabled cases into separate subtests for clarity.

Signed-off-by: machine424 <ayoubmrini424@gmail.com>
2026-03-30 23:58:08 +02:00
machine424
dcfb8ce59c
chore: remove util/testutil/synctest now that we use Go>=1.25
Signed-off-by: machine424 <ayoubmrini424@gmail.com>
2026-03-30 19:48:39 +02:00
Julien
ced39f8a74
Merge pull request #18287 from Skesov/feat/digitalocean-db-sd
discovery: add DigitalOcean Managed Databases service discovery
2026-03-30 16:47:59 +02:00
Julius Volz
0545b38c26
Merge pull request #18390 from vijaygovindaraja/ui/delete-series-page
ui: add delete series page
2026-03-30 12:50:47 +01:00
Skesov
cf09d9b885
Update docs/configuration/configuration.md
Co-authored-by: Ben Kochie <superq@gmail.com>
Signed-off-by: Skesov <12987308+Skesov@users.noreply.github.com>
2026-03-30 12:30:14 +03:00
Vladimir Skesov
20ff771593 discovery: add DigitalOcean Managed Databases service discovery
This adds 'databases' role to digitalocean_sd_config to discover DigitalOcean
Managed Database clusters. It follows the multi-role design pattern by
introducing a 'role' parameter (default: 'droplets').

Includes:
- Support for Managed Databases API.
- Pagination handling for Databases API.
- Comprehensive meta labels for database targets.
- Updated documentation and tests.

Signed-off-by: Vladimir Skesov <skesov@gmail.com>
2026-03-30 11:31:17 +03:00
Julien Pivotto
05721a85d7 cmd/prometheus: fix flaky TestQueryLog console test
- Use an absolute path for the console templates directory to align with rules.
- Rewrite waitForPrometheus using require.Eventually for cleaner
  error reporting and to fix a bug where the function could return nil
  even when the server never became ready.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-03-30 09:55:36 +02:00
Arve Knudsen
d6c18a4d62
promql: add test and docs for info() behavior when info series goes stale (#18352)
* promql: add test for info() with data label matcher when info series goes stale

When info() is called with a data label matcher that doesn't match
the empty string (e.g. {data=~".+"}), samples at timestamps where
no info series is available should be dropped rather than falling
back to the original un-enriched series.

This case was missing from the test suite.

* docs: document info() behavior when info series is unavailable

Document that when no matching info series exists at a timestamp,
data label matchers that don't match the empty string cause the
sample to be dropped, while empty-matching matchers or no selector
return the series unenriched.

* promql: add test cases for info() fallback when info series goes stale

Add test cases for info(metric, {data=~".*"}) and info(metric) to
complement the existing info(metric, {data=~".+"}) test case, making
the behavioral contrast explicit: empty-matching matchers and no
selector fall back to the unenriched series, while non-empty-matching
matchers drop the sample.

---------

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2026-03-30 09:32:29 +02:00
Julien
67dca1811a
Merge pull request #18386 from roidelapluie/roidelapluie/cut-3.11.o-rc.0
Release 3.11.0-rc.0
v3.11.0-rc.0
2026-03-30 09:17:48 +02:00
Vijay Govindarajan
f9bbda6bcd ui: adopt timezone-aware DateTimePicker for delete series time inputs
Use the same dayjs + useLocalTime pattern from the query page's
TimeInput component so the datetime pickers respect the user's
global "use local time" setting. Adds valueFormat with seconds
precision and stores timestamps as milliseconds internally.

Signed-off-by: Vijay Govindarajan <vijay.govindarajan91@gmail.com>
2026-03-29 23:11:23 -07:00
Vijay Govindarajan
e26cf80bdd ui: move delete series into TSDB Status page and address review feedback
Address review feedback from juliusv:

- Move delete series UI into the existing TSDB Status page instead of
  creating a new top-level page, keeping the navigation minimal
- Use Textarea instead of TextInput for multi-line series selectors
- Use DateTimePicker from @mantine/dates for time range inputs
- Separate error/success states for delete vs clean tombstones
  operations, showing alerts in the appropriate card
- Fix warning text to use quoted "Clean Tombstones"
- Remove standalone DeleteSeriesPage.tsx, revert App.tsx routing and
  settingsSlice.ts changes

Signed-off-by: Vijay Govindarajan <vijay.govindarajan91@gmail.com>
2026-03-29 08:34:09 -07:00
Vijay Govindarajan
7d14fbe0ae ui: add delete-series to pagePaths for path prefix detection
Without this, navigating directly to /delete-series under a path
prefix (e.g. /prometheus/delete-series) would fail to detect the
prefix correctly.

Signed-off-by: Vijay Govindarajan <vijay.govindarajan91@gmail.com>
2026-03-28 16:21:50 -07:00
Vijay Govindarajan
bb7ff1aa05 ui: add delete series page
Adds a web UI page for the delete_series and clean_tombstones admin
APIs, making it easier to manage time series data without using curl
commands directly.

The page provides:
- A form to specify PromQL series selectors for deletion
- Optional start/end time range filters
- A clean tombstones button to reclaim disk space after deletion
- Warning and confirmation feedback

Fixes #17010

Signed-off-by: Vijay Govindarajan <vijay.govindarajan91@gmail.com>
2026-03-28 16:21:06 -07:00
Julien Pivotto
999a67cc04 Release 3.11.0-rc.0
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-03-27 16:08:11 +01:00
Julien
cb3382314d
Merge pull request #18374 from roidelapluie/roidelapluie/retention-percentage-float
tsdb: use float64 for retention percentage
2026-03-27 11:17:55 +01:00
Julien
3f40ca38e6
Merge pull request #18375 from roidelapluie/roidelapluie/fix-alert-state-restore-template-labels
rules: skip template labels when querying ALERTS_FOR_STATE for restore
2026-03-27 11:17:43 +01:00
Julien Pivotto
7f82c5f52c textparse: fix panic in protobuf parser for summary with no quantiles
getMagicLabel had no bounds check on the quantile slice for the Summary
case. fieldsDone for an empty-quantile summary is set inside Series(),
not getMagicLabel. A caller driving Next() without calling Series() at
the _sum step would allow fieldPos to advance to 0 and index into an
empty slice.

Add the same out-of-bounds guard that the histogram branch already has,
and a regression test that exercises Next()-only iteration over a
summary with no quantiles.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-03-27 10:37:32 +01:00
Julien
5b1d22e2ce
Merge pull request #18376 from prometheus/superq/new_promci
chore: Use make target for protoc
2026-03-26 17:27:06 +01:00
Arve Knudsen
841e4a96b1
promql: add more info() test cases (#18367)
Add test cases for two edge cases in the info() function:
- Enrichment when inner series are missing one identifying label
- Conflicting labels across different info metrics should error

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2026-03-26 17:08:28 +01:00
SuperQ
9587b2ebc0
chore: Use make target for protoc
Migrate the CI scripting of installing protoc to a Makefile target.

Signed-off-by: SuperQ <superq@gmail.com>
2026-03-26 16:35:14 +01:00
Julien Pivotto
e5c77afc71 rules: skip template labels when querying ALERTS_FOR_STATE for restore
QueryForStateSeries built Select matchers from the raw rule labels,
which can contain Go template expressions such as
`instance_{{ $labels.instance }}`. The stored ALERTS_FOR_STATE series
carry the per-instance evaluated values (e.g. `instance_0`), so the
unevaluated template string never matched, leaving seriesByLabels empty
and silently skipping restoration for every active alert.

Fix by omitting any label whose value contains `{{` from the matcher
list. Static labels (including `__name__` and `alertname`) are never
templated and continue to scope the query to the correct rule. The
in-memory lookup against evaluated alert labels that follows is
unaffected, so the single-query-per-rule optimisation introduced in
#13980 is fully preserved.

Fixes #16883
Ref #13980
Ref #18364

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-03-26 15:06:01 +01:00
Julien
8fcd0a5d04
Merge pull request #18373 from roidelapluie/roidelapluie/npm-deps-3.11
chore: Update javascript dependencies for 3.11
2026-03-26 14:42:45 +01:00