-
Notifications
You must be signed in to change notification settings - Fork 600
Appender-Tracing - extend spl treatment of message when recording str #2689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Appender-Tracing - extend spl treatment of message when recording str #2689
Conversation
|
@mladedav Could you also review this? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2689 +/- ##
=======================================
- Coverage 79.3% 79.3% -0.1%
=======================================
Files 123 123
Lines 22602 22601 -1
=======================================
- Hits 17927 17925 -2
- Misses 4675 4676 +1 ☔ View full report in Codecov by Sentry. |
| // to optimize sync exporter scenario. | ||
| self.log_record | ||
| .add_attribute(Key::new(field.name()), AnyValue::from(value.to_owned())); | ||
| if field.name() == "message" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a breaking change if user is expecting the message to go an attribute?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And what should be the expected behaviour if both message attribute and default body field is provided
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a breaking change if user is expecting the message to go an attribute?
There was no contract documented about this, so while this change behavior, I don't think it should be a major issue. (We were already special casing "message" for the record_debug, so missing this may also be considered a bug)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And what should be the expected behavior if both message attribute and default body field is provided
We can add tests to make sure this is covered, but the behavior is really controlled by tracing itself. We can make some decision and document it in the event of conflict, as there can only be one body.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/open-telemetry/opentelemetry-rust/blob/main/opentelemetry-appender-tracing/src/layer.rs#L121 Fixing these TODOs are also going to change the behavior, so is fixing error to be reported specially. It's questionable to do that post 1.0 stable (but maybe okay), but I don't see an issue doing it at this stage. Let me know your thoughts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were already special casing "message" for the record_debug, so missing this may also be considered a bug
Yes, I didn't realize that. With special casing, user can't have both explicit and implicit string message attributes, as they would be overwritten. But this PR doesn't add any new bug :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to document the final behavior before 1.0.
#2150 will also be related to this...
|
Sorry for the late response but yeah, it seems fine. |
Thanks! |
…open-telemetry#2689) Co-authored-by: Lalit Kumar Bhasin <[email protected]>
TODO: Tests in next PR, if this is merged.
Follow up from https://github.com/open-telemetry/opentelemetry-rust/pull/2001/files