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 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) {
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
}