Ready is used to report if the Pushgateway is ready to process requests. It currently only uses the Ready method of the MetricScore to detect ready state. The returned handler is already instrumented for Prometheus.
(ms storage.MetricStore)
| 46 | // |
| 47 | // The returned handler is already instrumented for Prometheus. |
| 48 | func Ready(ms storage.MetricStore) http.Handler { |
| 49 | return InstrumentWithCounter( |
| 50 | "ready", |
| 51 | http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { |
| 52 | err := ms.Ready() |
| 53 | if err == nil { |
| 54 | io.WriteString(w, "OK") |
| 55 | } else { |
| 56 | http.Error(w, err.Error(), http.StatusInternalServerError) |
| 57 | } |
| 58 | }), |
| 59 | ) |
| 60 | } |
| 61 | |
| 62 | // Static serves the static files from the provided http.FileSystem. |
| 63 | // |
searching dependent graphs…