Class ParentBasedSamplerBuilder
- java.lang.Object
-
- io.opentelemetry.sdk.trace.samplers.ParentBasedSamplerBuilder
-
public final class ParentBasedSamplerBuilder extends java.lang.Object
A builder for creating ParentBased sampler instances.
-
-
Field Summary
Fields Modifier and Type Field Description private Sampler
localParentNotSampled
private Sampler
localParentSampled
private Sampler
remoteParentNotSampled
private Sampler
remoteParentSampled
private Sampler
root
-
Constructor Summary
Constructors Constructor Description ParentBasedSamplerBuilder(Sampler root)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Sampler
build()
Builds theParentBasedSampler
.ParentBasedSamplerBuilder
setLocalParentNotSampled(Sampler localParentNotSampled)
Sets theSampler
to use when there is a local parent that was not sampled.ParentBasedSamplerBuilder
setLocalParentSampled(Sampler localParentSampled)
Sets theSampler
to use when there is a local parent that was sampled.ParentBasedSamplerBuilder
setRemoteParentNotSampled(Sampler remoteParentNotSampled)
Sets theSampler
to use when there is a remote parent that was not sampled.ParentBasedSamplerBuilder
setRemoteParentSampled(Sampler remoteParentSampled)
Sets theSampler
to use when there is a remote parent that was sampled.
-
-
-
Field Detail
-
root
private final Sampler root
-
remoteParentSampled
@Nullable private Sampler remoteParentSampled
-
remoteParentNotSampled
@Nullable private Sampler remoteParentNotSampled
-
localParentSampled
@Nullable private Sampler localParentSampled
-
localParentNotSampled
@Nullable private Sampler localParentNotSampled
-
-
Constructor Detail
-
ParentBasedSamplerBuilder
ParentBasedSamplerBuilder(Sampler root)
-
-
Method Detail
-
setRemoteParentSampled
public ParentBasedSamplerBuilder setRemoteParentSampled(Sampler remoteParentSampled)
Sets theSampler
to use when there is a remote parent that was sampled. If not set, defaults to always sampling if the remote parent was sampled.- Returns:
- this Builder
-
setRemoteParentNotSampled
public ParentBasedSamplerBuilder setRemoteParentNotSampled(Sampler remoteParentNotSampled)
Sets theSampler
to use when there is a remote parent that was not sampled. If not set, defaults to never sampling when the remote parent isn't sampled.- Returns:
- this Builder
-
setLocalParentSampled
public ParentBasedSamplerBuilder setLocalParentSampled(Sampler localParentSampled)
Sets theSampler
to use when there is a local parent that was sampled. If not set, defaults to always sampling if the local parent was sampled.- Returns:
- this Builder
-
setLocalParentNotSampled
public ParentBasedSamplerBuilder setLocalParentNotSampled(Sampler localParentNotSampled)
Sets theSampler
to use when there is a local parent that was not sampled. If not set, defaults to never sampling when the local parent isn't sampled.- Returns:
- this Builder
-
build
public Sampler build()
Builds theParentBasedSampler
.- Returns:
- the ParentBased sampler.
-
-