feat: Add message parameter to otel_debug macro#1973
feat: Add message parameter to otel_debug macro#1973jmacd merged 13 commits intoopen-telemetry:mainfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1973 +/- ##
==========================================
- Coverage 85.72% 85.71% -0.01%
==========================================
Files 513 513
Lines 162056 162070 +14
==========================================
+ Hits 138919 138926 +7
- Misses 22603 22610 +7
Partials 534 534
🚀 New features to boost your workflow:
|
|
Part of #1972 |
cijothomas
left a comment
There was a problem hiding this comment.
I am not opposed to the idea of using Human readable message in logs. Requesting changes to address the following.
- Make it optional. Only few scenarios benefit from human readable message, so no need of making it mandatory.
- Make it for all severity, not just debug.
- Don't add message for the sake of adding it. If the event.name says "component.started", what additional value does a message "Component is started" providing?
open-telemetry/semantic-conventions#3343 We are totally aligned with this proposal in OTel conventions as well with the above. (this PR in semantic convention is, in turn, aligned with OTel specification too)
|
Cijo, Andres, and I discussed.
We're going after requirements, not much agreement on style/syntax.
|
#1973 (comment) is unresolved, and my suggestion is to keep message at the very last, matching existing pattern in |
|
I think we can try to improve the macros later, or change this stuff again -- what's important is we have both event name and optional message. (No more complaints from me!) |
As suggested here, we already had the ability to send optional message with special casing "message" attribute. |
Reverting #1973 Fixing the empty "" from our internal macros, that caused the `message="user friendly message here"` from being omitted in stdout! Taking https://github.com/open-telemetry/otel-arrow/blob/main/rust/otap-dataflow/crates/controller/src/lib.rs#L668-L671 as example ```rust otel_warn!( "core_affinity.set_failed", message = "Failed to set core affinity for pipeline thread. Performance may be less predictable." ); ``` Before ```txt 2026-02-06T22:15:09.891Z WARN otap-df-controller::core_affinity.set_failed (crates/controller/src/lib.rs:668): ``` (Missing message!) After (i.e with this PR) ```txt 2026-02-06T22:11:19.095Z WARN otap-df-controller::core_affinity.set_failed (crates/controller/src/lib.rs:668): Failed to set core affinity for pipeline thread. Performance may be less predictable. ``` (Message is back) "message" is already special cased in this repo, OTel Rust repo, and `tracing` itself. Passing user friendly string as an attribute named "message" is *[faster](https://github.com/open-telemetry/opentelemetry-rust/pull/2001/changes)* too! Also, we avoid the less friendly syntax - #1981 (comment)
Change Summary
Adding "message" attribute to the otel_debug macro.
Part of #1972
What issue does this PR close?
How are these changes tested?
Building the package
Are there any user-facing changes?
No