register federation failure metrics (#7081)

Closes gh-7080

Signed-off-by: Julian Taylor <juliantaylor108@gmail.com>
This commit is contained in:
Julian Taylor 2020-04-06 10:05:01 +02:00 committed by Julien Pivotto
parent a2fcdeb1ef
commit e2c06a8898
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) {
h.mtx.RLock()
defer h.mtx.RUnlock()

View file

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