What happened?
proxyToPrometheus builds the upstream URL with new URL(path, upstreamHost) (packages/api/src/routers/api/prometheus.ts). Every proxied path is absolute (/api/v1/query_range, /api/v1/query, /api/v1/query_exemplars, /api/v1/label/${labelName}/values).
JavaScript's URL(absolutePath, base)replaces the base URL's pathname instead of appending to it, so any path segment configured on the Connection host is silently dropped.
This makes PromQL fundamentally incompatible with VictoriaMetrics cluster mode, which requires /select/<accountID>/prometheus on every request. Single-node Prometheus / Thanos / VM single-node are unaffected because they serve at /.
Steps to reproduce
- Set a Connection's Host to a VictoriaMetrics cluster
vmselect endpoint with its required tenant path, e.g. http://<vmselect-host>:8481/select/0/prometheus - Enable Prometheus compatible on that connection
- Create a PromQL source against it
- Run any query (or open the metrics browser, which hits
/label/__name__/values)
Expected
http://<vmselect-host>:8481/select/0/prometheus/api/v1/query_range?...
Actual
http://<vmselect-host>:8481/api/v1/query_range?...
VictoriaMetrics rejects it with:
unsupported URL format for path "/api/v1/query_range". Make sure you're using cluster URL format...
Same failure on /api/v1/label/__name__/values.
How are you running HyperDX?
Self-hosted HyperDX with an external Prometheus-compatible Connection pointed at VictoriaMetrics cluster vmselect.
Where does it show up?
- Search / charts PromQL queries (
/query_range, /query) - Metrics browser label values
- Exemplars proxy (
/query_exemplars)
Suggested fix
Join the base URL's existing pathname with path instead of letting URL()'s absolute-path resolution discard it:
consturl=newURL(upstreamHost);url.pathname=url.pathname.replace(/\/$/,'')+path;
Keep query/search/auth from the Connection host; only the pathname join changes.
Additional context
Introduced with the external Prometheus datastore proxy (#2518). proxyToPrometheus is the shared helper for all four routes above, so one pathname-join fix covers all of them.
What happened?
proxyToPrometheusbuilds the upstream URL withnew URL(path, upstreamHost)(packages/api/src/routers/api/prometheus.ts). Every proxied path is absolute (/api/v1/query_range,/api/v1/query,/api/v1/query_exemplars,/api/v1/label/${labelName}/values).JavaScript's
URL(absolutePath, base)replaces the base URL's pathname instead of appending to it, so any path segment configured on the Connection host is silently dropped.This makes PromQL fundamentally incompatible with VictoriaMetrics cluster mode, which requires
/select/<accountID>/prometheuson every request. Single-node Prometheus / Thanos / VM single-node are unaffected because they serve at/.Steps to reproduce
vmselectendpoint with its required tenant path, e.g.http://<vmselect-host>:8481/select/0/prometheus/label/__name__/values)Expected
Actual
VictoriaMetrics rejects it with:
Same failure on
/api/v1/label/__name__/values.How are you running HyperDX?
Self-hosted HyperDX with an external Prometheus-compatible Connection pointed at VictoriaMetrics cluster
vmselect.Where does it show up?
/query_range,/query)/query_exemplars)Suggested fix
Join the base URL's existing pathname with
pathinstead of lettingURL()'s absolute-path resolution discard it:Keep query/search/auth from the Connection host; only the pathname join changes.
Additional context
Introduced with the external Prometheus datastore proxy (
#2518).proxyToPrometheusis the shared helper for all four routes above, so one pathname-join fix covers all of them.