Send feedback
Interface TraceUtil (2.22.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.22.0 keyboard_arrow_down
public interface TraceUtil
Utility interface to manage OpenTelemetry tracing instrumentation based on the configuration.
Static Fields
ATTRIBUTES_KEY_DEFERRED
public static final String ATTRIBUTES_KEY_DEFERRED
Field Value
Type
Description
String
ATTRIBUTES_KEY_DOCUMENT_COUNT
public static final String ATTRIBUTES_KEY_DOCUMENT_COUNT
Field Value
Type
Description
String
ATTRIBUTES_KEY_MISSING
public static final String ATTRIBUTES_KEY_MISSING
Field Value
Type
Description
String
ATTRIBUTES_KEY_MORE_RESULTS
public static final String ATTRIBUTES_KEY_MORE_RESULTS
Field Value
Type
Description
String
ATTRIBUTES_KEY_READ_CONSISTENCY
public static final String ATTRIBUTES_KEY_READ_CONSISTENCY
Field Value
Type
Description
String
ATTRIBUTES_KEY_RECEIVED
public static final String ATTRIBUTES_KEY_RECEIVED
Field Value
Type
Description
String
ATTRIBUTES_KEY_TRANSACTIONAL
public static final String ATTRIBUTES_KEY_TRANSACTIONAL
Field Value
Type
Description
String
ATTRIBUTES_KEY_TRANSACTION_ID
public static final String ATTRIBUTES_KEY_TRANSACTION_ID
Field Value
Type
Description
String
ATTRIBUTE_SERVICE_PREFIX
public static final String ATTRIBUTE_SERVICE_PREFIX
Field Value
Type
Description
String
ENABLE_TRACING_ENV_VAR
public static final String ENABLE_TRACING_ENV_VAR
Field Value
Type
Description
String
LIBRARY_NAME
public static final String LIBRARY_NAME
Field Value
Type
Description
String
SPAN_NAME_ALLOCATE_IDS
public static final String SPAN_NAME_ALLOCATE_IDS
Field Value
Type
Description
String
SPAN_NAME_BEGIN_TRANSACTION
public static final String SPAN_NAME_BEGIN_TRANSACTION
Field Value
Type
Description
String
SPAN_NAME_COMMIT
public static final String SPAN_NAME_COMMIT
Field Value
Type
Description
String
SPAN_NAME_LOOKUP
public static final String SPAN_NAME_LOOKUP
Field Value
Type
Description
String
SPAN_NAME_RESERVE_IDS
public static final String SPAN_NAME_RESERVE_IDS
Field Value
Type
Description
String
SPAN_NAME_ROLLBACK
public static final String SPAN_NAME_ROLLBACK
Field Value
Type
Description
String
SPAN_NAME_RUN_AGGREGATION_QUERY
public static final String SPAN_NAME_RUN_AGGREGATION_QUERY
Field Value
Type
Description
String
SPAN_NAME_RUN_QUERY
public static final String SPAN_NAME_RUN_QUERY
Field Value
Type
Description
String
SPAN_NAME_TRANSACTION_COMMIT
public static final String SPAN_NAME_TRANSACTION_COMMIT
Field Value
Type
Description
String
SPAN_NAME_TRANSACTION_LOOKUP
public static final String SPAN_NAME_TRANSACTION_LOOKUP
Field Value
Type
Description
String
SPAN_NAME_TRANSACTION_RUN
public static final String SPAN_NAME_TRANSACTION_RUN
Field Value
Type
Description
String
SPAN_NAME_TRANSACTION_RUN_AGGREGATION_QUERY
public static final String SPAN_NAME_TRANSACTION_RUN_AGGREGATION_QUERY
Field Value
Type
Description
String
SPAN_NAME_TRANSACTION_RUN_QUERY
public static final String SPAN_NAME_TRANSACTION_RUN_QUERY
Field Value
Type
Description
String
Static Methods
getInstance(DatastoreOptions datastoreOptions)
public static TraceUtil getInstance ( DatastoreOptions datastoreOptions )
Creates and returns an instance of the TraceUtil class.
Parameter
Name
Description
datastoreOptions
DatastoreOptions
The DatastoreOptions object that is requesting an instance of
TraceUtil.
Returns
Type
Description
TraceUtil
An instance of the TraceUtil class.
Methods
addSettingsAttributesToCurrentSpan(SpanBuilder spanBuilder)
public abstract SpanBuilder addSettingsAttributesToCurrentSpan ( SpanBuilder spanBuilder )
Adds common SpanAttributes to the current span, useful when hand-creating a new Span without
using the TraceUtil.Span interface.
Parameter
Name
Description
spanBuilder
io.opentelemetry.api.trace.SpanBuilder
Returns
Type
Description
io.opentelemetry.api.trace.SpanBuilder
getChannelConfigurator()
public abstract 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 abstract TraceUtil . Context getCurrentContext ()
Returns the current Context.
getCurrentSpan()
public abstract TraceUtil . Span getCurrentSpan ()
Returns the current span.
getTracer()
public abstract Tracer getTracer ()
Returns the current OpenTelemetry Tracer when OpenTelemetry SDK is provided.
Returns
Type
Description
io.opentelemetry.api.trace.Tracer
startSpan(String spanName)
public abstract TraceUtil . 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
startSpan(String spanName, TraceUtil.Span parentSpan)
public abstract 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.
Send feedback
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 2024-11-19 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-19 UTC."],[],[]]