We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da708e7 commit 36bacbaCopy full SHA for 36bacba
cmd/server/main.go
@@ -2,6 +2,7 @@ package main
2
3
import (
4
"fmt"
5
+ "io"
6
"net/http"
7
_ "net/http/pprof"
8
"os"
@@ -43,6 +44,13 @@ func main() {
43
44
45
// Admin and profiling server.
46
go func() {
47
+ http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
48
+ w.WriteHeader(http.StatusOK)
49
+ _, err := io.WriteString(w, "consult metrics at /metrics")
50
+ if err != nil {
51
+ app.Logger.Err(err).Msg("failed to write admin response body")
52
+ }
53
+ })
54
http.Handle("/metrics", promhttp.HandlerFor(app.PromRegistry, promhttp.HandlerOpts{
55
ErrorLog: &app.Logger,
56
ErrorHandling: promhttp.HTTPErrorOnError,
0 commit comments