Class EnabledTraceUtil (2.32.2)
public class EnabledTraceUtil implements TraceUtil
Tracing utility implementation, used to stub out tracing instrumentation when tracing is enabled.
Methods
addSettingsAttributesToCurrentSpan(SpanBuilder spanBuilder)
public SpanBuilder addSettingsAttributesToCurrentSpan(SpanBuilder spanBuilder)
Applies the current Datastore instance settings as attributes to the current Span
Parameter |
Name |
Description |
spanBuilder |
io.opentelemetry.api.trace.SpanBuilder
|
Returns |
Type |
Description |
io.opentelemetry.api.trace.SpanBuilder |
|
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> |
|
getCurrentContext()
public TraceUtil.Context getCurrentContext()
Returns the current Context.
getCurrentSpan()
public TraceUtil.Span getCurrentSpan()
Returns the current span.
getOpenTelemetry()
public OpenTelemetry getOpenTelemetry()
Returns |
Type |
Description |
io.opentelemetry.api.OpenTelemetry |
|
getTracer()
public Tracer getTracer()
Returns the current OpenTelemetry Tracer when OpenTelemetry SDK is provided.
Returns |
Type |
Description |
io.opentelemetry.api.trace.Tracer |
|
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.datastore.telemetry.EnabledTraceUtil.Span |
|
startSpan(String spanName, TraceUtil.Span parentSpan)
public TraceUtil.Span startSpan(String spanName, TraceUtil.Span parentSpan)
Starts a new span with the given name and the span represented by the parentSpan as its parent,
sets it as the current span and returns it.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-11 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-11 UTC."],[],[]]