e43879e55d
* Add database migrations * Use short uids as data key ids * Add support for manual data key rotation * Fix duplicated mutex unlocks * Fix migration * Manage current data keys per name * Adjust key re-encryption and test * Modify rename column migration for MySQL compatibility * Refactor secrets manager and data keys cache * Multiple o11y adjustments * Fix stats query * Apply suggestions from code review Co-authored-by: Tania <yalyna.ts@gmail.com> * Fix linter * Docs: Rotate data encryption keys API endpoint Co-authored-by: Tania <yalyna.ts@gmail.com>
38 lines
756 B
Go
38 lines
756 B
Go
package manager
|
|
|
|
import (
|
|
"github.com/grafana/grafana/pkg/infra/metrics"
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
)
|
|
|
|
const (
|
|
OpEncrypt = "encrypt"
|
|
OpDecrypt = "decrypt"
|
|
)
|
|
|
|
var (
|
|
opsCounter = prometheus.NewCounterVec(
|
|
prometheus.CounterOpts{
|
|
Namespace: metrics.ExporterName,
|
|
Name: "encryption_ops_total",
|
|
Help: "A counter for encryption operations",
|
|
},
|
|
[]string{"success", "operation"},
|
|
)
|
|
cacheReadsCounter = prometheus.NewCounterVec(
|
|
prometheus.CounterOpts{
|
|
Namespace: metrics.ExporterName,
|
|
Name: "encryption_cache_reads_total",
|
|
Help: "A counter for encryption cache reads",
|
|
},
|
|
[]string{"hit", "method"},
|
|
)
|
|
)
|
|
|
|
func init() {
|
|
prometheus.MustRegister(
|
|
opsCounter,
|
|
cacheReadsCounter,
|
|
)
|
|
}
|