Class SimpleSpanProcessor.Builder
- java.lang.Object
-
- io.opentelemetry.sdk.common.export.ConfigBuilder<SimpleSpanProcessor.Builder>
-
- io.opentelemetry.sdk.trace.export.SimpleSpanProcessor.Builder
-
- Enclosing class:
- SimpleSpanProcessor
public static final class SimpleSpanProcessor.Builder extends io.opentelemetry.sdk.common.export.ConfigBuilder<SimpleSpanProcessor.Builder>
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 SimpleSpanProcessor.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.SimpleSpanProcessor.Builder
setExportOnlySampled(boolean exportOnlySampled)
Set whether only sampled spans should be exported.
-
-
-
Method Detail
-
fromConfigMap
protected SimpleSpanProcessor.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. 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<SimpleSpanProcessor.Builder>
- Parameters:
configMap
-Map
holding the configuration values.- Returns:
- this.
-
setExportOnlySampled
public SimpleSpanProcessor.Builder 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
.
-
-