Skip to content

add toString implementation in the baggage processor#2800

Merged
laurit merged 3 commits into
open-telemetry:mainfrom
SylvainJuge:baggage-tostring
Apr 29, 2026
Merged

add toString implementation in the baggage processor#2800
laurit merged 3 commits into
open-telemetry:mainfrom
SylvainJuge:baggage-tostring

Conversation

@SylvainJuge
Copy link
Copy Markdown
Contributor

@SylvainJuge SylvainJuge commented Apr 29, 2026

The current implementation of BaggageLogRecordProcessor and BaggageSpanProcessor do not implement toString which makes testing and debugging configuration harder, in particular when using declarative configuration.

This PR adds a simple implementation that delegates to the underlying IncludeExcludePredicate so we get the include/exclude patterns used in the toString result.

@SylvainJuge SylvainJuge requested a review from a team as a code owner April 29, 2026 08:36
Copilot AI review requested due to automatic review settings April 29, 2026 08:36
@SylvainJuge SylvainJuge changed the title add toString for the baggage processor add toString implementation in the baggage processor Apr 29, 2026
@SylvainJuge SylvainJuge self-assigned this Apr 29, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds toString() implementations to baggage processors so SDK configuration dumps include the include/exclude predicate details, improving debuggability and enabling stronger configuration assertions in tests.

Changes:

  • Implement toString() in BaggageSpanProcessor and BaggageLogRecordProcessor delegating to the configured predicate.
  • Strengthen declarative configuration tests to assert include/exclude patterns appear in the SDK string output.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
baggage-processor/src/main/java/io/opentelemetry/contrib/baggage/processor/BaggageSpanProcessor.java Adds toString() including the baggageKeyPredicate value.
baggage-processor/src/main/java/io/opentelemetry/contrib/baggage/processor/BaggageLogRecordProcessor.java Adds toString() including the baggageKeyPredicate value.
baggage-processor/src/test/java/io/opentelemetry/contrib/baggage/processor/BaggageSpanComponentProviderTest.java Updates assertion to check predicate include/exclude details appear in SDK dump.
baggage-processor/src/test/java/io/opentelemetry/contrib/baggage/processor/BaggageLogRecordComponentProviderTest.java Updates assertion to check predicate include/exclude details appear in SDK dump.

@laurit laurit added this pull request to the merge queue Apr 29, 2026
Merged via the queue into open-telemetry:main with commit 95be63a Apr 29, 2026
20 checks passed
@SylvainJuge SylvainJuge deleted the baggage-tostring branch April 29, 2026 11:31
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.

3 participants