Skip to content

Commit

Permalink
register federation failure metrics (prometheus#7081)
Browse files Browse the repository at this point in the history
Closes prometheusgh-7080

Signed-off-by: Julian Taylor <juliantaylor108@gmail.com>
  • Loading branch information
juliantaylor authored and roidelapluie committed Apr 17, 2020
1 parent a2fcdeb commit e2c06a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/federate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit e2c06a8

Please sign in to comment.