mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Metrics: Expose functions to initialize counters at zero (#50122)
This commit is contained in:
committed by
GitHub
parent
ed6a887737
commit
97baa6911d
@@ -2,6 +2,7 @@ package manager
|
||||
|
||||
import (
|
||||
"github.com/grafana/grafana/pkg/infra/metrics"
|
||||
"github.com/grafana/grafana/pkg/infra/metrics/metricutil"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
@@ -11,21 +12,29 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
opsCounter = prometheus.NewCounterVec(
|
||||
opsCounter = metricutil.NewCounterVecStartingAtZero(
|
||||
prometheus.CounterOpts{
|
||||
Namespace: metrics.ExporterName,
|
||||
Name: "encryption_ops_total",
|
||||
Help: "A counter for encryption operations",
|
||||
},
|
||||
[]string{"success", "operation"},
|
||||
map[string][]string{
|
||||
"success": {"true", "false"},
|
||||
"operation": {OpEncrypt, OpDecrypt},
|
||||
},
|
||||
)
|
||||
cacheReadsCounter = prometheus.NewCounterVec(
|
||||
cacheReadsCounter = metricutil.NewCounterVecStartingAtZero(
|
||||
prometheus.CounterOpts{
|
||||
Namespace: metrics.ExporterName,
|
||||
Name: "encryption_cache_reads_total",
|
||||
Help: "A counter for encryption cache reads",
|
||||
},
|
||||
[]string{"hit", "method"},
|
||||
map[string][]string{
|
||||
"hit": {"true", "false"},
|
||||
"method": {"byId", "byName"},
|
||||
},
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user