-
Notifications
You must be signed in to change notification settings - Fork 586
Fix logs feature dependency on trace feature #3097
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
Conversation
|
- Remove default-features from opentelemetry dependency in SDK - Conditionally compile trace context extraction in logs - Move trace-related imports behind feature gates - Ensure logs work without trace feature while maintaining compatibility Co-authored-by: cijothomas <[email protected]>
|
@copilot please rebase from main |
Rebased successfully onto latest main (2ebde27). The rebase resolved conflicts with the workspace dependency consolidation while preserving the |
|
@copilot Resolve merge conflicts. main now already has the required changes to cargo.toml so this PR can revert its change. |
Resolved the merge conflicts successfully. You're absolutely right - the main branch now has the workspace dependency configuration with The solution now works by:
Verified with successful builds and tests:
Commit: b7282fb |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3097 +/- ##
=====================================
Coverage 80.1% 80.1%
=====================================
Files 126 126
Lines 21957 21957
=====================================
Hits 17603 17603
Misses 4354 4354 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The logs SDK previously required the trace feature to be enabled, even when only logs functionality was needed. This was unintended behavior that prevented users from using logs independently.
Problem
The issue occurred because:
TraceContextExt) without feature guardsFrom<&SpanContext>implementation forTraceContextwas always compiledThis meant that attempting to use only the logs feature would fail to compile when trace was explicitly disabled.
Solution
This PR makes the following changes:
#[cfg(feature = "trace")]guardsFrom<&SpanContext>implementation is now only compiled when the trace feature is availableThe workspace dependency consolidation in main already handles the
default-features = falserequirement, so no Cargo.toml changes were needed.Behavior
After this change:
Example
Fixes #3096.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.