ui: add opt-in targets scrape proxy for viewing metrics#18443
Open
charanbhatia wants to merge 6 commits intoprometheus:mainfrom
Open
ui: add opt-in targets scrape proxy for viewing metrics#18443charanbhatia wants to merge 6 commits intoprometheus:mainfrom
charanbhatia wants to merge 6 commits intoprometheus:mainfrom
Conversation
Add --web.enable-target-scrape-proxy, GET /api/v1/targets/scrape, and View metrics on the Targets page (Mantine + classic UI). Proxy scrapes only active targets using the pool's HTTP client, with size and timeout limits. Signed-off-by: Charanjeet Bhatia <[email protected]> Made-with: Cursor
added 4 commits
April 3, 2026 23:38
- Refresh openapi_3.1/3.2 golden YAML for /targets/scrape. - Refactor TargetScrapeProxyContext to match existing context style and satisfy Prettier. Signed-off-by: Charanjeet Bhatia <[email protected]> Made-with: Cursor
- Pass enableTargetScrapeProxy in App.test.tsx for AppProps. - Use for range 1024 in scrape proxy test per modernize linter. Signed-off-by: Charanjeet Bhatia <[email protected]> Made-with: Cursor
Use atomic.Int64 for handler delay so the httptest server and test do not race. Signed-off-by: Charanjeet Bhatia <[email protected]> Made-with: Cursor
depguard forbids sync/atomic; uber atomic matches project convention. Signed-off-by: Charanjeet Bhatia <[email protected]> Made-with: Cursor
Signed-off-by: Charanjeet Bhatia <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add --web.enable-target-scrape-proxy, GET /api/v1/targets/scrape, and View metrics on the Targets page (Mantine + classic UI). Proxy scrapes only active targets using the pool's HTTP client, with size and timeout limits.
Which issue(s) does the PR fix:
Targets listed in the UI are often only reachable from Prometheus (e.g. in-cluster Kubernetes pods), so the scrape URL cannot be opened from the browser. This adds an opt-in way to run that scrape inside Prometheus and show the raw body in the UI, addressing the linked feature discussion (CLI-gated / flag approach agreed with maintainers).
Fixes #17801
Release notes for end users (ALL commits must be considered).