Package io.grpc.opentelemetry
Class GrpcOpenTelemetry.Builder
- java.lang.Object
-
- io.grpc.opentelemetry.GrpcOpenTelemetry.Builder
-
- Enclosing class:
- GrpcOpenTelemetry
public static class GrpcOpenTelemetry.Builder extends Object
Builder for configuringGrpcOpenTelemetry
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GrpcOpenTelemetry.Builder
addOptionalLabel(String optionalLabelKey)
Adds optionalLabelKey to all the metrics that can provide value for the optionalLabelKey.GrpcOpenTelemetry
build()
Returns a newGrpcOpenTelemetry
built with the configuration of thisGrpcOpenTelemetry.Builder
.GrpcOpenTelemetry.Builder
disableAllMetrics()
Disable all metrics.GrpcOpenTelemetry.Builder
disableMetrics(Collection<String> disableMetrics)
Disables the specified metrics from being collected and exported.GrpcOpenTelemetry.Builder
enableMetrics(Collection<String> enableMetrics)
Enables the specified metrics for collection and export.GrpcOpenTelemetry.Builder
sdk(io.opentelemetry.api.OpenTelemetry sdk)
Sets theOpenTelemetry
entrypoint to use.
-
-
-
Method Detail
-
sdk
public GrpcOpenTelemetry.Builder sdk(io.opentelemetry.api.OpenTelemetry sdk)
Sets theOpenTelemetry
entrypoint to use. This can be used to configure OpenTelemetry by returning the instance created by aio.opentelemetry.sdk.OpenTelemetrySdkBuilder
.
-
addOptionalLabel
public GrpcOpenTelemetry.Builder addOptionalLabel(String optionalLabelKey)
Adds optionalLabelKey to all the metrics that can provide value for the optionalLabelKey.
-
enableMetrics
public GrpcOpenTelemetry.Builder enableMetrics(Collection<String> enableMetrics)
Enables the specified metrics for collection and export. By default, only a subset of metrics are enabled.
-
disableMetrics
public GrpcOpenTelemetry.Builder disableMetrics(Collection<String> disableMetrics)
Disables the specified metrics from being collected and exported.
-
disableAllMetrics
public GrpcOpenTelemetry.Builder disableAllMetrics()
Disable all metrics. If set to true all metrics must be explicitly enabled.
-
build
public GrpcOpenTelemetry build()
Returns a newGrpcOpenTelemetry
built with the configuration of thisGrpcOpenTelemetry.Builder
.
-
-