Package io.grpc.opentelemetry
Class GrpcOpenTelemetry.Builder
- java.lang.Object
-
- io.grpc.opentelemetry.GrpcOpenTelemetry.Builder
-
- Enclosing class:
- GrpcOpenTelemetry
public static class GrpcOpenTelemetry.Builder extends java.lang.Object
Builder for configuringGrpcOpenTelemetry
.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
disableAll
private java.util.Map<java.lang.String,java.lang.Boolean>
enableMetrics
private io.opentelemetry.api.OpenTelemetry
openTelemetrySdk
private java.util.Collection<java.lang.String>
optionalLabels
private java.util.List<OpenTelemetryPlugin>
plugins
-
Constructor Summary
Constructors Modifier Constructor Description private
Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GrpcOpenTelemetry.Builder
addOptionalLabel(java.lang.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(java.util.Collection<java.lang.String> disableMetrics)
Disables the specified metrics from being collected and exported.GrpcOpenTelemetry.Builder
enableMetrics(java.util.Collection<java.lang.String> enableMetrics)
Enables the specified metrics for collection and export.(package private) GrpcOpenTelemetry.Builder
enableTracing(boolean enable)
(package private) GrpcOpenTelemetry.Builder
plugin(OpenTelemetryPlugin plugin)
GrpcOpenTelemetry.Builder
sdk(io.opentelemetry.api.OpenTelemetry sdk)
Sets theOpenTelemetry
entrypoint to use.
-
-
-
Field Detail
-
openTelemetrySdk
private io.opentelemetry.api.OpenTelemetry openTelemetrySdk
-
plugins
private final java.util.List<OpenTelemetryPlugin> plugins
-
optionalLabels
private final java.util.Collection<java.lang.String> optionalLabels
-
enableMetrics
private final java.util.Map<java.lang.String,java.lang.Boolean> enableMetrics
-
disableAll
private boolean disableAll
-
-
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
.
-
plugin
GrpcOpenTelemetry.Builder plugin(OpenTelemetryPlugin plugin)
-
addOptionalLabel
public GrpcOpenTelemetry.Builder addOptionalLabel(java.lang.String optionalLabelKey)
Adds optionalLabelKey to all the metrics that can provide value for the optionalLabelKey.
-
enableMetrics
public GrpcOpenTelemetry.Builder enableMetrics(java.util.Collection<java.lang.String> enableMetrics)
Enables the specified metrics for collection and export. By default, only a subset of metrics are enabled.
-
disableMetrics
public GrpcOpenTelemetry.Builder disableMetrics(java.util.Collection<java.lang.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.
-
enableTracing
GrpcOpenTelemetry.Builder enableTracing(boolean enable)
-
build
public GrpcOpenTelemetry build()
Returns a newGrpcOpenTelemetry
built with the configuration of thisGrpcOpenTelemetry.Builder
.
-
-