Package io.grpc.opentelemetry
Class GrpcOpenTelemetry.Builder
java.lang.Object
io.grpc.opentelemetry.GrpcOpenTelemetry.Builder
- Enclosing class:
GrpcOpenTelemetry
Builder for configuring
GrpcOpenTelemetry
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private io.opentelemetry.api.OpenTelemetry
private final Collection
<String> private final List
<OpenTelemetryPlugin> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddOptionalLabel
(String optionalLabelKey) Adds optionalLabelKey to all the metrics that can provide value for the optionalLabelKey.build()
Returns a newGrpcOpenTelemetry
built with the configuration of thisGrpcOpenTelemetry.Builder
.Disable all metrics.disableMetrics
(Collection<String> disableMetrics) Disables the specified metrics from being collected and exported.enableMetrics
(Collection<String> enableMetrics) Enables the specified metrics for collection and export.(package private) GrpcOpenTelemetry.Builder
enableTracing
(boolean enable) (package private) GrpcOpenTelemetry.Builder
plugin
(OpenTelemetryPlugin plugin) sdk
(io.opentelemetry.api.OpenTelemetry sdk) Sets theOpenTelemetry
entrypoint to use.
-
Field Details
-
openTelemetrySdk
private io.opentelemetry.api.OpenTelemetry openTelemetrySdk -
plugins
-
optionalLabels
-
enableMetrics
-
disableAll
private boolean disableAll
-
-
Constructor Details
-
Builder
private Builder()
-
-
Method Details
-
sdk
Sets theOpenTelemetry
entrypoint to use. This can be used to configure OpenTelemetry by returning the instance created by aio.opentelemetry.sdk.OpenTelemetrySdkBuilder
. -
plugin
-
addOptionalLabel
Adds optionalLabelKey to all the metrics that can provide value for the optionalLabelKey. -
enableMetrics
Enables the specified metrics for collection and export. By default, only a subset of metrics are enabled. -
disableMetrics
Disables the specified metrics from being collected and exported. -
disableAllMetrics
Disable all metrics. If set to true all metrics must be explicitly enabled. -
enableTracing
-
build
Returns a newGrpcOpenTelemetry
built with the configuration of thisGrpcOpenTelemetry.Builder
.
-