Class MetricsTracerFactory (2.58.0)

public class MetricsTracerFactory implements ApiTracerFactory

A ApiTracerFactory to build instances of MetricsTracer.

This class wraps the MetricsRecorder and pass it to MetricsTracer. It will be used to record metrics in MetricsTracer.

This class is expected to be initialized once during client initialization.

Inheritance

java.lang.Object > MetricsTracerFactory

Implements

ApiTracerFactory

Constructors

MetricsTracerFactory(MetricsRecorder metricsRecorder)

public MetricsTracerFactory(MetricsRecorder metricsRecorder)

Creates a MetricsTracerFactory with no additional client level attributes.

Parameter
Name Description
metricsRecorder MetricsRecorder

MetricsTracerFactory(MetricsRecorder metricsRecorder, Map<String,String> attributes)

public MetricsTracerFactory(MetricsRecorder metricsRecorder, Map<String,String> attributes)

Pass in a Map of client level attributes which will be added to every single MetricsTracer created from the ApiTracerFactory.

Parameters
Name Description
metricsRecorder MetricsRecorder
attributes Map<String,String>

Fields

metricsRecorder

protected MetricsRecorder metricsRecorder
Field Value
Type Description
MetricsRecorder

Methods

newTracer(ApiTracer parent, SpanName spanName, ApiTracerFactory.OperationType operationType)

public ApiTracer newTracer(ApiTracer parent, SpanName spanName, ApiTracerFactory.OperationType operationType)

Create a new ApiTracer that will be a child of the current context.

Parameters
Name Description
parent ApiTracer
spanName SpanName
operationType ApiTracerFactory.OperationType
Returns
Type Description
ApiTracer