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 SimpleSpanProcessorbuild()Returns a newSimpleSpanProcessorthat converts spans to proto and forwards them to the givenspanExporter.protected SimpleSpanProcessorBuilderfromConfigMap(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.SimpleSpanProcessorBuildersetExportOnlySampled(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:
fromConfigMapin classio.opentelemetry.sdk.common.export.ConfigBuilder<SimpleSpanProcessorBuilder>- Parameters:
configMap-Mapholding 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- iftruereport only sampled spans.- Returns:
- this.
-
build
public SimpleSpanProcessor build()
Returns a newSimpleSpanProcessorthat converts spans to proto and forwards them to the givenspanExporter.- Returns:
- a new
SimpleSpanProcessor. - Throws:
NullPointerException- if thespanExporterisnull.
-
-