mirror of
https://github.com/prometheus/prometheus.git
synced 2026-06-09 08:32:26 -04:00
CheckServerStatus built the request URL by concatenating the
user-provided URL with the endpoint path:
serverURL.String() + checkEndpoint
When the URL ends with a slash (e.g. "http://localhost:9090/"), this
produces a doubled slash like "http://localhost:9090//-/healthy". The
Prometheus router registers "/-/healthy" and "/-/ready" exactly and
does not collapse repeated slashes, so the request 404s and
"promtool check healthy" / "promtool check ready" fail.
Use url.JoinPath to append the endpoint, which normalises the slash and
also handles a configured route prefix correctly. JoinPath returns a new
URL, so the original is left untouched for the error message.
Signed-off-by: kigland <shuaizhicheng336@gmail.com>
|
||
|---|---|---|
| .. | ||
| testdata | ||
| analyze.go | ||
| analyze_test.go | ||
| archive.go | ||
| backfill.go | ||
| backfill_test.go | ||
| debug.go | ||
| main.go | ||
| main_test.go | ||
| metrics.go | ||
| metrics_test.go | ||
| query.go | ||
| rules.go | ||
| rules_test.go | ||
| sd.go | ||
| sd_test.go | ||
| tsdb.go | ||
| tsdb_posix_test.go | ||
| tsdb_test.go | ||
| unittest.go | ||
| unittest_test.go | ||