Secrets: Add decrypter to decrypt duration metric (#112942)
This commit is contained in:
@@ -109,7 +109,7 @@ func (s *decryptStorage) Decrypt(ctx context.Context, namespace xkube.Namespace,
|
||||
|
||||
logging.FromContext(ctx).Info("Secrets Audit Log", args...)
|
||||
|
||||
s.metrics.DecryptDuration.WithLabelValues(decryptResultLabel).Observe(time.Since(start).Seconds())
|
||||
s.metrics.DecryptDuration.WithLabelValues(decryptResultLabel, cmp.Or(decrypterIdentity, "unknown")).Observe(time.Since(start).Seconds())
|
||||
|
||||
// Do not leak error details to caller, return only the wrapped domain errors.
|
||||
if decryptErr != nil {
|
||||
|
||||
@@ -12,8 +12,9 @@ const (
|
||||
namespace = "grafana_secrets_manager"
|
||||
subsystem = "storage"
|
||||
// labels
|
||||
successLabel = "success"
|
||||
resultLabel = "result"
|
||||
successLabel = "success"
|
||||
resultLabel = "result"
|
||||
decrypterLabel = "decrypter"
|
||||
)
|
||||
|
||||
// StorageMetrics is a struct that contains all the metrics for all operations of secrets storage.
|
||||
@@ -132,7 +133,7 @@ func newStorageMetrics() *StorageMetrics {
|
||||
Name: "decrypt_duration_seconds",
|
||||
Help: "Duration of decrypt operations",
|
||||
Buckets: prometheus.DefBuckets,
|
||||
}, []string{resultLabel}),
|
||||
}, []string{resultLabel, decrypterLabel}),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user