MCPcopy
hub / github.com/grafana/dskit / updateRingZones

Method updateRingZones

ring/ring.go:847–865  ·  view source on GitHub ↗
(zones []string)

Source from the content-addressed store, hash-verified

845}
846
847func (r *Ring) updateRingZones(zones []string) {
848 r.ringZones = zones
849 var notAdded []string
850 for _, zone := range zones {
851 if _, ok := r.trackedRingZones[zone]; !ok {
852 if len(r.trackedRingZones) >= maxZonesForMetrics {
853 notAdded = append(notAdded, zone)
854 } else {
855 r.trackedRingZones[zone] = struct{}{}
856 }
857 }
858 }
859 if len(notAdded) > 0 {
860 level.Warn(r.logger).Log(
861 "msg", "not tracking metrics for zone(s) due to high cardinality",
862 "zones", strings.Join(notAdded, ","),
863 )
864 }
865}
866
867// updateRingMetrics updates ring metrics. Caller must be holding the Write lock!
868func (r *Ring) updateRingMetrics() {

Callers 2

setRingStateFromDescMethod · 0.95
buildRingForTheShardMethod · 0.95

Calls 1

LogMethod · 0.45

Tested by

no test coverage detected