Skip to content

Conversation

gugahoa
Copy link

@gugahoa gugahoa commented Aug 2, 2025

Summary

  • Adds a new span processor that automatically inserts OpenTelemetry Baggage entries as span attributes
  • Provides configuration options for prefixing and filtering baggage attributes
  • Includes comprehensive test coverage

Test plan

  • Unit tests added covering all functionality
  • Tests verify baggage handling, prefix configuration, and filtering
  • Manual testing in example applications

This processor enables automatic propagation of baggage context into span attributes, which is useful for:

  • Adding tenant/user context to all spans
  • Propagating request-level metadata through distributed traces
  • Debugging and correlation across services

The implementation follows the OpenTelemetry span processor interface and integrates seamlessly with existing processor chains.

🤖 Generated with Claude Code

@gugahoa gugahoa marked this pull request as draft August 2, 2025 15:04
@gugahoa
Copy link
Author

gugahoa commented Aug 2, 2025

FYI: I made the update using Claude Code, I still haven't reviewed the output yet that's why it's in draft
Replaces: https://github.com/open-telemetry/opentelemetry-erlang-contrib/pull/85/commits

I still have to:

  • Review the code myself
  • Manually test it
  • Ensure the test suite coverage is good
  • Check if it should work for atom keys

@gugahoa gugahoa mentioned this pull request Aug 2, 2025
This adds a new span processor that takes attributes from OpenTelemetry
Baggage and inserts them into spans when they start.

Features:
- Automatically adds all baggage entries as span attributes
- Optional prefix configuration for baggage attributes
- Optional filter to only include baggage with specific metadata
- Comprehensive test suite

The processor is configured in the OpenTelemetry processors list and
must be placed before any exporting processor (e.g., batch processor).

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@gugahoa gugahoa force-pushed the add-baggage-span-processor branch from ff4f341 to 029ec53 Compare August 2, 2025 22:28
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.

1 participant