Skip to content

feat(consumer): log resolved consumer config on every start#8078

Open
phacops wants to merge 2 commits into
masterfrom
claude/log-consumer-config-startup-jjmw5z
Open

feat(consumer): log resolved consumer config on every start#8078
phacops wants to merge 2 commits into
masterfrom
claude/log-consumer-config-startup-jjmw5z

Conversation

@phacops

@phacops phacops commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

The Rust consumers (rust_consumer and accepted_outcomes_consumer) resolve their full configuration from CLI args plus storage definitions, but never logged it. This makes it hard to confirm what a running consumer was actually configured with — resolved topics, broker config, batch settings, retention, message processor, etc.

This PR logs the resolved ConsumerConfig as JSON at startup, right after it's parsed from the payload passed in by the Python CLI. The logging is done in Rust (rather than the Python CLI) because that's where logging is already configured for these consumers — the rust_consumer / accepted_outcomes_consumer Python entrypoints deliberately don't set up Python logging and rely on Rust's structured JSON tracing.

Secret redaction

The config contains secrets, so a new ConsumerConfig::redacted_for_logging() helper produces a JSON view with the following masked as [REDACTED]:

  • ClickHouse cluster password
  • env.sentry_dsn
  • Any broker-config key containing password or secret (e.g. sasl.password)

All non-sensitive values (hosts, ports, topic names, batch settings, retention, etc.) are preserved.

Testing

  • Added test_redacted_for_logging asserting secrets do not leak and non-sensitive values are preserved.
  • cargo test --lib test_redacted_for_logging passes.

🤖 Generated with Claude Code


Generated by Claude Code

The Rust consumers (rust_consumer and accepted_outcomes_consumer) resolve
their full config from CLI args + storage definitions but never logged it,
making it hard to confirm what a running consumer was actually configured
with (topics, brokers, batch settings, retention, etc).

Log the resolved ConsumerConfig as JSON at startup, right after it's parsed.
Secrets (ClickHouse password, Sentry DSN, and Kafka credentials in broker
configs such as sasl.password) are redacted so they never reach the logs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cfqpz6SMijmjzTCbLosEvG
@phacops phacops requested a review from a team as a code owner June 19, 2026 18:32
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cfqpz6SMijmjzTCbLosEvG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants