()
| 186 | } |
| 187 | |
| 188 | func (h *Handler) getOrCreateSlowQueryMetric() *prometheus.CounterVec { |
| 189 | h.initSlowQueryMetric.Do(func() { |
| 190 | h.slowQueries = promauto.With(h.reg).NewCounterVec( |
| 191 | prometheus.CounterOpts{ |
| 192 | Name: "cortex_slow_queries_total", |
| 193 | Help: "The total number of slow queries.", |
| 194 | }, |
| 195 | []string{"source", "user"}, |
| 196 | ) |
| 197 | }) |
| 198 | return h.slowQueries |
| 199 | } |
| 200 | |
| 201 | func (h *Handler) cleanupMetricsForInactiveUser(user string) { |
| 202 | if !h.cfg.QueryStatsEnabled { |