Skip to content

Add toString to ComposableAnnotatingSampler#8645

Draft
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/annotating-sampler-tostring
Draft

Add toString to ComposableAnnotatingSampler#8645
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/annotating-sampler-tostring

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Fixes #8644

Description

  • ComposableAnnotatingSampler was the only one of the seven ComposableSampler implementations without a toString() override that returns getDescription().
  • ComposableParentThresholdSampler builds its description by concatenating its root sampler, so composing it with an annotating sampler surfaced an Object hash (ComposableAnnotatingSampler@1a2b3c) in the observable getDescription() output.
  • Added the 3-line override, matching the six sibling samplers.

Testing done

  • Added ComposableAnnotatingSamplerTest#descriptionInComposedSampler asserting the composed parentThreshold(annotating(...)) description contains the real annotating description and no @ object hash — RED before the fix, GREEN after.
  • ./gradlew :sdk-extensions:incubator:check — passed.
  • Package-private class in an -alpha module; no docs/apidiffs/ change.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Jul 19, 2026

Copy link
Copy Markdown

Pull request dashboard status

Status last refreshed: 2026-07-20 21:23:42 UTC.

  • Waiting on: Author
  • Next step: Move out of draft to request review.

This automated status or its linked feedback items may be incorrect. If something looks wrong, report it with the result you expected.

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.64%. Comparing base (09d6c17) to head (be9bfd3).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8645   +/-   ##
=========================================
  Coverage     91.64%   91.64%           
- Complexity    10348    10349    +1     
=========================================
  Files          1013     1013           
  Lines         27380    27381    +1     
  Branches       3218     3218           
=========================================
+ Hits          25092    25093    +1     
  Misses         1558     1558           
  Partials        730      730           

☔ View full report in Codecov by Harness.
📢 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.

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.

ComposableAnnotatingSampler missing toString shows Object hash in composed description

1 participant