MCPcopy
hub / github.com/prometheus/pushgateway / Ready

Function Ready

handler/misc.go:48–60  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

46//
47// The returned handler is already instrumented for Prometheus.
48func 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//

Callers 2

mainFunction · 0.92
TestHealthyReadyFunction · 0.85

Calls 3

InstrumentWithCounterFunction · 0.85
ErrorMethod · 0.80
ReadyMethod · 0.65

Tested by 1

TestHealthyReadyFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…