Skip to content

operator: Replace otelutil/log with controller-runtime/pkg/log#1427

Closed
RafalKorepta wants to merge 1 commit intomainfrom
rk/remove-context-from-log-line
Closed

operator: Replace otelutil/log with controller-runtime/pkg/log#1427
RafalKorepta wants to merge 1 commit intomainfrom
rk/remove-context-from-log-line

Conversation

@RafalKorepta
Copy link
Copy Markdown
Contributor

Work around the noisy "ctx" key-value pair that common-go's otelutil/log appends to every log line, serializing the full context.Context wrapper chain (e.g. "context.Background.WithCancel.WithCancel.WithValue(...)").

Switch all call sites from log.Info(ctx, ...) / log.Error(ctx, err, ...) to the standard controller-runtime pattern: log := log.FromContext(ctx) followed by log.Info(...) / log.Error(err, ...).

This is a temporary workaround until redpanda-data/common-go#160 lands, after which we can revert back to otelutil/log.

@RafalKorepta RafalKorepta force-pushed the rk/remove-context-from-log-line branch 2 times, most recently from d22bc43 to e300345 Compare April 8, 2026 13:20
Work around the noisy "ctx" key-value pair that common-go's otelutil/log
appends to every log line, serializing the full context.Context wrapper
chain (e.g. "context.Background.WithCancel.WithCancel.WithValue(...)").

Switch all call sites from log.Info(ctx, ...) / log.Error(ctx, err, ...)
to the standard controller-runtime pattern: log := log.FromContext(ctx)
followed by log.Info(...) / log.Error(err, ...).

This is a temporary workaround until redpanda-data/common-go#160 lands,
after which we can revert back to otelutil/log.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@RafalKorepta
Copy link
Copy Markdown
Contributor Author

The #1436 has proper fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant