Package io.opencensus.trace.config
Class TraceParams.Builder
- java.lang.Object
-
- io.opencensus.trace.config.TraceParams.Builder
-
- Direct Known Subclasses:
AutoValue_TraceParams.Builder
- Enclosing class:
- TraceParams
public abstract static class TraceParams.Builder extends java.lang.Object
ABuilder
class forTraceParams
.- Since:
- 0.5
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description (package private) abstract TraceParams
autoBuild()
TraceParams
build()
Builds and returns aTraceParams
with the desired values.abstract TraceParams.Builder
setMaxNumberOfAnnotations(int maxNumberOfAnnotations)
Sets the global default max number ofAnnotation
events perSpan
.abstract TraceParams.Builder
setMaxNumberOfAttributes(int maxNumberOfAttributes)
Sets the global default max number of attributes perSpan
.abstract TraceParams.Builder
setMaxNumberOfLinks(int maxNumberOfLinks)
abstract TraceParams.Builder
setMaxNumberOfMessageEvents(int maxNumberOfMessageEvents)
Sets the global default max number ofMessageEvent
events perSpan
.TraceParams.Builder
setMaxNumberOfNetworkEvents(int maxNumberOfNetworkEvents)
Deprecated.abstract TraceParams.Builder
setSampler(Sampler sampler)
Sets the global defaultSampler
.
-
-
-
Method Detail
-
setSampler
public abstract TraceParams.Builder setSampler(Sampler sampler)
- Parameters:
sampler
- the global defaultSampler
.- Returns:
- this.
- Since:
- 0.5
-
setMaxNumberOfAttributes
public abstract TraceParams.Builder setMaxNumberOfAttributes(int maxNumberOfAttributes)
Sets the global default max number of attributes perSpan
.
-
setMaxNumberOfAnnotations
public abstract TraceParams.Builder setMaxNumberOfAnnotations(int maxNumberOfAnnotations)
Sets the global default max number ofAnnotation
events perSpan
.- Parameters:
maxNumberOfAnnotations
- the global default max number ofAnnotation
events perSpan
. It must be positive otherwisebuild()
will throw an exception.- Returns:
- this.
- Since:
- 0.5
-
setMaxNumberOfMessageEvents
public abstract TraceParams.Builder setMaxNumberOfMessageEvents(int maxNumberOfMessageEvents)
Sets the global default max number ofMessageEvent
events perSpan
.- Parameters:
maxNumberOfMessageEvents
- the global default max number ofMessageEvent
events perSpan
. It must be positive otherwisebuild()
will throw an exception.- Returns:
- this.
- Since:
- 0.12
-
setMaxNumberOfNetworkEvents
@Deprecated public TraceParams.Builder setMaxNumberOfNetworkEvents(int maxNumberOfNetworkEvents)
Deprecated.Sets the global default max number ofNetworkEvent
events perSpan
.- Parameters:
maxNumberOfNetworkEvents
- the global default max number ofNetworkEvent
events perSpan
. It must be positive otherwisebuild()
will throw an exception.- Returns:
- this.
- Since:
- 0.5
-
setMaxNumberOfLinks
public abstract TraceParams.Builder setMaxNumberOfLinks(int maxNumberOfLinks)
-
autoBuild
abstract TraceParams autoBuild()
-
build
public TraceParams build()
Builds and returns aTraceParams
with the desired values.- Returns:
- a
TraceParams
with the desired values. - Throws:
java.lang.NullPointerException
- if the sampler isnull
.java.lang.IllegalArgumentException
- if any of the max numbers are not positive.- Since:
- 0.5
-
-