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

    Constructors
    Constructor
    Description
    GrpcServerObservationContext(io.micrometer.observation.transport.Propagator.Getter<io.grpc.Metadata> getter)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable String
     
     
    @Nullable io.grpc.Metadata
    Response headers.
    @Nullable String
     
    io.grpc.MethodDescriptor.MethodType
     
    @Nullable String
     
    @Nullable Integer
     
    @Nullable String
     
    @Nullable io.grpc.Status.Code
     
    @Nullable io.grpc.Metadata
    Trailers.
    boolean
    Indicate whether the request is cancelled or not.
    void
    setAuthority(@Nullable String authority)
     
    void
    setCancelled(boolean cancelled)
    Set true when the request is cancelled.
    void
    setFullMethodName(String fullMethodName)
     
    void
    setHeaders(io.grpc.Metadata headers)
    Set response headers.
    void
    setMethodName(String methodName)
     
    void
    setMethodType(io.grpc.MethodDescriptor.MethodType methodType)
     
    void
    setPeerName(@Nullable String peerName)
     
    void
    setPeerPort(@Nullable Integer peerPort)
     
    void
    setServiceName(String serviceName)
     
    void
    setStatusCode(io.grpc.Status.Code statusCode)
     
    void
    setTrailers(io.grpc.Metadata trailers)
    Set trailers.

    Methods inherited from class io.micrometer.observation.transport.RequestReplyReceiverContext

    getResponse, setResponse

    Methods inherited from class io.micrometer.observation.transport.ReceiverContext

    getCarrier, getGetter, getKind, getRemoteServiceAddress, getRemoteServiceName, setCarrier, setRemoteServiceAddress, setRemoteServiceName

    Methods 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, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods 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

      public @Nullable String getServiceName()
    • setServiceName

      public void setServiceName(String serviceName)
    • getMethodName

      public @Nullable String getMethodName()
    • setMethodName

      public void setMethodName(String methodName)
    • getFullMethodName

      public String getFullMethodName()
    • setFullMethodName

      public void setFullMethodName(String fullMethodName)
    • 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

      public @Nullable String getAuthority()
    • setAuthority

      public void setAuthority(@Nullable String authority)
    • 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:
      true if the request is cancelled
      Since:
      1.14
    • setCancelled

      public void setCancelled(boolean cancelled)
      Set true when the request is cancelled.
      Since:
      1.14
    • getPeerName

      public @Nullable String getPeerName()
    • setPeerName

      public void setPeerName(@Nullable String peerName)
    • getPeerPort

      public @Nullable Integer getPeerPort()
    • setPeerPort

      public void setPeerPort(@Nullable Integer peerPort)