Class EnabledTraceUtil (3.30.0)

public class EnabledTraceUtil implements TraceUtil

A utility class that uses OpenTelemetry for trace collection. FirestoreOpenTelemetryOptions in FirestoreOptions can be used to configure its behavior.

Inheritance

java.lang.Object > EnabledTraceUtil

Implements

TraceUtil

Methods

currentContext()

public TraceUtil.Context currentContext()

Returns the current Context.

Returns
Type Description
TraceUtil.Context

currentSpan()

public TraceUtil.Span currentSpan()

Returns the current span.

Returns
Type Description
TraceUtil.Span

getChannelConfigurator()

public ApiFunction<ManagedChannelBuilder,ManagedChannelBuilder> getChannelConfigurator()

Returns a channel configurator for gRPC, or null if tracing is disabled.

Returns
Type Description
ApiFunction<io.grpc.ManagedChannelBuilder,io.grpc.ManagedChannelBuilder>

getOpenTelemetry()

public OpenTelemetry getOpenTelemetry()
Returns
Type Description
io.opentelemetry.api.OpenTelemetry

startSpan(String spanName)

public EnabledTraceUtil.Span startSpan(String spanName)

Starts a new span with the given name, sets it as the current span, and returns it.

Parameter
Name Description
spanName String
Returns
Type Description
com.google.cloud.firestore.telemetry.EnabledTraceUtil.Span

startSpan(String spanName, TraceUtil.Context parent)

public TraceUtil.Span startSpan(String spanName, TraceUtil.Context parent)

Starts a new span with the given name and the given context as its parent, sets it as the current span, and returns it.

Parameters
Name Description
spanName String
parent TraceUtil.Context
Returns
Type Description
TraceUtil.Span