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 SimpleSpanProcessorbuild()Returns a newSimpleSpanProcessorthat converts spans to proto and forwards them to the givenspanExporter.protected SimpleSpanProcessor.BuilderfromConfigMap(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.BuildersetExportOnlySampled(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:
fromConfigMapin classio.opentelemetry.sdk.common.export.ConfigBuilder<SimpleSpanProcessor.Builder>- Parameters:
configMap-Mapholding 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- 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.
-
-