Class GrpcServerObservationContext
java.lang.Object
io.micrometer.observation.Observation.Context
io.micrometer.observation.transport.ReceiverContext<io.grpc.Metadata>
io.micrometer.observation.transport.RequestReplyReceiverContext<io.grpc.Metadata,Object>
io.micrometer.core.instrument.binder.grpc.GrpcServerObservationContext
- All Implemented Interfaces:
io.micrometer.observation.Observation.ContextView,io.micrometer.observation.transport.ResponseContext<Object>
public class GrpcServerObservationContext
extends io.micrometer.observation.transport.RequestReplyReceiverContext<io.grpc.Metadata,Object>
Observation.Context for gRPC server.- Since:
- 1.10.0
-
Constructor Summary
ConstructorsConstructorDescriptionGrpcServerObservationContext(io.micrometer.observation.transport.Propagator.Getter<io.grpc.Metadata> getter) -
Method Summary
Modifier and TypeMethodDescription@Nullable String@Nullable io.grpc.MetadataResponse headers.@Nullable Stringio.grpc.MethodDescriptor.MethodType@Nullable String@Nullable Integer@Nullable String@Nullable io.grpc.Status.Code@Nullable io.grpc.MetadataTrailers.booleanIndicate whether the request is cancelled or not.voidsetAuthority(@Nullable String authority) voidsetCancelled(boolean cancelled) Settruewhen the request is cancelled.voidsetFullMethodName(String fullMethodName) voidsetHeaders(io.grpc.Metadata headers) Set response headers.voidsetMethodName(String methodName) voidsetMethodType(io.grpc.MethodDescriptor.MethodType methodType) voidsetPeerName(@Nullable String peerName) voidsetPeerPort(@Nullable Integer peerPort) voidsetServiceName(String serviceName) voidsetStatusCode(io.grpc.Status.Code statusCode) voidsetTrailers(io.grpc.Metadata trailers) Set trailers.Methods inherited from class io.micrometer.observation.transport.RequestReplyReceiverContext
getResponse, setResponseMethods inherited from class io.micrometer.observation.transport.ReceiverContext
getCarrier, getGetter, getKind, getRemoteServiceAddress, getRemoteServiceName, setCarrier, setRemoteServiceAddress, setRemoteServiceNameMethods inherited from class io.micrometer.observation.Observation.Context
addHighCardinalityKeyValue, addHighCardinalityKeyValues, addLowCardinalityKeyValue, addLowCardinalityKeyValues, clear, computeIfAbsent, containsKey, get, getAllKeyValues, getContextualName, getError, getHighCardinalityKeyValue, getHighCardinalityKeyValues, getLowCardinalityKeyValue, getLowCardinalityKeyValues, getName, getOrDefault, getParentObservation, getRequired, put, remove, removeHighCardinalityKeyValue, removeHighCardinalityKeyValues, removeLowCardinalityKeyValue, removeLowCardinalityKeyValues, setContextualName, setError, setName, setParentObservation, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.micrometer.observation.Observation.ContextView
getOrDefault
-
Constructor Details
-
GrpcServerObservationContext
public GrpcServerObservationContext(io.micrometer.observation.transport.Propagator.Getter<io.grpc.Metadata> getter)
-
-
Method Details
-
getServiceName
-
setServiceName
-
getMethodName
-
setMethodName
-
getFullMethodName
-
setFullMethodName
-
getMethodType
public io.grpc.MethodDescriptor.MethodType getMethodType() -
setMethodType
public void setMethodType(io.grpc.MethodDescriptor.MethodType methodType) -
getStatusCode
public @Nullable io.grpc.Status.Code getStatusCode() -
setStatusCode
public void setStatusCode(io.grpc.Status.Code statusCode) -
getAuthority
-
setAuthority
-
getHeaders
public @Nullable io.grpc.Metadata getHeaders()Response headers.- Returns:
- response headers
- Since:
- 1.13.0
-
setHeaders
public void setHeaders(io.grpc.Metadata headers) Set response headers.- Parameters:
headers- response headers- Since:
- 1.13.0
-
getTrailers
public @Nullable io.grpc.Metadata getTrailers()Trailers.- Returns:
- trailers
- Since:
- 1.13.0
-
setTrailers
public void setTrailers(io.grpc.Metadata trailers) Set trailers.- Parameters:
trailers-- Since:
- 1.13.0
-
isCancelled
public boolean isCancelled()Indicate whether the request is cancelled or not.- Returns:
trueif the request is cancelled- Since:
- 1.14
-
setCancelled
public void setCancelled(boolean cancelled) Settruewhen the request is cancelled.- Since:
- 1.14
-
getPeerName
-
setPeerName
-
getPeerPort
-
setPeerPort
-