Skip to content

Commit

Permalink
fix scraping healthz metrics endpoint (#232)
Browse files Browse the repository at this point in the history
Signed-off-by: Reinier Schoof <reinier@skoef.nl>
  • Loading branch information
skoef authored Oct 26, 2023
1 parent 0fd6d26 commit dcc53f7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions collector/healthz.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ import (
"github.com/prometheus/client_golang/prometheus"
)

const (
healthzEndpoint = "healthz"
)

func isHealthzEndpoint(system, endpoint string) bool {
return system == CoreSystem && endpoint == "healthz"
return system == CoreSystem && endpoint == healthzEndpoint
}

type healthzCollector struct {
Expand All @@ -49,7 +53,7 @@ func newHealthzCollector(system, endpoint string, servers []*CollectedServer) pr
for i, s := range servers {
nc.servers[i] = &CollectedServer{
ID: s.ID,
URL: s.URL + endpoint,
URL: s.URL + "/" + healthzEndpoint,
}
}

Expand Down

0 comments on commit dcc53f7

Please sign in to comment.