MCPcopy Create free account
hub / github.com/cortexproject/cortex / ServeHTTP

Method ServeHTTP

pkg/alertmanager/alertmanager_http.go:98–112  ·  view source on GitHub ↗

ServeHTTP serves the status of the alertmanager.

(w http.ResponseWriter, _ *http.Request)

Source from the content-addressed store, hash-verified

96
97// ServeHTTP serves the status of the alertmanager.
98func (s StatusHandler) ServeHTTP(w http.ResponseWriter, _ *http.Request) {
99 var clusterInfo map[string]any
100 if s.am.peer != nil {
101 clusterInfo = s.am.peer.Info()
102 }
103 err := statusTemplate.Execute(w, struct {
104 ClusterInfo map[string]any
105 }{
106 ClusterInfo: clusterInfo,
107 })
108 if err != nil {
109 level.Error(util_log.Logger).Log("msg", "unable to serve alertmanager status page", "err", err)
110 http.Error(w, err.Error(), http.StatusInternalServerError)
111 }
112}

Calls 2

LogMethod · 0.45
ErrorMethod · 0.45