Skip to content

Commit

Permalink
Fix panic in "Add total requests per colocation" (#71)
Browse files Browse the repository at this point in the history
Co-authored-by: Laurynas Četyrkinas <[email protected]>
  • Loading branch information
stnby and stnby authored Jul 27, 2022
1 parent fa0fe1b commit c17dc2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ var (
zoneColocationRequestsTotal = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "cloudflare_zone_colocation_requests_total",
Help: "Total requests per colocation",
}, []string{"zone", "colocation"},
}, []string{"zone", "colocation", "host"},
)

zoneFirewallEventsCount = promauto.NewCounterVec(prometheus.CounterOpts{
Expand Down Expand Up @@ -246,7 +246,7 @@ func fetchZoneColocationAnalytics(zones []cloudflare.Zone, wg *sync.WaitGroup) {
for _, c := range cg {
zoneColocationVisits.With(prometheus.Labels{"zone": name, "colocation": c.Dimensions.ColoCode, "host": c.Dimensions.Host}).Add(float64(c.Sum.Visits))
zoneColocationEdgeResponseBytes.With(prometheus.Labels{"zone": name, "colocation": c.Dimensions.ColoCode, "host": c.Dimensions.Host}).Add(float64(c.Sum.EdgeResponseBytes))
zoneColocationRequestsTotal.With(prometheus.Labels{"zone": name, "colocation": c.Dimensions.ColoCode, "host": c.Dimensions.Host}).Add(float64(c.Count))
zoneColocationRequestsTotal.With(prometheus.Labels{"zone": name, "colocation": c.Dimensions.ColoCode, "host": c.Dimensions.Host}).Add(float64(c.Count))
}
}
}
Expand Down

0 comments on commit c17dc2f

Please sign in to comment.