Package io.grpc.gcp.csm.observability
Class CsmObservability
- java.lang.Object
-
- io.grpc.gcp.csm.observability.CsmObservability
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/11249") public final class CsmObservability extends Object implements Closeable
The entrypoint for GCP's CSM OpenTelemetry metrics functionality in gRPC.CsmObservability uses
OpenTelemetry
APIs for instrumentation. When no SDK is explicitly added no telemetry data will be collected. Seeio.opentelemetry.sdk.OpenTelemetrySdk
for information on how to construct the SDK.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CsmObservability.Builder
Builder for configuringCsmObservability
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
static CsmObservability.Builder
newBuilder()
void
registerGlobal()
Registers CsmObservability globally, applying its configuration to all subsequently created gRPC channels and servers.
-
-
-
Method Detail
-
newBuilder
public static CsmObservability.Builder newBuilder()
-
registerGlobal
public void registerGlobal()
Registers CsmObservability globally, applying its configuration to all subsequently created gRPC channels and servers.Note: Only one of CsmObservability and GrpcOpenTelemetry instance can be registered globally. Any subsequent call to
registerGlobal()
will throw anIllegalStateException
.
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-