Class SimpleSpanProcessorBuilder
- java.lang.Object
-
- io.opentelemetry.sdk.common.export.ConfigBuilder<SimpleSpanProcessorBuilder>
-
- io.opentelemetry.sdk.trace.export.SimpleSpanProcessorBuilder
-
public final class SimpleSpanProcessorBuilder extends io.opentelemetry.sdk.common.export.ConfigBuilder<SimpleSpanProcessorBuilder>
Builder class forSimpleSpanProcessor
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleSpanProcessor
build()
Returns a newSimpleSpanProcessor
that converts spans to proto and forwards them to the givenspanExporter
.protected SimpleSpanProcessorBuilder
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.SimpleSpanProcessorBuilder
setExportOnlySampled(boolean exportOnlySampled)
Set whether only sampled spans should be exported.
-
-
-
Method Detail
-
fromConfigMap
protected SimpleSpanProcessorBuilder 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. This method looks for the following keys:otel.ssp.export.sampled
: to set whether only sampled spans should be exported.
- Specified by:
fromConfigMap
in classio.opentelemetry.sdk.common.export.ConfigBuilder<SimpleSpanProcessorBuilder>
- Parameters:
configMap
-Map
holding the configuration values.- Returns:
- this.
-
setExportOnlySampled
public SimpleSpanProcessorBuilder setExportOnlySampled(boolean exportOnlySampled)
Set whether only sampled spans should be exported.Default value is
true
.- Parameters:
exportOnlySampled
- iftrue
report only sampled spans.- Returns:
- this.
-
build
public SimpleSpanProcessor build()
Returns a newSimpleSpanProcessor
that converts spans to proto and forwards them to the givenspanExporter
.- Returns:
- a new
SimpleSpanProcessor
. - Throws:
NullPointerException
- if thespanExporter
isnull
.
-
-