-
Notifications
You must be signed in to change notification settings - Fork 452
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
Treat log's key-values as attributes in log bridge #1628
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1628 +/- ##
=======================================
+ Coverage 69.3% 70.1% +0.7%
=======================================
Files 136 136
Lines 19637 20024 +387
=======================================
+ Hits 13610 14037 +427
+ Misses 6027 5987 -40 ☔ View full report in Codecov by Sentry. |
As of today, its not done anywhere in the API, SDK, Exporter. There is a good chance of a feature flag/option to make it happen. (unsure where,, could be just in otlp exporter only) |
mm.. This may require some discussion.. The log-bridge only depends on |
The serialization via If we didn't want to force a dependency on |
+1 on that. As of now we only support primitive types with tokio-tracing appender, so should be good to have similar support with log-appender, and then using serde optionally for complete support. |
Ok, I can make that change 👍 Any preference on what that feature should be called? |
In the other create(opentelemetry-proto) we have the feature |
Ok, I've made the |
I can improve the test coverage here once we’re happy with the overall shape of things. Is there anywhere I’d need to plug this new feature into CI? |
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.
changes look good. Some minor comments
Some relevant comments here open-telemetry/opentelemetry-specification#3938 |
Thanks for the review @lalitb. I’ll make those changes, fill out the test coverage, and leave some docs on how to enable key-value support, and how various kinds of values are represented. |
This should be ready for another review now. I've added some crate-level docs to |
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.
LGTM. Thanks for the change!
The build failure here looks unrelated; is kicking off a fresh build likely to resolve it? |
//! | ||
//! # Feature Flags | ||
//! | ||
//! This library provides the following Cargo features: |
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.
💯 love this doc!
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.
Thanks! Could you add a changelog.md file too?
Changes
This PR supports
log
's newly stabilized structured logging API in theopentelemetry-appender-log
crate.As of the
0.4.21
release,log
has stable support for structured logging. Its model is to decouple the serialization framework choice from producers and consumers, so I've opted to useserde
here to convertlog
's structured values intoAnyValue
s. The infrastructure isn't specific tolog
, so if it either already exists somewhere in the SDK that I can use, or would be worth moving into the SDK under someserde
feature I'd be happy to do that too.One open question I've got is whether I need to deal with deduplication when constructing the attributes list, or whether that's dealt with elsewhere.
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial, user-facing changes