Class ParentBasedSampler.Builder
- java.lang.Object
-
- io.opentelemetry.sdk.trace.samplers.ParentBasedSampler.Builder
-
- Enclosing class:
- ParentBasedSampler
public static class ParentBasedSampler.Builder extends Object
A builder for creating ParentBased sampler instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Samplerbuild()Builds theParentBasedSampler.ParentBasedSampler.BuildersetLocalParentNotSampled(Sampler localParentNotSampled)Sets theSamplerto use when there is a local parent that was not sampled.ParentBasedSampler.BuildersetLocalParentSampled(Sampler localParentSampled)Sets theSamplerto use when there is a local parent that was sampled.ParentBasedSampler.BuildersetRemoteParentNotSampled(Sampler remoteParentNotSampled)Sets theSamplerto use when there is a remote parent that was not sampled.ParentBasedSampler.BuildersetRemoteParentSampled(Sampler remoteParentSampled)Sets theSamplerto use when there is a remote parent that was sampled.
-
-
-
Method Detail
-
setRemoteParentSampled
public ParentBasedSampler.Builder setRemoteParentSampled(Sampler remoteParentSampled)
Sets theSamplerto 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 ParentBasedSampler.Builder setRemoteParentNotSampled(Sampler remoteParentNotSampled)
Sets theSamplerto 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 ParentBasedSampler.Builder setLocalParentSampled(Sampler localParentSampled)
Sets theSamplerto 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 ParentBasedSampler.Builder setLocalParentNotSampled(Sampler localParentNotSampled)
Sets theSamplerto 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.
-
-