MCPcopy Create free account
hub / github.com/cortexproject/cortex / getOrCreateSlowQueryMetric

Method getOrCreateSlowQueryMetric

pkg/frontend/transport/handler.go:188–199  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

186}
187
188func (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
201func (h *Handler) cleanupMetricsForInactiveUser(user string) {
202 if !h.cfg.QueryStatsEnabled {

Callers 2

ServeHTTPMethod · 0.95

Calls 1

DoMethod · 0.65

Tested by 1