Class TraceConfigBuilder
- java.lang.Object
-
- io.opentelemetry.sdk.common.export.ConfigBuilder<TraceConfigBuilder>
-
- io.opentelemetry.sdk.trace.config.TraceConfigBuilder
-
public final class TraceConfigBuilder extends io.opentelemetry.sdk.common.export.ConfigBuilder<TraceConfigBuilder>
Builder forTraceConfig.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TraceConfigbuild()Builds and returns aTraceConfigwith the desired values.protected TraceConfigBuilderfromConfigMap(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.TraceConfigBuilderreadEnvironmentVariables()* Sets the configuration values from environment variables for only the available keys.TraceConfigBuilderreadProperties(Properties properties)* Sets the configuration values from the given properties object for only the available keys.TraceConfigBuilderreadSystemProperties()* Sets the configuration values from system properties for only the available keys.TraceConfigBuildersetMaxLengthOfAttributeValues(int maxLengthOfAttributeValues)Sets the global default max length of string attribute value in characters.TraceConfigBuildersetMaxNumberOfAttributes(int maxNumberOfAttributes)Sets the global default max number of attributes perSpan.TraceConfigBuildersetMaxNumberOfAttributesPerEvent(int maxNumberOfAttributesPerEvent)Sets the global default max number of attributes per event.TraceConfigBuildersetMaxNumberOfAttributesPerLink(int maxNumberOfAttributesPerLink)Sets the global default max number of attributes per link.TraceConfigBuildersetMaxNumberOfEvents(int maxNumberOfEvents)Sets the global default max number of events perSpan.TraceConfigBuildersetMaxNumberOfLinks(int maxNumberOfLinks)Sets the global default max number of links perSpan.TraceConfigBuildersetSampler(Sampler sampler)Sets the global defaultSampler.TraceConfigBuildersetTraceIdRatioBased(double samplerRatio)Sets the global defaultSampler.
-
-
-
Method Detail
-
fromConfigMap
protected TraceConfigBuilder 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:
fromConfigMapin classio.opentelemetry.sdk.common.export.ConfigBuilder<TraceConfigBuilder>- Parameters:
configMap-Mapholding the configuration values.- Returns:
- this
-
readProperties
public TraceConfigBuilder readProperties(Properties properties)
* Sets the configuration values from the given properties object for only the available keys.- Overrides:
readPropertiesin classio.opentelemetry.sdk.common.export.ConfigBuilder<TraceConfigBuilder>- Parameters:
properties-Propertiesholding the configuration values.- Returns:
- this
-
readEnvironmentVariables
public TraceConfigBuilder readEnvironmentVariables()
* Sets the configuration values from environment variables for only the available keys.- Overrides:
readEnvironmentVariablesin classio.opentelemetry.sdk.common.export.ConfigBuilder<TraceConfigBuilder>- Returns:
- this.
-
readSystemProperties
public TraceConfigBuilder readSystemProperties()
* Sets the configuration values from system properties for only the available keys.- Overrides:
readSystemPropertiesin classio.opentelemetry.sdk.common.export.ConfigBuilder<TraceConfigBuilder>- Returns:
- this.
-
setSampler
public TraceConfigBuilder setSampler(Sampler sampler)
- Parameters:
sampler- the global defaultSampler.- Returns:
- this.
-
setTraceIdRatioBased
public TraceConfigBuilder setTraceIdRatioBased(double samplerRatio)
- Parameters:
samplerRatio- the global default ratio used to make decisions onSpansampling.- Returns:
- this.
-
setMaxNumberOfAttributes
public TraceConfigBuilder 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 TraceConfigBuilder 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 TraceConfigBuilder 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 TraceConfigBuilder 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 TraceConfigBuilder 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 TraceConfigBuilder 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 aTraceConfigwith the desired values.- Returns:
- a
TraceConfigwith the desired values. - Throws:
IllegalArgumentException- if any of the max numbers are not positive.
-
-