diff --git a/internal/controller/cluster_monitoring_controller.go b/internal/controller/cluster_monitoring_controller.go index 39d86984..439b9b97 100644 --- a/internal/controller/cluster_monitoring_controller.go +++ b/internal/controller/cluster_monitoring_controller.go @@ -83,9 +83,8 @@ func (r *ClusterMonitoringReconciler) Reconcile(ctx context.Context, req ctrl.Re // Linting is disabled for the 2 following lines as otherwise it fails with the following error: // "should not use built-in type string as key for value" - ctx = context.WithValue(ctx, "cluster", cluster.Name) // nolint - ctx = context.WithValue(ctx, "installation", r.ManagementCluster.Name) // nolint - logger := log.FromContext(ctx) + logger := log.FromContext(ctx).WithValues("cluster", cluster.Name).WithValues("installation", r.ManagementCluster.Name) // nolint + ctx = log.IntoContext(ctx, logger) if !r.MonitoringEnabled { logger.Info("Monitoring is disabled at the installation level")