Skip to content
Merged
Show file tree
Hide file tree
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 Sep 1, 2026
70b886d
fix: address PromQL proxy review comments
cursoragent Sep 1, 2026
5c2e40e
fix: address remaining PromQL proxy review comments
cursoragent Sep 2, 2026
0392ee4
Merge branch 'main' into fix/promql-proxy-preserve-host-path
milansanjeev Sep 2, 2026
e6ba980
Merge branch 'main' into fix/promql-proxy-preserve-host-path
milansanjeev Sep 3, 2026
ff0fd28
fix(api): address remaining PromQL proxy review findings
milansanjeev Sep 3, 2026
1141556
fix(api): userinfo redaction regex missed scheme-less hosts, leaking …
milansanjeev Sep 3, 2026
e79d4d6
test(api): pin credential redaction at the proxy call site, not just …
milansanjeev Sep 3, 2026
13770ab
fix(api): strip a password containing "@" fully, not just up to its f…
milansanjeev Sep 3, 2026
9e0400e
fix(api): restrict caller-overridable PromQL params to a real allowli…
milansanjeev Sep 3, 2026
9af65f4
fix(api): drop query/hash from the displayed upstream target, not jus…
milansanjeev Sep 3, 2026
b84ef5f
chore(api): address final PromQL proxy review nitpicks
milansanjeev Sep 3, 2026
03dbb89
fix(api): allowlist was silently dropping the real timeout/stats params
milansanjeev Sep 3, 2026
858928b
test(api): add symmetric stats-override test; clarify changeset drop …
milansanjeev Sep 3, 2026
caa9654
Merge branch 'main' into fix/promql-proxy-preserve-host-path
milansanjeev Sep 3, 2026
bc790bc
Merge branch 'main' into fix/promql-proxy-preserve-host-path
milansanjeev Sep 3, 2026
8cc3453
Merge branch 'main' into fix/promql-proxy-preserve-host-path
milansanjeev Sep 4, 2026
de4026b
style(api): fix prettier formatting in the integration test file
milansanjeev Sep 4, 2026
9b06e71
Merge branch 'main' into fix/promql-proxy-preserve-host-path
pulpdrew Sep 4, 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
37 changes: 37 additions & 0 deletions .changeset/promql-proxy-preserve-host-path.md
Original file line numberDiff line numberDiff 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
Comment thread
milansanjeev marked this conversation as resolved.
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.
Loading
Loading