Skip to content

Commit

Permalink
Add health check endpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Heberle <[email protected]>
  • Loading branch information
andrewheberle authored Feb 5, 2025
1 parent a16bbb6 commit 634343b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ func main() {
handler(w, r, logger, exporterMetrics)
})
http.HandleFunc("/-/reload", updateConfiguration) // Endpoint to reload configuration.
// Endpoint to respond to health checks
http.HandleFunc("/-/healthy", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write([]byte("Healthy"))
})

if *metricsPath != "/" && *metricsPath != "" {
landingConfig := web.LandingConfig{
Expand Down

0 comments on commit 634343b

Please sign in to comment.