Package io.grpc.gcp.csm.observability
Class CsmObservability.Builder
- java.lang.Object
-
- io.grpc.gcp.csm.observability.CsmObservability.Builder
-
- Enclosing class:
- CsmObservability
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/11249") public static final class CsmObservability.Builder extends Object
Builder for configuringCsmObservability.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CsmObservability.BuilderaddOptionalLabel(String optionalLabelKey)Adds optionalLabelKey to all the metrics that can provide value for the optionalLabelKey.CsmObservabilitybuild()Returns a newCsmObservabilitybuilt with the configuration of thisCsmObservability.Builder.CsmObservability.BuilderdisableAllMetrics()Disable all metrics.CsmObservability.BuilderdisableMetrics(Collection<String> disableMetrics)Disables the specified metrics from being collected and exported.CsmObservability.BuilderenableMetrics(Collection<String> enableMetrics)Enables the specified metrics for collection and export.CsmObservability.Buildersdk(io.opentelemetry.api.OpenTelemetry sdk)Sets theOpenTelemetryentrypoint to use.
-
-
-
Method Detail
-
sdk
public CsmObservability.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.
-
addOptionalLabel
public CsmObservability.Builder addOptionalLabel(String optionalLabelKey)
Adds optionalLabelKey to all the metrics that can provide value for the optionalLabelKey.
-
enableMetrics
public CsmObservability.Builder enableMetrics(Collection<String> enableMetrics)
Enables the specified metrics for collection and export. By default, only a subset of metrics are enabled.
-
disableMetrics
public CsmObservability.Builder disableMetrics(Collection<String> disableMetrics)
Disables the specified metrics from being collected and exported.
-
disableAllMetrics
public CsmObservability.Builder disableAllMetrics()
Disable all metrics. If set to true all metrics must be explicitly enabled.
-
build
public CsmObservability build()
Returns a newCsmObservabilitybuilt with the configuration of thisCsmObservability.Builder.
-
-