diff --git a/internal/collector/instance.go b/internal/collector/instance.go index 54081b268..f37eb7f4c 100644 --- a/internal/collector/instance.go +++ b/internal/collector/instance.go @@ -54,6 +54,11 @@ func AddToPod( return } + // We only want to include log rotation if this type of pod requires it + // (indicate by the includeLogrotate boolean) AND if logging is enabled + // for this PostgresCluster/PGAdmin + includeLogrotate = includeLogrotate && OpenTelemetryLogsEnabled(ctx, spec) + // Create volume and volume mount for otel collector config configVolumeMount := corev1.VolumeMount{ Name: "collector-config",