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 c28f059 commit 0e1c515Copy full SHA for 0e1c515
cmd/server.go
@@ -71,7 +71,15 @@ to quickly create a Cobra application.`,
71
IdleTimeout: time.Second * 60,
72
}
73
74
- http.Handle(metricsEndpoint, promhttp.Handler())
+ opts := promhttp.HandlerOpts{
75
+ Timeout: 5 * time.Second,
76
+ MaxRequestsInFlight: 2,
77
+ }
78
+ handler := promhttp.InstrumentMetricHandler(
79
+ prometheus.DefaultRegisterer,
80
+ promhttp.HandlerFor(prometheus.DefaultGatherer, opts),
81
+ )
82
+ http.Handle(metricsEndpoint, handler)
83
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
84
_, err := w.Write([]byte(`<html>
85
<head><title>php-fpm_exporter</title></head>
0 commit comments