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
ConstructorsModifierConstructorDescriptionprotectedRequestAwareGRpcMetricsTagsContributor(Class<ReqT> tClass)protectedRequestAwareGRpcMetricsTagsContributor(Class<ReqT> tClass, io.grpc.MethodDescriptor.MethodType firstMethodType, io.grpc.MethodDescriptor.MethodType... otherMethodTypes)protectedRequestAwareGRpcMetricsTagsContributor(Class<ReqT> tClass, Set<io.grpc.MethodDescriptor.MethodType> methodTypes) -
Method Summary
Modifier and TypeMethodDescriptionbooleanIterable<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.booleanmightAccept(io.grpc.MethodDescriptor<?,?> methodDescriptor)
-
Constructor Details
-
RequestAwareGRpcMetricsTagsContributor
-
RequestAwareGRpcMetricsTagsContributor
-
RequestAwareGRpcMetricsTagsContributor
-
-
Method Details
-
mightAccept
public final boolean mightAccept(io.grpc.MethodDescriptor<?,?> methodDescriptor) -
accepts
-
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:
getTagsin interfaceGRpcMetricsTagsContributor
-
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 messagemethodDescriptor-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 overridingaddTags(Object, MethodDescriptor, Attributes, Tags)if you want to get a hold of already added tags(for streaming calls) and accumulate tag's value.
-