Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
18db460
discovery/aws: don't panic on Lightsail instances with absent optiona…
r0h1tb Aug 3, 2026
47b37f2
discovery/aws: avoid panic on truncated ElastiCache ARNs
fallintoplace Aug 4, 2026
5a35c2c
discovery/aws: log invalid ElastiCache ARNs
fallintoplace Aug 6, 2026
92ac951
discovery/aws: add test exposing MSK panic on nil Provisioned fields
RajeshRajendiran Jul 14, 2026
0b1c457
discovery/aws: fix MSK panic on clusters without provisioned config
RajeshRajendiran Jul 14, 2026
97f3bfc
discovery/aws: skip non-provisioned MSK clusters in describeClusters
RajeshRajendiran Jul 15, 2026
a77998b
discovery/aws: drop redundant Provisioned nil checks in MSK labels
RajeshRajendiran Jul 15, 2026
fe75845
chore(deps): update actions/setup-node action to v6.5.0 (#19359)
renovate[bot] Aug 10, 2026
ffc9136
chore(deps): update actions/stale action to v10.4.0 (#19360)
renovate[bot] Aug 10, 2026
961d3a7
chore(deps): update prometheus/promci action to v0.9.0 (#19361)
renovate[bot] Aug 10, 2026
1abe68d
fix(deps): update google.golang.org/protobuf digest to 644d026 (#19350)
renovate[bot] Aug 10, 2026
2cb9c28
fix(deps): update module github.com/moby/moby/client to v0.5.1 (#19357)
renovate[bot] Aug 10, 2026
c2558ac
fix(deps): update google.golang.org/genproto/googleapis/api digest to…
renovate[bot] Aug 10, 2026
e61dfef
fix(deps): update aws go dependencies (#19355)
renovate[bot] Aug 10, 2026
d7e984e
fix(deps): update github.com/hashicorp/nomad/api digest to d78b9b5 (#…
renovate[bot] Aug 10, 2026
1a8d308
UI: Improve native histogram table formatting
juliusv Aug 4, 2026
820e056
fix(deps): update module github.com/klauspost/compress to v1.19.2 (#1…
renovate[bot] Aug 10, 2026
8ca3b7b
fix(deps): update github.com/google/pprof digest to ef3492d (#19347)
renovate[bot] Aug 10, 2026
65ca09d
fix(deps): update module github.com/scaleway/scaleway-sdk-go to v1.0.…
renovate[bot] Aug 10, 2026
a513fa0
chore(deps): update typescript-eslint monorepo to v8.66.0 (#19362)
renovate[bot] Aug 10, 2026
466c700
promql: honour @ modifier when evaluating info series (#19266)
zenador Aug 10, 2026
8647152
chore(deps): update modules (#18983)
renovate[bot] Aug 10, 2026
ff00f15
chore(deps): update dependency @eslint/compat to v2 (#18885)
renovate[bot] Aug 10, 2026
706bff8
fix(deps): update dependency react-router-dom to v7 (#19067)
renovate[bot] Aug 10, 2026
bea965e
chore(deps): update mantine ui (#18758)
renovate[bot] Aug 10, 2026
5bae6b4
chore(deps): update dependency @codemirror/view to v6.43.8 (#18883)
renovate[bot] Aug 10, 2026
d80bc8a
Validate histogram in TestFloatHistogramCompact
linasm Aug 11, 2026
4a75ab1
histogram: fix Compact corrupting buckets on multiple span merges
winklemad Aug 2, 2026
1cf570b
docs: add native histogram examples to OpenAPI spec
vishnukothakapu Aug 9, 2026
5c5f022
test: update OpenAPI golden test files
vishnukothakapu Aug 9, 2026
36ec34c
fix(model/histogram): do not miss counter resets behind empty buckets…
sueun-dev Aug 8, 2026
89f8d5a
OS agnostic tests
JustDaile Aug 5, 2026
bb17c0f
config: A missing OTLPConfig to windows expected config - fixes faili…
JustDaile Aug 8, 2026
83390dd
add missing filepath.FromSlash where required - fix windows tests
JustDaile Aug 8, 2026
ab14ea7
build: fix shell syntax error in update-go-deps targets
roidelapluie Aug 11, 2026
4cbd42c
perf(remote): pool OTLP converter scratch state (#19388)
perfloop-agent Aug 12, 2026
aaaea0f
fix: address OOO chunk ID overflow [WIP]
periklis Jul 13, 2026
263201d
cmd/prometheus: fix flaky TestRuntimeGOGCConfig
krajorama Aug 6, 2026
09028a2
make panic lock-release test OS agnostic - remove windows guard
JustDaile Aug 5, 2026
8409d61
tsdb/head_test.go revert unrelated changes
JustDaile Aug 7, 2026
ff143ff
remove superfluous call to CutNewFile
JustDaile Aug 12, 2026
4b02767
discovery/aws: don't panic on ECS tasks with absent optional fields
r0h1tb Aug 3, 2026
00beada
promql/parser: reject offset expressions and @ start()/end() before r…
aamoghS Aug 13, 2026
060fbe2
docs: note that Kubernetes pod __address__ may omit the port
aamoghS Aug 13, 2026
d551c8a
tsdb: document that OOO chunk IDs are no longer monotonically increas…
roidelapluie Aug 13, 2026
f528552
Implement memory limiter prototype
dashpole Aug 7, 2026
bb31d71
Add unit test for memory limiter recording rule skipping
dashpole Aug 7, 2026
5078a0b
Fix scrape unregister metric leak and memory limiter edge cases
dashpole Aug 7, 2026
f1c5871
memory_limiter: fix actor lifecycle termination and heap free bytes a…
dashpole Aug 7, 2026
ec019c5
Introduce distinct metric for rule evaluations skipped under memory p…
dashpole Aug 8, 2026
2b75348
Add Go doc comments for exported symbols in memorylimiter package
dashpole Aug 8, 2026
a84e054
Safely map runtime metrics by name in defaultMetricsReader
dashpole Aug 8, 2026
facb814
Add unit tests for MemoryLimiterConfig validation and unmarshaling
dashpole Aug 8, 2026
357a988
Update target scrapes skipped metric name to follow exceeded limit pa…
dashpole Aug 8, 2026
0876772
Return structured JSON response for OTLP write memory limit rejection
dashpole Aug 8, 2026
b15cfea
Update generated CLI documentation for memory-limiter feature flag
dashpole Aug 8, 2026
1c73809
Add memory-limiter entry to docs/feature_flags.md
dashpole Aug 8, 2026
8295f9c
Initialize DefaultMemoryLimiterConfig on DefaultRuntimeConfig
dashpole Aug 8, 2026
63914ae
Check MemoryLimiter before deferring evaluation metrics in recording …
dashpole Aug 8, 2026
221a7e3
Unexport memoryStats and metricsReader, and update lastCheckTime in E…
dashpole Aug 8, 2026
1e58ea0
Use gRPC status code 14 for OTLP HTTP error payload
dashpole Aug 8, 2026
b780c3b
Update expectedConf.Runtime in config_test.go to include DefaultMemor…
dashpole Aug 8, 2026
a42a713
Add full stops to MemoryLimiterEnforcement section comments per AGENT…
dashpole Aug 8, 2026
53a7608
Fix failing unit tests
dashpole Aug 13, 2026
c876dd3
Address review comment: add to waitgroup while holding lock in Start
dashpole Aug 13, 2026
19edc5d
Address review comment: accumulate soft limit engaged seconds during …
dashpole Aug 13, 2026
63bfad7
Address review comment: validate config before registering metrics in…
dashpole Aug 13, 2026
b953dd9
Address review comment: require valid non-zero configuration in Memor…
dashpole Aug 13, 2026
33fb66f
Address review comment: remove unused PauseBlockCompaction and AllowB…
dashpole Aug 13, 2026
235a779
Address review comment: return standard http.Error for OTLP write mem…
dashpole Aug 13, 2026
2fa1fde
Address review comment: restore missing comment sentence in scrape op…
dashpole Aug 13, 2026
33955d2
Address review comment: clarify ratio error message as inclusive
dashpole Aug 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ jobs:
run: |
mkdir -p .prebuilt-ui
tar -xzvf .tarballs/prometheus-web-ui-*.tar.gz -C .prebuilt-ui
- uses: prometheus/promci/build@13941414d409d227afd67544e5d306827db5a1a2 # v0.8.5
- uses: prometheus/promci/build@370e8c15dcec50043cbe66f2f34633d9efc0a190 # v0.9.0
with:
checkout: false
# Feed the restored UI assets into the crossbuild containers so make
Expand Down Expand Up @@ -260,7 +260,7 @@ jobs:
run: |
mkdir -p .prebuilt-ui
tar -xzvf .tarballs/prometheus-web-ui-*.tar.gz -C .prebuilt-ui
- uses: prometheus/promci/build@13941414d409d227afd67544e5d306827db5a1a2 # v0.8.5
- uses: prometheus/promci/build@370e8c15dcec50043cbe66f2f34633d9efc0a190 # v0.9.0
with:
checkout: false
parallelism: 12
Expand Down Expand Up @@ -370,7 +370,7 @@ jobs:
needs: [test_ui, test_go, test_go_more, test_go_oldest, test_windows, golangci, codeql, build_all]
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main'
steps:
- uses: prometheus/promci/publish_main@13941414d409d227afd67544e5d306827db5a1a2 # v0.8.5
- uses: prometheus/promci/publish_main@370e8c15dcec50043cbe66f2f34633d9efc0a190 # v0.9.0
with:
docker_hub_login: ${{ secrets.docker_hub_login }}
docker_hub_password: ${{ secrets.docker_hub_password }}
Expand All @@ -389,7 +389,7 @@ jobs:
||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v3.'))
steps:
- uses: prometheus/promci/publish_release@13941414d409d227afd67544e5d306827db5a1a2 # v0.8.5
- uses: prometheus/promci/publish_release@370e8c15dcec50043cbe66f2f34633d9efc0a190 # v0.9.0
with:
docker_hub_login: ${{ secrets.docker_hub_login }}
docker_hub_password: ${{ secrets.docker_hub_password }}
Expand All @@ -411,7 +411,7 @@ jobs:
with:
persist-credentials: false
- name: Install nodejs
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version-file: "web/ui/.nvmrc"
registry-url: "https://registry.npmjs.org"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
runs-on: ubuntu-latest
steps:
- uses: actions/stale@eb5cf3af3ac0a1aa4c9c45633dd1ae542a27a899 # v10.3.0
- uses: actions/stale@1e223db275d687790206a7acac4d1a11bd6fe629 # v10.4.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# opt out of defaults to avoid marking issues as stale and closing them
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,12 @@ ui-build-module:
cd $(UI_PATH) && pnpm run build:module

.PHONY: ui-test
ui-test:
ui-test: ui-build-module
cd $(UI_PATH) && CI=true pnpm run test
# The old React app has been separated from the npm workspaces setup to avoid
# issues with conflicting dependencies. This is a temporary solution until the
# new Mantine-based UI is fully integrated and the old app can be removed.
cd $(UI_PATH)/react-app && CI=true pnpm run test

.PHONY: ui-lint
ui-lint:
Expand Down Expand Up @@ -172,7 +176,7 @@ install-goyacc:
ifeq ($(GO_ONLY),1)
test: common-test check-go-mod-version
else
test: check-generated-parser common-test check-node-version ui-build-module ui-test ui-lint check-go-mod-version
test: check-generated-parser common-test check-node-version ui-test ui-lint check-go-mod-version
endif

.PHONY: tarball
Expand Down Expand Up @@ -222,8 +226,8 @@ update-all-go-deps: update-go-deps
.PHONY: update-go-deps-in-dir
update-go-deps-in-dir:
@echo ">> updating Go dependencies in ./$(DIR)/"
# GOTOOLCHAIN prevents go get from pulling deps that require a newer Go version.
@cd ./$(DIR) && for m in $$($(GO) list -mod=readonly -m -f '{{ if and (not .Indirect) (not .Main)}}{{.Path}}{{end}}' all); do \
# Prevent go get from pulling deps that require a newer Go version.
GOTOOLCHAIN=go$$($(GO) mod edit -json | jq -r .Go) $(GO) get $$m; \
done
@cd ./$(DIR) && $(GO) mod tidy
Expand Down
2 changes: 1 addition & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ common-deps:
.PHONY: update-go-deps
update-go-deps:
@echo ">> updating Go dependencies"
# GOTOOLCHAIN prevents go get from pulling deps that require a newer Go version.
@for m in $$($(GO) list -mod=readonly -m -f '{{ if and (not .Indirect) (not .Main)}}{{.Path}}{{end}}' all); do \
# Prevent go get from pulling deps that require a newer Go version.
GOTOOLCHAIN=go$$($(GO) mod edit -json | jq -r .Go) $(GO) get $$m; \
done
$(GO) mod tidy
Expand Down
11 changes: 1 addition & 10 deletions cmd/prometheus/features_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"os"
"path/filepath"
"testing"
"time"

"github.com/stretchr/testify/require"

Expand Down Expand Up @@ -53,15 +52,7 @@ func TestFeaturesAPI(t *testing.T) {

baseURL := fmt.Sprintf("http://127.0.0.1:%d", port)

// Wait for Prometheus to be ready.
require.Eventually(t, func() bool {
resp, err := http.Get(baseURL + "/-/ready")
if err != nil {
return false
}
defer resp.Body.Close()
return resp.StatusCode == http.StatusOK
}, 10*time.Second, 100*time.Millisecond, "Prometheus didn't become ready in time")
waitForPrometheusReady(t, port)

// Fetch features from the API.
resp, err := http.Get(baseURL + "/api/v1/features")
Expand Down
44 changes: 43 additions & 1 deletion cmd/prometheus/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ import (
"github.com/prometheus/prometheus/util/documentcli"
"github.com/prometheus/prometheus/util/features"
"github.com/prometheus/prometheus/util/logging"
"github.com/prometheus/prometheus/util/memorylimiter"
"github.com/prometheus/prometheus/util/notifications"
prom_runtime "github.com/prometheus/prometheus/util/runtime"
"github.com/prometheus/prometheus/web"
Expand Down Expand Up @@ -217,6 +218,7 @@ type flagConfig struct {
enablePerStepStats bool
enableConcurrentRuleEval bool
useStartTimestamps bool
enableMemoryLimiter bool

prometheusURL string
corsRegexString string
Expand Down Expand Up @@ -345,6 +347,9 @@ func (c *flagConfig) setFeatureListOptions(logger *slog.Logger) error {
case "search-api":
c.web.EnableSearch = true
logger.Info("Experimental search API enabled.")
case "memory-limiter":
c.enableMemoryLimiter = true
logger.Info("Experimental memory limiter is enabled.")
default:
logger.Warn("Unknown option for --enable-feature", "option", o)
}
Expand Down Expand Up @@ -378,6 +383,7 @@ func main() {
collectors.NewGoCollector(
collectors.WithGoCollectorRuntimeMetrics(
collectors.MetricsGC,
collectors.MetricsMemory,
collectors.MetricsScheduler,
collectors.GoRuntimeMetricsRule{Matcher: goregexp.MustCompile(`^/sync/mutex/wait/total:seconds$`)},
),
Expand Down Expand Up @@ -645,7 +651,7 @@ func main() {
a.Flag("scrape.discovery-reload-interval", "Interval used by scrape manager to throttle target groups updates.").
Hidden().Default("5s").SetValue(&cfg.scrape.DiscoveryReloadInterval)

a.Flag("enable-feature", "Comma separated feature names to enable. Valid options: concurrent-rule-eval, created-timestamp-zero-ingestion, delayed-compaction, exemplar-storage, extra-scrape-metrics, histograms-st-encoding, memory-snapshot-on-shutdown, metadata-wal-records, old-ui, otlp-deltatocumulative, otlp-native-delta-ingestion, promql-binop-fill-modifiers, promql-delayed-name-removal, promql-experimental-functions, promql-extended-range-selectors, promql-per-step-stats, search-api, st-storage, st-synthesis, type-and-unit-labels, use-start-timestamps, use-uncached-io, xor2-encoding. See https://prometheus.io/docs/prometheus/latest/feature_flags/ for more details.").
a.Flag("enable-feature", "Comma separated feature names to enable. Valid options: concurrent-rule-eval, created-timestamp-zero-ingestion, delayed-compaction, exemplar-storage, extra-scrape-metrics, histograms-st-encoding, memory-limiter, memory-snapshot-on-shutdown, metadata-wal-records, old-ui, otlp-deltatocumulative, otlp-native-delta-ingestion, promql-binop-fill-modifiers, promql-delayed-name-removal, promql-experimental-functions, promql-extended-range-selectors, promql-per-step-stats, search-api, st-storage, st-synthesis, type-and-unit-labels, use-start-timestamps, use-uncached-io, xor2-encoding. See https://prometheus.io/docs/prometheus/latest/feature_flags/ for more details.").
StringsVar(&cfg.featureList)

a.Flag("agent", "Run Prometheus in 'Agent mode'.").BoolVar(&agentMode)
Expand Down Expand Up @@ -969,6 +975,18 @@ func main() {
os.Exit(1)
}

var memoryLimiter memorylimiter.MemoryLimiter
if cfg.enableMemoryLimiter {
ml, err := memorylimiter.NewManager(&cfgFile.Runtime.MemoryLimiter, logger.With("component", "memory limiter"), prometheus.DefaultRegisterer)
if err != nil {
logger.Error("failed to create memory limiter", "err", err)
os.Exit(1)
}
memoryLimiter = ml
cfg.scrape.MemoryLimiter = ml
cfg.web.MemoryLimiter = ml
}

scrapeManager, err := scrape.NewManager(
&cfg.scrape,
logger.With("component", "scrape manager"),
Expand Down Expand Up @@ -1037,6 +1055,7 @@ func main() {
},
FeatureRegistry: features.DefaultRegistry,
Parser: promqlParser,
MemoryLimiter: memoryLimiter,
})
}

Expand Down Expand Up @@ -1201,6 +1220,14 @@ func main() {
}, {
name: "tracing",
reloader: tracingManager.ApplyConfig,
}, {
name: "memory_limiter",
reloader: func(cfg *config.Config) error {
if memoryLimiter != nil {
return memoryLimiter.ApplyConfig(&cfg.Runtime.MemoryLimiter)
}
return nil
},
},
}

Expand Down Expand Up @@ -1294,6 +1321,21 @@ func main() {
},
)
}
if memoryLimiter != nil {
ctxML, cancelML := context.WithCancel(context.Background())
g.Add(
func() error {
memoryLimiter.Start(ctxML)
<-ctxML.Done()
return nil
},
func(error) {
logger.Info("Stopping memory limiter...")
cancelML()
memoryLimiter.Stop()
},
)
}
if !agentMode {
// Rule manager.
g.Add(
Expand Down
54 changes: 24 additions & 30 deletions cmd/prometheus/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,7 @@ storage:
)
require.NoError(t, prom.Start())

require.Eventually(t, func() bool {
r, err := http.Get(fmt.Sprintf("http://127.0.0.1:%d/metrics", port))
if err != nil {
return false
}
defer r.Body.Close()
return r.StatusCode == http.StatusOK
}, startupTime, 100*time.Millisecond)
waitForPrometheusReady(t, port)
require.DirExists(t, storagePath)
}

Expand Down Expand Up @@ -704,9 +697,6 @@ func TestModeSpecificFlags(t *testing.T) {
}

func TestDocumentation(t *testing.T) {
if runtime.GOOS == "windows" {
t.SkipNow()
}
t.Parallel()

ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
Expand All @@ -719,12 +709,17 @@ func TestDocumentation(t *testing.T) {

require.NoError(t, cmd.Run(), "failed to generate CLI documentation via --write-documentation")

generatedContent := strings.ReplaceAll(stdout.String(), filepath.Base(promPath), strings.TrimSuffix(filepath.Base(promPath), ".test"))
appTitle := strings.TrimSuffix(filepath.Base(promPath), ".test")
if runtime.GOOS == "windows" {
appTitle = strings.TrimSuffix(appTitle, ".test.exe")
}

generatedContent := strings.ReplaceAll(stdout.String(), filepath.Base(promPath), appTitle)

expectedContent, err := os.ReadFile(filepath.Join("..", "..", "docs", "command-line", "prometheus.md"))
require.NoError(t, err)

require.Equal(t, string(expectedContent), generatedContent, "Generated content does not match documentation. Hint: run `make cli-documentation`.")
require.Equal(t, strings.ReplaceAll(string(expectedContent), "\r\n", "\n"), generatedContent, "Generated content does not match documentation. Hint: run `make cli-documentation`.")
}

func TestRwProtoMsgFlagParser(t *testing.T) {
Expand Down Expand Up @@ -902,26 +897,24 @@ global:
fmt.Sprintf("--storage.tsdb.path=%s", tmpDir),
"--web.enable-lifecycle",
)
// Inject GOGC when set.
prom.Env = os.Environ()
// Inject GOGC when set, and drop any inherited one otherwise, so
// that the environment the test runs in cannot influence the cases
// expecting the default or the configured value.
prom.Env = slices.DeleteFunc(os.Environ(), func(kv string) bool {
return strings.HasPrefix(kv, "GOGC=")
})
if tc.gogcEnvVar != "" {
prom.Env = append(prom.Env, fmt.Sprintf("GOGC=%s", tc.gogcEnvVar))
}
require.NoError(t, prom.Start())

// Wait for the initial configuration to be applied: /metrics is
// already served before that happens.
waitForPrometheusReady(t, port)

ensureGOGCValue := func(val float64) {
var (
r *http.Response
err error
)
// Wait for the /metrics endpoint to be ready.
require.Eventually(t, func() bool {
r, err = http.Get(fmt.Sprintf("http://127.0.0.1:%d/metrics", port))
if err != nil {
return false
}
return r.StatusCode == http.StatusOK
}, 5*time.Second, 50*time.Millisecond)
r, err := http.Get(fmt.Sprintf("http://127.0.0.1:%d/metrics", port))
require.NoError(t, err)
defer r.Body.Close()

// Check the final GOGC that's set, consider go_gc_gogc_percent from /metrics as source of truth.
Expand Down Expand Up @@ -1216,9 +1209,6 @@ remote_write:
// TestFeatureFlagsDocumented ensures the --enable-feature help text in main.go
// and the documented flags in docs/feature_flags.md list the same set of flags.
func TestFeatureFlagsDocumented(t *testing.T) {
if runtime.GOOS == "windows" {
t.SkipNow()
}
h, err := os.ReadFile(filepath.Join("..", "..", "cmd", "prometheus", "main.go"))
require.NoError(t, err)
m := regexp.MustCompile(`a\.Flag\("enable-feature", "Comma separated feature names to enable. Valid options: (.+?)\.`).FindSubmatch(h)
Expand All @@ -1230,6 +1220,10 @@ func TestFeatureFlagsDocumented(t *testing.T) {
require.NotEmpty(t, helpFlags)

d, err := os.ReadFile(filepath.Join("..", "..", "docs", "feature_flags.md"))
if runtime.GOOS == "windows" {
d = bytes.ReplaceAll(d, []byte("\r\n"), []byte("\n"))
}

require.NoError(t, err)
var docFlags []string
for _, dm := range regexp.MustCompile("(?m)^`--enable-feature=(.+)`$").FindAllSubmatch(d, -1) {
Expand Down
31 changes: 23 additions & 8 deletions cmd/prometheus/reload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,7 @@ func runTestSteps(t *testing.T, steps []struct {
require.NoError(t, prom.Start())

baseURL := "http://localhost:" + strconv.Itoa(port)
require.Eventually(t, func() bool {
resp, err := http.Get(baseURL + "/-/ready")
if err != nil {
return false
}
defer resp.Body.Close()
return resp.StatusCode == http.StatusOK
}, 5*time.Second, 100*time.Millisecond, "Prometheus didn't become ready in time")
waitForPrometheusReady(t, port)

for i, step := range steps {
t.Logf("Step %d", i)
Expand Down Expand Up @@ -241,3 +234,25 @@ func prometheusCommandWithLogging(t testing.TB, configFilePath string, port int,
args = append(args, extraArgs...)
return commandWithLogging(t, nil, promPath, args...)
}

// readyTimeout is how long we wait for a Prometheus process to become ready. It
// is generous on purpose: CI runs these tests with the race detector, which
// slows down both the test binary and the Prometheus processes it spawns in
// parallel.
const readyTimeout = 30 * time.Second

// waitForPrometheusReady waits until the Prometheus instance listening on port
// reports itself as ready, which means it has opened its storage and applied
// its initial configuration.
func waitForPrometheusReady(t testing.TB, port int) {
t.Helper()

require.Eventually(t, func() bool {
resp, err := http.Get("http://127.0.0.1:" + strconv.Itoa(port) + "/-/ready")
if err != nil {
return false
}
defer resp.Body.Close()
return resp.StatusCode == http.StatusOK
}, readyTimeout, 100*time.Millisecond, "Prometheus didn't become ready in time")
}
2 changes: 1 addition & 1 deletion compliance/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module compliance

go 1.25.8
go 1.25.10

require github.com/prometheus/compliance/remotewrite v0.0.0-20260223092825-818283e1171e

Expand Down
Loading
Loading