Werk #20185: Prometheus special agent: fix wrong URL for reverse-proxied connections
| Component | Checks & agents | ||||||
| Title | Prometheus special agent: fix wrong URL for reverse-proxied connections | ||||||
| Date | Jul 21, 2026 | ||||||
| Level | Trivial Change | ||||||
| Class | Bug Fix | ||||||
| Compatibility | Compatible - no manual interaction needed | ||||||
| Checkmk versions & editions |
|
Previously, when the Prometheus "URL server address" (connection) included a
path suffix, for example when Prometheus runs behind a reverse proxy under a
subpath like example.com/prometheus, the special agent queried the wrong
URL when looking up the Prometheus build info (used for the Prometheus
Build service). The subpath, together with the API's /api/v1/ prefix, was
silently dropped from the request URL.
Depending on how the reverse proxy responded to that wrong URL, this could make the special agent fail with an error such as:
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
This has been fixed. The special agent now queries these endpoints under the full configured URL, including any reverse-proxy subpath.
Technical background
The bug was caused by a leading slash in the endpoint paths passed to the
special agent's internal HTTP client. Combined with Python's
urllib.parse.urljoin(), a leading slash resolves the endpoint relative to
the domain root instead of the configured base URL, discarding the /api/v1/
prefix and any reverse-proxy subpath.