Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 2, 2025

The logs feature in opentelemetry-sdk was incorrectly including serde_json as a dependency, which is not needed for basic logs functionality. This was causing unnecessary bloat for users who only want logging capabilities without JSON serialization.

Changes Made

  1. Removed serde_json from logs feature: Updated the feature definition in Cargo.toml from:

    logs = ["opentelemetry/logs", "opentelemetry/trace", "serde_json"]

    to:

    logs = ["opentelemetry/logs", "opentelemetry/trace"]
  2. Fixed deprecated API usage in tests: Updated test code to use current APIs:

    • TraceId::from_u128(13)TraceId::from(13u128)
    • SpanId::from_u64(14)SpanId::from(14u64)

Verification

  • ✅ Logs feature compiles and works correctly without serde_json
  • jaeger_remote_sampler feature continues to work with its own explicit serde_json dependency
  • ✅ All existing functionality remains intact
  • ✅ Created and tested minimal example confirming logs work without JSON dependencies

The serde_json dependency is only used by the jaeger_remote_sampler feature for parsing remote sampling configuration, and that feature already has its own explicit dependency on serde_json. This change reduces the dependency footprint for users who only need logging capabilities.

Fixes #3104.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 2, 2025

CLA Missing ID CLA Not Signed

Copilot AI changed the title [WIP] OTel Logs SDK - should not need serde_json feature Remove unnecessary serde_json dependency from logs feature Aug 2, 2025
Copilot AI requested a review from cijothomas August 2, 2025 06:33
Copilot finished work on behalf of cijothomas August 2, 2025 06:33
@codecov
Copy link

codecov bot commented Aug 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.1%. Comparing base (0462369) to head (7215d45).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #3106   +/-   ##
=====================================
  Coverage   80.1%   80.1%           
=====================================
  Files        126     126           
  Lines      21957   21957           
=====================================
  Hits       17603   17603           
  Misses      4354    4354           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cijothomas cijothomas closed this Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OTel Logs SDK - should not need serde_json feature

2 participants