Class RequestAwareGRpcMetricsTagsContributor<ReqT>

java.lang.Object
org.lognet.springboot.grpc.autoconfigure.metrics.RequestAwareGRpcMetricsTagsContributor<ReqT>
All Implemented Interfaces:
GRpcMetricsTagsContributor

public abstract class RequestAwareGRpcMetricsTagsContributor<ReqT> extends Object implements GRpcMetricsTagsContributor
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
    protected
    RequestAwareGRpcMetricsTagsContributor​(Class<ReqT> tClass, io.grpc.MethodDescriptor.MethodType firstMethodType, io.grpc.MethodDescriptor.MethodType... otherMethodTypes)
     
    protected
    RequestAwareGRpcMetricsTagsContributor​(Class<ReqT> tClass, Set<io.grpc.MethodDescriptor.MethodType> methodTypes)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Iterable<io.micrometer.core.instrument.Tag>
    addTags​(ReqT request, io.grpc.MethodDescriptor<?,​?> methodDescriptor, io.grpc.Attributes attributes, io.micrometer.core.instrument.Tags existingTags)
    Contribute tags when receiving the request message.
    Iterable<io.micrometer.core.instrument.Tag>
    getTags​(io.grpc.Status status, io.grpc.MethodDescriptor<?,​?> methodDescriptor, io.grpc.Attributes attributes)
    Contribute tags at the end of the call, independent of the request message.
    Iterable<io.micrometer.core.instrument.Tag>
    getTags​(ReqT request, io.grpc.MethodDescriptor<?,​?> methodDescriptor, io.grpc.Attributes attributes)
    Deprecated.
    boolean
    mightAccept​(io.grpc.MethodDescriptor<?,​?> methodDescriptor)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RequestAwareGRpcMetricsTagsContributor

      protected RequestAwareGRpcMetricsTagsContributor(Class<ReqT> tClass, Set<io.grpc.MethodDescriptor.MethodType> methodTypes)
    • RequestAwareGRpcMetricsTagsContributor

      protected RequestAwareGRpcMetricsTagsContributor(Class<ReqT> tClass, io.grpc.MethodDescriptor.MethodType firstMethodType, io.grpc.MethodDescriptor.MethodType... otherMethodTypes)
    • RequestAwareGRpcMetricsTagsContributor

      protected RequestAwareGRpcMetricsTagsContributor(Class<ReqT> tClass)
  • Method Details

    • mightAccept

      public final boolean mightAccept(io.grpc.MethodDescriptor<?,​?> methodDescriptor)
    • accepts

      public final boolean accepts(Object o)
    • getTags

      public Iterable<io.micrometer.core.instrument.Tag> getTags(io.grpc.Status status, io.grpc.MethodDescriptor<?,​?> methodDescriptor, io.grpc.Attributes attributes)
      Contribute tags at the end of the call, independent of the request message.
      Specified by:
      getTags in interface GRpcMetricsTagsContributor
    • addTags

      public Iterable<io.micrometer.core.instrument.Tag> addTags(ReqT request, io.grpc.MethodDescriptor<?,​?> methodDescriptor, io.grpc.Attributes attributes, io.micrometer.core.instrument.Tags existingTags)
      Contribute tags when receiving the request message. For streaming calls, this method is invoked several times (once per message). The implementation should NOT concatenate existing tags with newly produced tags. It's supposed to produce new tags or accumulate existing tag's value.
      Parameters:
      request - current request message
      methodDescriptor -
      attributes -
      existingTags - currently accumulated tags
      Returns:
      new tags
    • getTags

      @Deprecated public Iterable<io.micrometer.core.instrument.Tag> getTags(ReqT request, io.grpc.MethodDescriptor<?,​?> methodDescriptor, io.grpc.Attributes attributes)
      Deprecated.
      Prefer overriding addTags(Object, MethodDescriptor, Attributes, Tags) if you want to get a hold of already added tags(for streaming calls) and accumulate tag's value.