1029 Commits

Author SHA1 Message Date
Pierluigi Lenoci
afe0547899
promtool: redirect debug output to stderr (#18346)
The debug flag in `promtool test rules` writes diagnostic output
using fmt.Printf to stdout, which can interfere with machine-parseable
output (e.g. JUnit XML via --junit-output) and piped workflows.

Redirect all DEBUG lines to stderr using fmt.Fprintf(os.Stderr, ...),
consistent with the existing error output pattern already present in
the file (line 78).

Signed-off-by: Pierluigi Lenoci <pierluigi.lenoci@gmail.com>
2026-03-24 12:12:54 +01:00
Rushabh Mehta
df61021436
tsdb: Add series_state.json file to wal/ directory to track state (#18303)
* Add series_state.json file creation and updation logic.

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

* Make comments follow the guidelines.

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

* Fix linter complaints

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

* Put PR behind feature flag fast-startup

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

* Marshal updated information to file directly

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

* Fix linter failures

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

* Move series state code from head.go to head_wal.go

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

* Fix nits

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

* Add unit test

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

---------

Signed-off-by: Rushabh Mehta <mehtarushabh2005@gmail.com>
2026-03-23 20:46:04 -07:00
Julien
16876bab95
Merge pull request #18200 from roidelapluie/roidelapluie/retention-validation
Multiple fixes in retention configuration
2026-03-20 12:27:37 +01:00
Julien Pivotto
1064c26da2 Log retention changes
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-03-19 17:21:45 +01:00
Bartlomiej Plotka
364d70812f
st: disconnect st-storage with xor2-encoding given planned experiments (#18316)
* st: disconnect st-storage with xor2-encoding given planned experiments

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

* Update docs/feature_flags.md

Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Update docs/feature_flags.md

Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Update docs/feature_flags.md

Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Update docs/feature_flags.md

Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

---------

Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
2026-03-19 08:47:42 +00:00
Bartlomiej Plotka
7e2b7e425c
Merge branch 'feature/start-time' into cedwards/document-st-storage
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2026-03-17 06:21:05 +01:00
Carrie Edwards
870fdf71f1 Update documentation for st-storage feature
Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>
2026-03-16 09:59:36 -07:00
Carrie Edwards
7694434044 Document xor2-encoding feature flag
Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>
2026-03-12 11:05:59 -07:00
György Krajcsovits
0dac72ee94
feat(tsdb): register st_storage in feature API
Register the st-storage feature flag in the feature registry via
the TSDB options, consistent with how other TSDB features like
exemplar_storage and delayed_compaction are registered.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Coded with Claude Sonnet 4.6.
2026-03-12 16:01:04 +01:00
bwplotka
c133a969af Merge branch 'main' into start-time-main-sync 2026-03-12 08:28:15 +00:00
machine424
bb272d7201
chore(kubernetes): deduplicate warning logs from the API
Signed-off-by: machine424 <ayoubmrini424@gmail.com>
2026-03-12 08:34:33 +01:00
Matt
5a02b92c0e
AWS SD: RDS Role (#18206) 2026-03-04 12:17:38 +01:00
Matthieu MOREL
45b9329e68
chore: fix emptyStringTest issues from gocritic (#18226)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-03-04 08:24:50 +01:00
Ayoub Mrini
5c1af24733
Merge pull request #17356 from machine424/gg
chore(test): make failures in TestRemoteWrite_PerQueueMetricsAfterRelabeling more explicit/rich to help with debugging the test when it flakes for GOARCH=386
2026-03-03 20:25:13 +01:00
Ayoub Mrini
f5fe1573ba
Merge pull request #18219 from machine424/ttyyy
fix: fail early when --enable-feature=use-uncached-io is unsupported
2026-03-03 13:33:56 +01:00
machine424
dfea5ef01a
chore(test): make failures in TestRemoteWrite_PerQueueMetricsAfterRelabeling
more explicit to help with debugging the test when it flakes for GOARCH=386

tried to make it fail in the CI running the following, in vain:

GOARCH=386 go test --timeout 4444444s --count=1000 --run=TestRemoteWrite_PerQueueMetricsAfterRelabeling ./cmd/prometheus/

Signed-off-by: machine424 <ayoubmrini424@gmail.com>
2026-03-03 11:54:40 +01:00
machine424
6b4d8fa91e
fix: fail early when --enable-feature=use-uncached-io is unsupported
Signed-off-by: machine424 <ayoubmrini424@gmail.com>
2026-03-03 11:44:56 +01:00
Owen Williams
c4deef472e
Merge remote-tracking branch 'origin/main' into feature/start-time
Signed-off-by: Owen Williams <owen.williams@grafana.com>
2026-03-02 14:47:44 -05:00
Matthieu MOREL
026d284c43 chore: fix httpNoBody issues from gocritic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-03-02 20:06:30 +01:00
Julien Pivotto
3e5a7c09d0 chore(main): Fix typo SuqueryInterval to SubqueryInterval
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-02-27 12:57:20 +01:00
Julien Pivotto
bf3c217bbd config: apply retention CLI flags as defaults and update UI on reload
Introduce DefaultTSDBRetentionConfig, populated from CLI flags before any
config file is loaded, so that retention falls back to CLI flags when the
config file has no storage.tsdb section. Config.UnmarshalYAML always injects
a non-nil TSDBConfig with those defaults, removing the need for nil checks in
main.go. ApplyConfig in web.go now propagates retention settings on each
config reload so the runtime info endpoint stays up to date.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-02-26 16:36:05 +01:00
bwplotka
8f3a6020d8 Merge branch 'main' into st-main-sync2 2026-02-25 13:54:25 +00:00
George Krajcsovits
5d3f9ee39b
Merge pull request #17904 from linasm/trim_histogram
promql: Implement </ and >/ operators for trimming native histograms
2026-02-24 17:16:24 +01:00
Julien
9d38077e50
Merge pull request #18080 from ldufr/ldufresne/retention-size-percentage
Add percentage based retention
2026-02-24 15:50:36 +01:00
Laurent Dufresne
971143edac Added Retention.Percentage to config file with runtime config reloading
Signed-off-by: Laurent Dufresne <laurent.dufresne@grafana.com>
2026-02-24 15:28:20 +01:00
Jérôme LOYET
696679e50c Add storage.tsdb.retention.percentage config
Signed-off-by: Jérôme LOYET <822436+fatpat@users.noreply.github.com>
Signed-off-by: Laurent Dufresne <laurent.dufresne@grafana.com>
2026-02-24 15:27:45 +01:00
bwplotka
56c46af6a6 Merge branch 'main' into st-f-main 2026-02-23 10:00:39 +00:00
Matt
ce30ae49f3
[FEATURE] AWS SD: Add Elasticache Role (#18099)
* AWS SD: Elasticache

This change adds Elasticache to the AWS SD.

Co-authored-by: Ben Kochie <superq@gmail.com>
Signed-off-by: Matt <small_minority@hotmail.com>

---------

Signed-off-by: Matt <small_minority@hotmail.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
2026-02-22 15:56:03 +01:00
Bartlomiej Plotka
2c4afcdcdc
chore: Add consistent closing logging (#18119)
Signed-off-by: bwplotka <bwplotka@gmail.com>
2026-02-20 13:17:02 +00:00
Björn Rabenstein
b2e63376da
Merge pull request #18105 from mmorel-35/staticcheck
chore: enable staticcheck linter and update golangci-lint to 2.10.1
2026-02-19 12:44:00 +01:00
Linas Medžiūnas
5bd0d00f8c
PromQL: Add experimental histogram_quantiles variadic function (#17285)
Signed-off-by: Linas Medziunas <linas.medziunas@gmail.com>
Signed-off-by: Björn Rabenstein <github@rabenste.in>
Signed-off-by: beorn7 <beorn@grafana.com>
Co-authored-by: Björn Rabenstein <github@rabenste.in>
Co-authored-by: beorn7 <beorn@grafana.com>
2026-02-18 17:32:29 +01:00
Matthieu MOREL
addc3dcb47 chore: enable staticcheck linter and update golangci-lint to 2.10.1
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-02-18 15:58:16 +00:00
Bartlomiej Plotka
8d8371244b
Merge pull request #18108 from prometheus/bwplotka/fix
scrape: add tests for ST appending; add warnings for ST feature flag users around _created drop
2026-02-18 12:26:17 +00:00
Bartlomiej Plotka
23d2ab447e
feat[scrape]: add ST parsing support to scrape AppenderV2 flow (#18103)
Signed-off-by: bwplotka <bwplotka@gmail.com>
2026-02-18 10:15:14 +01:00
Julien Pivotto
7d0a39ac93 chore(lint): enable wg.Go
Since our minimum supported go version is now go 1.25, we can use wg.Go.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-02-17 15:21:51 +01:00
Martin Valiente Ainz
78020ad60e
promtool: fix --enable-feature flags ignored in check config and test rules (#18097)
Both are regressions from the parser refactoring in #17977.

- Fixes #18092
- Fixes #18093

Signed-off-by: Martin Valiente Ainz <64830185+tinitiuset@users.noreply.github.com>
2026-02-16 15:38:26 +01:00
Martin Valiente Ainz
eb5a0e1eed
Refactor parse.go into an instance-based Parser interface
Signed-off-by: Martin Valiente Ainz <64830185+tinitiuset@users.noreply.github.com>
2026-02-11 11:21:49 +01:00
Martin Valiente Ainz
539936c861
Replace per-component parser options with default instance
Signed-off-by: Martin Valiente Ainz <64830185+tinitiuset@users.noreply.github.com>
2026-02-11 11:16:04 +01:00
Martin Valiente Ainz
199d85d5e4
Add parser options parameter to remaining parse functions
Signed-off-by: Martin Valiente Ainz <64830185+tinitiuset@users.noreply.github.com>
2026-02-11 11:16:04 +01:00
Martin Valiente Ainz
af16f35ad6
PromQL: Refactor parser to use instance configuration instead of global flags
Parser configuration is now per-engine/API/loader and no longer uses package-level flags, so behavior is consistent and tests don't rely on save/restore of global variables.

Signed-off-by: Martin Valiente Ainz <64830185+tinitiuset@users.noreply.github.com>
2026-02-11 11:16:04 +01:00
Ian Kerins
4383499997
promtool: support missing promql syntax features (#17926)
Namely promql-duration-expr and promql-extended-range-selectors. This
allows promtool to e.g. check rules files using syntax gated by these
features.

Signed-off-by: Ian Kerins <git@isk.haus>
2026-02-09 07:26:37 +00:00
Matt
cf9d093f8f
prw2: Move Remote Write 2.0 CT to be per Sample; Rename to ST (start timestamp) (#17411) (#17600)
Relates to
https://github.com/prometheus/prometheus/issues/16944#issuecomment-3164760343

Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: matt-gp <small_minority@hotmail.com>
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
2026-02-05 10:40:45 +01:00
Bryan Boreham
e75c893305
Merge pull request #17986 from mdxabu/improve-test-error-handling
tests: improve error handling and helper attribution in main_test.go
2026-02-03 11:15:04 +00:00
Bartlomiej Plotka
7429a75932
scrape: switch scrape manager to AppenderV2 (#17978)
Signed-off-by: bwplotka <bwplotka@gmail.com>
2026-02-02 12:12:06 +00:00
Abu
0495130e06 tests: improve error handling in main_test.go
- Add t.Helper() to getCurrentGaugeValuesFor helper function for better
  error attribution in test failures
- Add require.NoError checks for os.WriteFile calls in TestRuntimeGOGCConfig
  and TestHeadCompactionWhileScraping to catch file write failures
- Strengthen error handling in TestDocumentation to assert command success
  rather than silently continuing on failure
- Improve log message clarity in TestAgentSuccessfulStartup to accurately
  describe early exit scenario

These changes improve test reliability and follow Go testing best practices.

Signed-off-by: Abu <abdullahfakrudeen2020@gmail.com>
2026-02-02 14:40:03 +05:30
Julien Pivotto
3bc688e5cb Features API: Add OpenAPI 3.1 and 3.2
Now that #17825 is merged.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-01-29 14:29:22 +01:00
Bartlomiej Plotka
2597a12080
st: Add a hidden 'st-storage' feature flag for PROM-60 (#17907)
Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2026-01-28 09:05:54 +00:00
Arve Knudsen
a5f86c3fb6
cmd/prometheus: fix flaky TestQueryLog race condition (#17933)
Add waitForQueryLog helper that polls for query log entries to appear
before asserting, rather than reading the file immediately after making
a query. This fixes a race condition where the query log wasn't flushed
to disk before the test read the file.

The helper uses a 5 second timeout with 100ms polling intervals, which
is generous enough to handle slow CI environments while keeping the test
responsive.

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2026-01-27 09:02:16 +00:00
Ganesh Vernekar
3e4a094dbb Add stale_series_compaction_threshold config file option
Signed-off-by: Ganesh Vernekar <ganesh.vernekar@reddit.com>
2026-01-23 18:12:34 -08:00
Bartlomiej Plotka
bec70227f1
feat(scrape)[PART5b]: Add AppenderV2 support to scrape.NewManager constructor (#17872)
* feat(scrape)[PART5b]: Add AppenderV2 support to scrape.NewManager optionally to V1

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

* Update scrape/manager.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* fixes after rebase

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

* Apply suggestions from code review

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

---------

Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2026-01-23 09:04:05 +00:00