Class MetricsTracer (2.41.0)

public class MetricsTracer implements ApiTracer

This class computes generic metrics that can be observed in the lifecycle of an RPC operation. The responsibility of recording metrics should delegate to MetricsRecorder, hence this class should not have any knowledge about the observability framework used for metrics recording.

Inheritance

java.lang.Object > MetricsTracer

Implements

ApiTracer

Constructors

MetricsTracer(MethodName methodName, MetricsRecorder metricsRecorder)

public MetricsTracer(MethodName methodName, MetricsRecorder metricsRecorder)
Parameters
NameDescription
methodNameMethodName
metricsRecorderMetricsRecorder

Methods

addAttributes(String key, String value)

public void addAttributes(String key, String value)

Add attributes that will be attached to all metrics. This is expected to be called by handwritten client teams to add additional attributes that are not supposed be collected by Gax.

Parameters
NameDescription
keyString
valueString