Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 462
fix: preserve Connection host path when proxying PromQL#3047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kodiakhq
merged 19 commits into
hyperdxio:main
from
milansanjeev:fix/promql-proxy-preserve-host-pathSep 4, 2026
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
94bdea2
fix: preserve Connection host path when proxying PromQL
cursoragent 70b886d
fix: address PromQL proxy review comments
cursoragent 5c2e40e
fix: address remaining PromQL proxy review comments
cursoragent 0392ee4
Merge branch 'main' into fix/promql-proxy-preserve-host-path
milansanjeev e6ba980
Merge branch 'main' into fix/promql-proxy-preserve-host-path
milansanjeev ff0fd28
fix(api): address remaining PromQL proxy review findings
milansanjeev 1141556
fix(api): userinfo redaction regex missed scheme-less hosts, leaking …
milansanjeev e79d4d6
test(api): pin credential redaction at the proxy call site, not just …
milansanjeev 13770ab
fix(api): strip a password containing "@" fully, not just up to its f…
milansanjeev 9e0400e
fix(api): restrict caller-overridable PromQL params to a real allowli…
milansanjeev 9af65f4
fix(api): drop query/hash from the displayed upstream target, not jus…
milansanjeev b84ef5f
chore(api): address final PromQL proxy review nitpicks
milansanjeev 03dbb89
fix(api): allowlist was silently dropping the real timeout/stats params
milansanjeev 858928b
test(api): add symmetric stats-override test; clarify changeset drop …
milansanjeev caa9654
Merge branch 'main' into fix/promql-proxy-preserve-host-path
milansanjeev bc790bc
Merge branch 'main' into fix/promql-proxy-preserve-host-path
milansanjeev 8cc3453
Merge branch 'main' into fix/promql-proxy-preserve-host-path
milansanjeev de4026b
style(api): fix prettier formatting in the integration test file
milansanjeev 9b06e71
Merge branch 'main' into fix/promql-proxy-preserve-host-path
pulpdrew File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| --- | ||
| '@hyperdx/api': minor | ||
| --- | ||
| fix: preserve a Connection host path prefix when proxying PromQL. | ||
| `proxyToPrometheus` joined absolute Prometheus paths (`/api/v1/query_range`, | ||
| `/api/v1/query`, `/api/v1/query_exemplars`, `/api/v1/label/.../values`) with | ||
| `new URL(path, host)`, which replaces the host pathname instead of appending to | ||
| it. VictoriaMetrics cluster `vmselect` URLs such as | ||
| `http://vmselect:8481/select/0/prometheus` were rewritten to | ||
| `/api/v1/query_range` and rejected. The join now keeps the existing pathname. | ||
| This is a behavior change for Connections whose host already included a path | ||
| that was never meant as a Prometheus API prefix — for example | ||
| `http://prom:9090/graph` copied from the Prometheus UI. That previously happened | ||
| to work because the absolute API path replaced `/graph`; requests now go to | ||
| `/graph/api/v1/query_range` and will 404. Trim stray paths from existing | ||
| Connection hosts before upgrading. Root-mounted hosts (`http://prom:9090` or | ||
| `http://prom:9090/`) are unchanged. | ||
| Query parameters on the Connection host are now only a fallback for a fixed set | ||
| of real Prometheus API params (`query`, `time`, `start`, `end`, `step`, | ||
| `match`/`match[]`, `limit`, `timeout`, `stats`): a request value for one of | ||
| these (including repeatable ones such as `match[]`) always wins and replaces a | ||
| same-named host value outright, rather than being dropped. Any other host query | ||
| key the request never mentions -- for example `?extra_label=namespace%3Dprod` | ||
| pinning a VictoriaMetrics tenant scope -- is left as-is and is never overridable | ||
| by the request, since a param name outside that fixed set is not forwarded at | ||
| all regardless of what the host carries. This also means a host copied with a | ||
| stray query string (not just a stray path) now forwards its non-Prometheus keys | ||
| upstream as a fallback on every request -- trim those too if they weren't | ||
| intended as Prometheus API params. | ||
| This is also a behavior change for a direct API caller (e.g. curl or Terraform) | ||
| that previously relied on sending an arbitrary, non-Prometheus query param | ||
| through this endpoint: that param is now silently dropped rather than forwarded, | ||
| regardless of whether the Connection host carries anything under the same name. | ||
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Uh oh!
There was an error while loading. Please reload this page.