Class GrpcOpenTelemetry


  • public final class GrpcOpenTelemetry
    extends Object
    The entrypoint for OpenTelemetry metrics functionality in gRPC.

    GrpcOpenTelemetry uses OpenTelemetry APIs for instrumentation. When no SDK is explicitly added no telemetry data will be collected. See io.opentelemetry.sdk.OpenTelemetrySdk for information on how to construct the SDK.

    • Method Detail

      • registerGlobal

        @ExperimentalApi("https://github.com/grpc/grpc-java/issues/10591")
        public void registerGlobal()
        Registers GrpcOpenTelemetry globally, applying its configuration to all subsequently created gRPC channels and servers.
      • configureServerBuilder

        public void configureServerBuilder​(ServerBuilder<?> serverBuilder)
        Configures the given ServerBuilder with OpenTelemetry metrics instrumentation.
        Parameters:
        serverBuilder - the server builder to configure