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.ObjectBuilder for configuringGrpcOpenTelemetry.
-
-
Field Summary
Fields Modifier and Type Field Description private booleandisableAllprivate java.util.Map<java.lang.String,java.lang.Boolean>enableMetricsprivate io.opentelemetry.api.OpenTelemetryopenTelemetrySdkprivate java.util.Collection<java.lang.String>optionalLabelsprivate java.util.List<OpenTelemetryPlugin>plugins
-
Constructor Summary
Constructors Modifier Constructor Description privateBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GrpcOpenTelemetry.BuilderaddOptionalLabel(java.lang.String optionalLabelKey)Adds optionalLabelKey to all the metrics that can provide value for the optionalLabelKey.GrpcOpenTelemetrybuild()Returns a newGrpcOpenTelemetrybuilt with the configuration of thisGrpcOpenTelemetry.Builder.GrpcOpenTelemetry.BuilderdisableAllMetrics()Disable all metrics.GrpcOpenTelemetry.BuilderdisableMetrics(java.util.Collection<java.lang.String> disableMetrics)Disables the specified metrics from being collected and exported.GrpcOpenTelemetry.BuilderenableMetrics(java.util.Collection<java.lang.String> enableMetrics)Enables the specified metrics for collection and export.(package private) GrpcOpenTelemetry.BuilderenableTracing(boolean enable)(package private) GrpcOpenTelemetry.Builderplugin(OpenTelemetryPlugin plugin)GrpcOpenTelemetry.Buildersdk(io.opentelemetry.api.OpenTelemetry sdk)Sets theOpenTelemetryentrypoint 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 theOpenTelemetryentrypoint 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 newGrpcOpenTelemetrybuilt with the configuration of thisGrpcOpenTelemetry.Builder.
-
-