Skip to content

Commit

Permalink
feat: add ayd_healthy for ayd itself to prometheus metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
macrat committed Apr 23, 2021
1 parent 7c046a9 commit 80e1a94
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions exporter/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ func MetricsExporter(s *store.Store) http.HandlerFunc {
fmt.Fprintln(w)
}
}

fmt.Fprintln(w, "# HELP ayd_healthy 1 if target is healthy, otherwise 0.")
fmt.Fprintln(w, "# TYPE ayd_healthy Gauge")
if s.Err() == nil {
fmt.Fprintln(w, `ayd_healthy{target="ayd"} 1`)
} else {
fmt.Fprintln(w, `ayd_healthy{target="ayd"} 0`)
}

fmt.Fprintln(w)
fmt.Fprintln(w, "# HELP ayd_incident_count The number of incident happend since server started")
fmt.Fprintln(w, "# TYPE ayd_incident_count Counter")
Expand Down

0 comments on commit 80e1a94

Please sign in to comment.