Class ObservationGrpcClientInterceptor
java.lang.Object
io.micrometer.core.instrument.binder.grpc.ObservationGrpcClientInterceptor
- All Implemented Interfaces:
io.grpc.ClientInterceptor
A gRPC client interceptor that works with
Observation.
Usage:
ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 8080)
.intercept(new ObservationGrpcClientInterceptor(observationRegistry))
.build();
channel.newCall(method, options);
The instrumentation is based on the behavior of Spring Cloud Sleuth and Brave.- Since:
- 1.10.0
-
Constructor Summary
ConstructorsConstructorDescriptionObservationGrpcClientInterceptor(io.micrometer.observation.ObservationRegistry registry) -
Method Summary
Modifier and TypeMethodDescription<ReqT,RespT>
io.grpc.ClientCall<ReqT, RespT> interceptCall(io.grpc.MethodDescriptor<ReqT, RespT> method, io.grpc.CallOptions callOptions, io.grpc.Channel next) voidsetCustomConvention(GrpcClientObservationConvention customConvention) Set a customGrpcClientObservationConvention.
-
Constructor Details
-
ObservationGrpcClientInterceptor
public ObservationGrpcClientInterceptor(io.micrometer.observation.ObservationRegistry registry)
-
-
Method Details
-
interceptCall
public <ReqT,RespT> io.grpc.ClientCall<ReqT,RespT> interceptCall(io.grpc.MethodDescriptor<ReqT, RespT> method, io.grpc.CallOptions callOptions, io.grpc.Channel next) - Specified by:
interceptCallin interfaceio.grpc.ClientInterceptor
-
setCustomConvention
Set a customGrpcClientObservationConvention.- Parameters:
customConvention- a custom convention
-