Skip to content

web/api: compute relabel_steps in a single pass#17969

Merged
juliusv merged 1 commit intoprometheus:mainfrom
1seal:relabel-steps-linear
Jan 29, 2026
Merged

web/api: compute relabel_steps in a single pass#17969
juliusv merged 1 commit intoprometheus:mainfrom
1seal:relabel-steps-linear

Conversation

@1seal
Copy link
Contributor

@1seal 1seal commented Jan 29, 2026

this changes GET /api/v1/targets/relabel_steps to compute outputs incrementally (single pass) instead of re-running relabeling for each prefix.

  • preserves existing response shape and semantics (including dropped targets)
  • no new input validation/limits (per discussion)
  • adds a regression test to ensure we stop applying further rules after a drop

tests: go test ./web/api/v1 -run TestEndpoints

Which issue(s) does the PR fix:

N/A (performance improvement suggested via security@ discussion)

Does this PR introduce a user-facing change?

[PERF] API: Compute /api/v1/targets/relabel_steps in a single pass instead of re-running relabeling for each prefix.

@1seal 1seal requested a review from a team as a code owner January 29, 2026 12:17
@1seal 1seal requested a review from aknuds1 January 29, 2026 12:17
Signed-off-by: 1seal <security@1seal.org>
@1seal 1seal force-pushed the relabel-steps-linear branch from abad143 to 79b5534 Compare January 29, 2026 12:23
Copy link
Member

@juliusv juliusv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you 👍

@juliusv juliusv merged commit 0c543d5 into prometheus:main Jan 29, 2026
32 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants