ServeHTTP serves the status of the alertmanager.
(w http.ResponseWriter, _ *http.Request)
| 96 | |
| 97 | // ServeHTTP serves the status of the alertmanager. |
| 98 | func (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 | } |