Skip to content

Commit

Permalink
Report all backend metrics
Browse files Browse the repository at this point in the history
When no servers are exposed, backend metrics are needed to see
how many requests are making it to a service. If we don't report
them users can't see when no pods are up (a crashlooping service
for instance would have no metrics at all because no pods are
ready). Always report all backend metrics. Increases cardinality
by O(routes), but prometheus is a lot faster now.
  • Loading branch information
smarterclayton committed May 18, 2020
1 parent 46dffea commit 3b287c6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/router/metrics/haproxy/haproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,7 @@ func (e *Exporter) collectMetrics(metrics chan<- prometheus.Metric) {
for _, m := range e.frontendMetrics {
m.Collect(metrics)
}
for i, m := range e.backendMetrics {
if _, ok := e.reducedBackendExports[i]; !e.serverLimited && !ok {
continue
}
for _, m := range e.backendMetrics {
m.Collect(metrics)
}
if !e.serverLimited {
Expand Down

0 comments on commit 3b287c6

Please sign in to comment.