Class RequestAwareGRpcMetricsTagsContributor<ReqT>
- java.lang.Object
-
- org.lognet.springboot.grpc.autoconfigure.metrics.RequestAwareGRpcMetricsTagsContributor<ReqT>
-
- All Implemented Interfaces:
GRpcMetricsTagsContributor
public abstract class RequestAwareGRpcMetricsTagsContributor<ReqT> extends java.lang.Object implements GRpcMetricsTagsContributor
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRequestAwareGRpcMetricsTagsContributor(java.lang.Class<ReqT> tClass)protectedRequestAwareGRpcMetricsTagsContributor(java.lang.Class<ReqT> tClass, io.grpc.MethodDescriptor.MethodType firstMethodType, io.grpc.MethodDescriptor.MethodType... otherMethodTypes)protectedRequestAwareGRpcMetricsTagsContributor(java.lang.Class<ReqT> tClass, java.util.Set<io.grpc.MethodDescriptor.MethodType> methodTypes)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanaccepts(java.lang.Object o)java.lang.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.java.lang.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.java.lang.Iterable<io.micrometer.core.instrument.Tag>getTags(ReqT request, io.grpc.MethodDescriptor<?,?> methodDescriptor, io.grpc.Attributes attributes)Deprecated.booleanmightAccept(io.grpc.MethodDescriptor<?,?> methodDescriptor)
-
-
-
Constructor Detail
-
RequestAwareGRpcMetricsTagsContributor
protected RequestAwareGRpcMetricsTagsContributor(java.lang.Class<ReqT> tClass, java.util.Set<io.grpc.MethodDescriptor.MethodType> methodTypes)
-
RequestAwareGRpcMetricsTagsContributor
protected RequestAwareGRpcMetricsTagsContributor(java.lang.Class<ReqT> tClass, io.grpc.MethodDescriptor.MethodType firstMethodType, io.grpc.MethodDescriptor.MethodType... otherMethodTypes)
-
RequestAwareGRpcMetricsTagsContributor
protected RequestAwareGRpcMetricsTagsContributor(java.lang.Class<ReqT> tClass)
-
-
Method Detail
-
mightAccept
public final boolean mightAccept(io.grpc.MethodDescriptor<?,?> methodDescriptor)
-
accepts
public final boolean accepts(java.lang.Object o)
-
getTags
public java.lang.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:
getTagsin interfaceGRpcMetricsTagsContributor
-
addTags
public java.lang.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 messagemethodDescriptor-attributes-existingTags- currently accumulated tags- Returns:
- new tags
-
getTags
@Deprecated public java.lang.Iterable<io.micrometer.core.instrument.Tag> getTags(ReqT request, io.grpc.MethodDescriptor<?,?> methodDescriptor, io.grpc.Attributes attributes)
Deprecated.Prefer overridingaddTags(Object, MethodDescriptor, Attributes, Tags)if you want to get a hold of already added tags(for streaming calls) and accumulate tag's value.
-
-