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>
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.
chore(test): make failures in TestRemoteWrite_PerQueueMetricsAfterRelabeling more explicit/rich to help with debugging the test when it flakes for GOARCH=386
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>
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>
* 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>
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>
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>
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>
- 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>
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>