Skip to content

Commit

Permalink
Fix Prometheus metrics format.
Browse files Browse the repository at this point in the history
  • Loading branch information
a-bali committed Feb 25, 2024
1 parent bee93de commit 84432ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1102,8 +1102,8 @@ func serveAPIStats(w http.ResponseWriter, r *http.Request) {
func serveAPIMetrics(w http.ResponseWriter, r *http.Request) {
debug("Web request " + r.RequestURI + " from " + r.RemoteAddr)
w.Header().Set("Content-Type", "text/plain")
fmt.Fprintln(w, "HELP janitor_targets Number of Janitor targets")
fmt.Fprintln(w, "TYPE janitor_targets gauge")
fmt.Fprintln(w, "# HELP janitor_targets Number of Janitor targets")
fmt.Fprintln(w, "# TYPE janitor_targets gauge")
up, down := calcStats()
for t, c := range up {
fmt.Fprintf(w, "janitor_targets{state=\"%s\", type=\"%s\", host=\"%s\"} %d\n", "up", t, config.HostName, c)
Expand Down

0 comments on commit 84432ba

Please sign in to comment.