diff --git a/controllers/stats_reporter.go b/controllers/stats_reporter.go index c5413df3f..86a55f7f4 100644 --- a/controllers/stats_reporter.go +++ b/controllers/stats_reporter.go @@ -18,7 +18,6 @@ package controllers import ( "context" - "runtime" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" @@ -31,8 +30,6 @@ const ( var ( providerKey = "provider" - osTypeKey = "os_type" - runtimeOS = runtime.GOOS namespaceKey = "namespace" spcKey = "secret_provider_class" ) @@ -65,7 +62,6 @@ func newStatsReporter() (StatsReporter, error) { func (r reporter) ReportSyncSecretCtMetric(ctx context.Context, provider, namespace, spc string) { opt := metric.WithAttributes( attribute.Key(providerKey).String(provider), - attribute.Key(osTypeKey).String(runtimeOS), attribute.Key(namespaceKey).String(namespace), attribute.Key(spcKey).String(spc), ) @@ -73,8 +69,5 @@ func (r reporter) ReportSyncSecretCtMetric(ctx context.Context, provider, namesp } func (r reporter) ReportSyncSecretDuration(ctx context.Context, duration float64) { - opt := metric.WithAttributes( - attribute.Key(osTypeKey).String(runtimeOS), - ) - r.syncK8sSecretDuration.Record(ctx, duration, opt) + r.syncK8sSecretDuration.Record(ctx, duration) } diff --git a/pkg/rotation/reconciler.go b/pkg/rotation/reconciler.go index 8e154a98a..a58446ab2 100644 --- a/pkg/rotation/reconciler.go +++ b/pkg/rotation/reconciler.go @@ -253,14 +253,14 @@ func (r *Reconciler) reconcile(ctx context.Context, spcps *secretsstorev1.Secret var providerName string podName := spcps.Status.PodName podNamespace := spcps.Namespace - secretProviderClass := spcps.Status.SecretProviderClassName + secretProviderClassName := spcps.Status.SecretProviderClassName defer func() { if err != nil { - r.reporter.reportRotationErrorCtMetric(ctx, providerName, podName, podNamespace, secretProviderClass, errorReason, requiresUpdate) + r.reporter.reportRotationErrorCtMetric(ctx, providerName, podName, podNamespace, secretProviderClassName, errorReason, requiresUpdate) return } - r.reporter.reportRotationCtMetric(ctx, providerName, podName, podNamespace, secretProviderClass, requiresUpdate) + r.reporter.reportRotationCtMetric(ctx, providerName, podName, podNamespace, secretProviderClassName, requiresUpdate) r.reporter.reportRotationDuration(ctx, time.Since(begin).Seconds()) }() @@ -293,13 +293,13 @@ func (r *Reconciler) reconcile(ctx context.Context, spcps *secretsstorev1.Secret ctx, client.ObjectKey{ Namespace: podNamespace, - Name: secretProviderClass, + Name: secretProviderClassName, }, spc, ) if err != nil { errorReason = internalerrors.SecretProviderClassNotFound - return fmt.Errorf("failed to get secret provider class %s/%s, err: %w", podNamespace, secretProviderClass, err) + return fmt.Errorf("failed to get secret provider class %s/%s, err: %w", podNamespace, secretProviderClassName, err) } // determine which pod volume this is associated with