Class TraceConfig.Builder
- java.lang.Object
-
- io.opentelemetry.sdk.common.export.ConfigBuilder<TraceConfig.Builder>
-
- io.opentelemetry.sdk.trace.config.TraceConfig.Builder
-
- Enclosing class:
- TraceConfig
public abstract static class TraceConfig.Builder extends io.opentelemetry.sdk.common.export.ConfigBuilder<TraceConfig.Builder>
Builder forTraceConfig
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description TraceConfig
build()
Builds and returns aTraceConfig
with the desired values.protected TraceConfig.Builder
fromConfigMap(Map<String,String> configMap, io.opentelemetry.sdk.common.export.ConfigBuilder.NamingConvention namingConvention)
Sets the configuration values from the given configuration map for only the available keys.TraceConfig.Builder
readEnvironmentVariables()
* Sets the configuration values from environment variables for only the available keys.TraceConfig.Builder
readProperties(Properties properties)
* Sets the configuration values from the given properties object for only the available keys.TraceConfig.Builder
readSystemProperties()
* Sets the configuration values from system properties for only the available keys.abstract TraceConfig.Builder
setMaxLengthOfAttributeValues(int maxLengthOfAttributeValues)
Sets the global default max length of string attribute value in characters.abstract TraceConfig.Builder
setMaxNumberOfAttributes(int maxNumberOfAttributes)
Sets the global default max number of attributes perSpan
.abstract TraceConfig.Builder
setMaxNumberOfAttributesPerEvent(int maxNumberOfAttributesPerEvent)
Sets the global default max number of attributes per event.abstract TraceConfig.Builder
setMaxNumberOfAttributesPerLink(int maxNumberOfAttributesPerLink)
Sets the global default max number of attributes per link.abstract TraceConfig.Builder
setMaxNumberOfEvents(int maxNumberOfEvents)
Sets the global default max number of events perSpan
.abstract TraceConfig.Builder
setMaxNumberOfLinks(int maxNumberOfLinks)
Sets the global default max number of links perSpan
.abstract TraceConfig.Builder
setSampler(Sampler sampler)
Sets the global defaultSampler
.TraceConfig.Builder
setTraceIdRatioBased(double samplerRatio)
Sets the global defaultSampler
.
-
-
-
Method Detail
-
fromConfigMap
protected TraceConfig.Builder fromConfigMap(Map<String,String> configMap, io.opentelemetry.sdk.common.export.ConfigBuilder.NamingConvention namingConvention)
Sets the configuration values from the given configuration map for only the available keys.- Specified by:
fromConfigMap
in classio.opentelemetry.sdk.common.export.ConfigBuilder<TraceConfig.Builder>
- Parameters:
configMap
-Map
holding the configuration values.- Returns:
- this
-
readProperties
public TraceConfig.Builder readProperties(Properties properties)
* Sets the configuration values from the given properties object for only the available keys.- Overrides:
readProperties
in classio.opentelemetry.sdk.common.export.ConfigBuilder<TraceConfig.Builder>
- Parameters:
properties
-Properties
holding the configuration values.- Returns:
- this
-
readEnvironmentVariables
public TraceConfig.Builder readEnvironmentVariables()
* Sets the configuration values from environment variables for only the available keys.- Overrides:
readEnvironmentVariables
in classio.opentelemetry.sdk.common.export.ConfigBuilder<TraceConfig.Builder>
- Returns:
- this.
-
readSystemProperties
public TraceConfig.Builder readSystemProperties()
* Sets the configuration values from system properties for only the available keys.- Overrides:
readSystemProperties
in classio.opentelemetry.sdk.common.export.ConfigBuilder<TraceConfig.Builder>
- Returns:
- this.
-
setSampler
public abstract TraceConfig.Builder setSampler(Sampler sampler)
- Parameters:
sampler
- the global defaultSampler
.- Returns:
- this.
-
setTraceIdRatioBased
public TraceConfig.Builder setTraceIdRatioBased(double samplerRatio)
- Parameters:
samplerRatio
- the global default ratio used to make decisions onSpan
sampling.- Returns:
- this.
-
setMaxNumberOfAttributes
public abstract TraceConfig.Builder setMaxNumberOfAttributes(int maxNumberOfAttributes)
Sets the global default max number of attributes perSpan
.- Parameters:
maxNumberOfAttributes
- the global default max number of attributes perSpan
. It must be positive otherwisebuild()
will throw an exception.- Returns:
- this.
-
setMaxNumberOfEvents
public abstract TraceConfig.Builder setMaxNumberOfEvents(int maxNumberOfEvents)
Sets the global default max number of events perSpan
.- Parameters:
maxNumberOfEvents
- the global default max number of events perSpan
. It must be positive otherwisebuild()
will throw an exception.- Returns:
- this.
-
setMaxNumberOfLinks
public abstract TraceConfig.Builder setMaxNumberOfLinks(int maxNumberOfLinks)
Sets the global default max number of links perSpan
.- Parameters:
maxNumberOfLinks
- the global default max number of links perSpan
. It must be positive otherwisebuild()
will throw an exception.- Returns:
- this.
-
setMaxNumberOfAttributesPerEvent
public abstract TraceConfig.Builder setMaxNumberOfAttributesPerEvent(int maxNumberOfAttributesPerEvent)
Sets the global default max number of attributes per event.- Parameters:
maxNumberOfAttributesPerEvent
- the global default max number of attributes per event. It must be positive otherwisebuild()
will throw an exception.- Returns:
- this.
-
setMaxNumberOfAttributesPerLink
public abstract TraceConfig.Builder setMaxNumberOfAttributesPerLink(int maxNumberOfAttributesPerLink)
Sets the global default max number of attributes per link.- Parameters:
maxNumberOfAttributesPerLink
- the global default max number of attributes per link. It must be positive otherwisebuild()
will throw an exception.- Returns:
- this.
-
setMaxLengthOfAttributeValues
public abstract TraceConfig.Builder setMaxLengthOfAttributeValues(int maxLengthOfAttributeValues)
Sets the global default max length of string attribute value in characters.- Parameters:
maxLengthOfAttributeValues
- the global default max length of string attribute value in characters. It must be non-negative (orTraceConfig.UNLIMITED_ATTRIBUTE_LENGTH
) otherwisebuild()
will throw an exception.- Returns:
- this.
-
build
public TraceConfig build()
Builds and returns aTraceConfig
with the desired values.- Returns:
- a
TraceConfig
with the desired values. - Throws:
IllegalArgumentException
- if any of the max numbers are not positive.
-
-