File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
main/java/io/opentelemetry/sdk/trace/samplers
test/java/io/opentelemetry/sdk/trace/samplers Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ public final class ParentBasedSamplerBuilder {
2020 @ Nullable private Sampler localParentNotSampled ;
2121
2222 ParentBasedSamplerBuilder (Sampler root ) {
23- maybeLogTraceIdSamplerWarning (root , "root" );
23+ // This is the only valid traceIdSampler location according to Spec
24+ // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#compatibility-warnings-for-traceidratiobased-sampler
2425 this .root = root ;
2526 }
2627
Original file line number Diff line number Diff line change @@ -28,18 +28,16 @@ void emitsWarningForAllChildSamplerSetters() {
2828 .setLocalParentNotSampled (ratioSampler )
2929 .build ();
3030
31- assertThat (logs .getEvents ()).hasSize (5 );
31+ assertThat (logs .getEvents ()).hasSize (4 );
3232 assertThat (logs .getEvents ().get (0 ).getMessage ())
33- .contains ("TraceIdRatioBasedSampler is being used as a child sampler (root)" );
34- assertThat (logs .getEvents ().get (1 ).getMessage ())
3533 .contains (
3634 "TraceIdRatioBasedSampler is being used as a child sampler (remoteParentNotSampled)" );
37- assertThat (logs .getEvents ().get (2 ).getMessage ())
35+ assertThat (logs .getEvents ().get (1 ).getMessage ())
3836 .contains (
3937 "TraceIdRatioBasedSampler is being used as a child sampler (remoteParentSampled)" );
40- assertThat (logs .getEvents ().get (3 ).getMessage ())
38+ assertThat (logs .getEvents ().get (2 ).getMessage ())
4139 .contains ("TraceIdRatioBasedSampler is being used as a child sampler (localParentSampled)" );
42- assertThat (logs .getEvents ().get (4 ).getMessage ())
40+ assertThat (logs .getEvents ().get (3 ).getMessage ())
4341 .contains (
4442 "TraceIdRatioBasedSampler is being used as a child sampler (localParentNotSampled)" );
4543 }
You can’t perform that action at this time.
0 commit comments