register federation failure metrics (#7081)

Closes gh-7080

Signed-off-by: Julian Taylor <juliantaylor108@gmail.com>
pull/7035/head
Julian Taylor 2020-04-06 10:05:01 +02:00 committed by GitHub
parent 62bd77bf93
commit 05442b31c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -44,6 +44,10 @@ var (
}) })
) )
func registerFederationMetrics(r prometheus.Registerer) {
r.MustRegister(federationWarnings, federationErrors)
}
func (h *Handler) federation(w http.ResponseWriter, req *http.Request) { func (h *Handler) federation(w http.ResponseWriter, req *http.Request) {
h.mtx.RLock() h.mtx.RLock()
defer h.mtx.RUnlock() defer h.mtx.RUnlock()

View File

@ -139,6 +139,7 @@ func newMetrics(r prometheus.Registerer) *metrics {
if r != nil { if r != nil {
r.MustRegister(m.requestCounter, m.requestDuration, m.responseSize) r.MustRegister(m.requestCounter, m.requestDuration, m.responseSize)
registerFederationMetrics(r)
} }
return m return m
} }