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.Builder
addOptionalLabel(String optionalLabelKey)
Adds optionalLabelKey to all the metrics that can provide value for the optionalLabelKey.CsmObservability
build()
Returns a newCsmObservability
built with the configuration of thisCsmObservability.Builder
.CsmObservability.Builder
disableAllMetrics()
Disable all metrics.CsmObservability.Builder
disableMetrics(Collection<String> disableMetrics)
Disables the specified metrics from being collected and exported.CsmObservability.Builder
enableMetrics(Collection<String> enableMetrics)
Enables the specified metrics for collection and export.CsmObservability.Builder
sdk(io.opentelemetry.api.OpenTelemetry sdk)
Sets theOpenTelemetry
entrypoint to use.
-
-
-
Method Detail
-
sdk
public CsmObservability.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 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 newCsmObservability
built with the configuration of thisCsmObservability.Builder
.
-
-