Describe the bug
ComposableAnnotatingSampler does not override toString(), so when another sampler nests it, the composed getDescription() output shows an Object hash instead of the annotating sampler's description.
Steps to reproduce
ComposableSampler.parentThreshold(
ComposableSampler.annotating(ComposableSampler.alwaysOn(), Attributes.empty()))
.getDescription();
What did you expect to see?
ComposableParentThresholdSampler{rootSampler=ComposableAnnotatingSampler{ComposableAlwaysOnSampler,{}}}
The other six ComposableSampler implementations all override toString() to return getDescription().
What did you see instead?
ComposableParentThresholdSampler{rootSampler=ComposableAnnotatingSampler@1a2b3c}
ComposableParentThresholdSampler builds its description by concatenating the nested sampler (ComposableParentThresholdSampler.java line 28), which calls toString() on the root sampler. ComposableAnnotatingSampler is the only implementation without that override, so it falls back to Object.toString().
What version and what artifacts are you using?
Artifacts: opentelemetry-sdk-extension-incubator
Version: main @ 09d6c17
How did you reference these artifacts? N/A
Environment
Compiler: Temurin 21
OS: N/A
Additional context
N/A
Describe the bug
ComposableAnnotatingSamplerdoes not overridetoString(), so when another sampler nests it, the composedgetDescription()output shows anObjecthash instead of the annotating sampler's description.Steps to reproduce
What did you expect to see?
The other six
ComposableSamplerimplementations all overridetoString()to returngetDescription().What did you see instead?
ComposableParentThresholdSamplerbuilds its description by concatenating the nested sampler (ComposableParentThresholdSampler.javaline 28), which callstoString()on the root sampler.ComposableAnnotatingSampleris the only implementation without that override, so it falls back toObject.toString().What version and what artifacts are you using?
Artifacts: opentelemetry-sdk-extension-incubator
Version: main @ 09d6c17
How did you reference these artifacts? N/A
Environment
Compiler: Temurin 21
OS: N/A
Additional context
N/A