(zones []string)
| 845 | } |
| 846 | |
| 847 | func (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! |
| 868 | func (r *Ring) updateRingMetrics() { |
no test coverage detected