| 183 | } |
| 184 | |
| 185 | func (m *MultiClient) registerMetrics(registerer prometheus.Registerer) { |
| 186 | m.primaryStoreGauge = promauto.With(registerer).NewGaugeVec(prometheus.GaugeOpts{ |
| 187 | Name: "multikv_primary_store", |
| 188 | Help: "Selected primary KV store", |
| 189 | }, []string{"store"}) |
| 190 | |
| 191 | m.mirrorEnabledGauge = promauto.With(registerer).NewGauge(prometheus.GaugeOpts{ |
| 192 | Name: "multikv_mirror_enabled", |
| 193 | Help: "Is mirroring to secondary store enabled", |
| 194 | }) |
| 195 | |
| 196 | m.mirrorWritesCounter = promauto.With(registerer).NewCounter(prometheus.CounterOpts{ |
| 197 | Name: "multikv_mirror_writes_total", |
| 198 | Help: "Number of mirror-writes to secondary store", |
| 199 | }) |
| 200 | |
| 201 | m.mirrorFailuresCounter = promauto.With(registerer).NewCounter(prometheus.CounterOpts{ |
| 202 | Name: "multikv_mirror_write_errors_total", |
| 203 | Help: "Number of failures to mirror-write to secondary store", |
| 204 | }) |
| 205 | } |
| 206 | |
| 207 | func (m *MultiClient) updatePrimaryStoreGauge() { |
| 208 | _, pkv := m.getPrimaryClient() |