Repository navigation
feat(logging): decouple OTLP export from console log format - #12424
Conversation
WalkthroughChangesConsole logging format
Estimated code review effort: 4 (Complex) | ~45 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
lib/runtime/src/config.rs (1)
436-479: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUndocumented format aliases.
from_env_valuealso accepts"text"and"json"as aliases, but the doc comments (here and inenvironment_names.rs) only mention"readable"/"jsonl". Consider documenting the aliases so users aren't surprised either way.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/runtime/src/config.rs` around lines 436 - 479, Document the accepted “text” and “json” aliases alongside “readable” and “jsonl” in the console log format documentation, updating both the comments near ConsoleLogFormat/console_log_format and the corresponding documentation in environment_names.rs. Keep the existing parsing behavior in ConsoleLogFormat::from_env_value unchanged.lib/runtime/src/logging.rs (1)
2910-2919: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider adding
--exactfor consistency with sibling subprocess tests.Other subprocess-dispatching tests in this file (
test_otlp_export_works_without_json_logging,test_span_events) pass--exactafter the test name; this new test omits it. Low risk here since the name is unlikely to collide, but adding it keeps the pattern consistent.♻️ Proposed fix
.args([ "test", "-p", "dynamo-runtime", "test_readable_console_with_otel_export_subprocess", "--", + "--exact", "--nocapture", ])🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/runtime/src/logging.rs` around lines 2910 - 2919, Add the `--exact` argument to the Cargo test command in the subprocess invocation for `test_readable_console_with_otel_export_subprocess`, matching the argument pattern used by the sibling subprocess tests while preserving the existing test selection and output options.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@lib/runtime/src/config.rs`:
- Around line 436-479: Document the accepted “text” and “json” aliases alongside
“readable” and “jsonl” in the console log format documentation, updating both
the comments near ConsoleLogFormat/console_log_format and the corresponding
documentation in environment_names.rs. Keep the existing parsing behavior in
ConsoleLogFormat::from_env_value unchanged.
In `@lib/runtime/src/logging.rs`:
- Around line 2910-2919: Add the `--exact` argument to the Cargo test command in
the subprocess invocation for
`test_readable_console_with_otel_export_subprocess`, matching the argument
pattern used by the sibling subprocess tests while preserving the existing test
selection and output options.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: bb416ab6-1670-46e4-84f0-b3604d040385
📒 Files selected for processing (3)
lib/runtime/src/config.rslib/runtime/src/config/environment_names.rslib/runtime/src/logging.rs
|
@rmccorm4 Could you take a look when you get a chance? Thanks! |
|
/ok to test af813f2 |
|
🎯 Code Coverage (details) 🔗 Commit SHA: 05ad4da | Docs | Datadog PR Page | Give us feedback! |
Signed-off-by: jellysnack <oleg.jellysnack@gmail.com>
Signed-off-by: jellysnack <oleg.jellysnack@gmail.com>
Signed-off-by: jellysnack <oleg.jellysnack@gmail.com>
|
Thanks @jellysnack ! Tagged @jh-nv to help review, and @jellysnack please help fix the merge conflicts on the branch
Please feel free to join the dynamo community slack to post your PRs for review and discussion with the team as well: https://ai-dynamo.org/slack |
af813f2 to
961a39e
Compare
Signed-off-by: jellysnack <oleg.jellysnack@gmail.com>
jh-nv
left a comment
There was a problem hiding this comment.
Thanks for the contribution.
|
/ok to test 05ad4da |
Overview:
Decouple the stderr console log format from OpenTelemetry export configuration.
This allows Dynamo to export traces and structured log records through OTLP while keeping human-readable console output. Existing deployments using
DYN_LOGGING_JSONLremain backward compatible.Details:
DYN_LOGGING_CONSOLE_FORMATwithreadableandjsonlvalues.DYN_LOGGING_CONSOLE_FORMATtake precedence over the legacyDYN_LOGGING_JSONLsetting.DYN_LOGGING_JSONLas a backward-compatible fallback when the new setting is not provided.console_layer.Where should the reviewer start?
Start with
lib/runtime/src/logging.rs, particularly:setup_logging, where console formatting and telemetry initialization are separated;console_layerandConsoleEventFormatter, which select the stderr format without duplicating subscriber setup;test_readable_console_with_otel_export, which covers the primary use case.Then review
lib/runtime/src/config.rsfor environment-variable parsing, precedence, and legacy compatibility.Related Issues
🚫 This PR is NOT linked to an issue:
Summary by CodeRabbit
New Features
DYN_LOGGING_CONSOLE_FORMAT.DYN_LOGGING_JSONLsetting.Bug Fixes