@InterfaceAudience.Private public final class TraceUtil extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
TraceUtil.IOExceptionCallable<V> |
Modifier and Type | Field and Description |
---|---|
static io.opentelemetry.api.common.AttributeKey<String> |
NAMESPACE_KEY |
static io.opentelemetry.api.common.AttributeKey<List<String>> |
REGION_NAMES_KEY |
static io.opentelemetry.api.common.AttributeKey<String> |
REMOTE_HOST_KEY |
static io.opentelemetry.api.common.AttributeKey<Long> |
REMOTE_PORT_KEY |
static io.opentelemetry.api.common.AttributeKey<Boolean> |
ROW_LOCK_READ_LOCK_KEY |
static io.opentelemetry.api.common.AttributeKey<String> |
RPC_METHOD_KEY |
static io.opentelemetry.api.common.AttributeKey<String> |
RPC_SERVICE_KEY |
static io.opentelemetry.api.common.AttributeKey<String> |
SERVER_NAME_KEY |
static io.opentelemetry.api.common.AttributeKey<String> |
TABLE_KEY |
static io.opentelemetry.api.common.AttributeKey<String> |
WAL_IMPL |
Modifier and Type | Method and Description |
---|---|
static io.opentelemetry.api.trace.Span |
createClientSpan(String name)
Create a span with
SpanKind.CLIENT . |
static io.opentelemetry.api.trace.Span |
createRemoteSpan(String name,
io.opentelemetry.context.Context ctx)
Create a span which parent is from remote, i.e, passed through rpc.
|
static io.opentelemetry.api.trace.Span |
createSpan(String name)
Create a
SpanKind.INTERNAL span. |
static io.opentelemetry.api.trace.Span |
createTableSpan(String spanName,
TableName tableName)
Create a
SpanKind.INTERNAL span and set table related attributes. |
static io.opentelemetry.api.trace.Tracer |
getGlobalTracer() |
static void |
setError(io.opentelemetry.api.trace.Span span,
Throwable error) |
static void |
trace(Runnable action,
String spanName) |
static void |
trace(Runnable action,
Supplier<io.opentelemetry.api.trace.Span> creator) |
static <T> T |
trace(Supplier<T> action,
String spanName) |
static <T> T |
trace(TraceUtil.IOExceptionCallable<T> callable,
String spanName) |
static <T> T |
trace(TraceUtil.IOExceptionCallable<T> callable,
Supplier<io.opentelemetry.api.trace.Span> creator) |
static <T> CompletableFuture<T> |
tracedFuture(Supplier<CompletableFuture<T>> action,
String spanName)
Trace an asynchronous operation.
|
static <T> CompletableFuture<T> |
tracedFuture(Supplier<CompletableFuture<T>> action,
String spanName,
TableName tableName)
Trace an asynchronous operation for a table.
|
static <T> List<CompletableFuture<T>> |
tracedFutures(Supplier<List<CompletableFuture<T>>> action,
String spanName,
TableName tableName)
Trace an asynchronous operation, and finish the create
Span when all the given
futures are completed. |
public static final io.opentelemetry.api.common.AttributeKey<String> NAMESPACE_KEY
public static final io.opentelemetry.api.common.AttributeKey<String> TABLE_KEY
public static final io.opentelemetry.api.common.AttributeKey<List<String>> REGION_NAMES_KEY
public static final io.opentelemetry.api.common.AttributeKey<String> RPC_SERVICE_KEY
public static final io.opentelemetry.api.common.AttributeKey<String> RPC_METHOD_KEY
public static final io.opentelemetry.api.common.AttributeKey<String> SERVER_NAME_KEY
public static final io.opentelemetry.api.common.AttributeKey<String> REMOTE_HOST_KEY
public static final io.opentelemetry.api.common.AttributeKey<Long> REMOTE_PORT_KEY
public static final io.opentelemetry.api.common.AttributeKey<Boolean> ROW_LOCK_READ_LOCK_KEY
public static final io.opentelemetry.api.common.AttributeKey<String> WAL_IMPL
public static io.opentelemetry.api.trace.Tracer getGlobalTracer()
public static io.opentelemetry.api.trace.Span createSpan(String name)
SpanKind.INTERNAL
span.public static io.opentelemetry.api.trace.Span createTableSpan(String spanName, TableName tableName)
SpanKind.INTERNAL
span and set table related attributes.public static io.opentelemetry.api.trace.Span createRemoteSpan(String name, io.opentelemetry.context.Context ctx)
SpanKind.SERVER
, as this should be the top
most span at server side.public static io.opentelemetry.api.trace.Span createClientSpan(String name)
SpanKind.CLIENT
.public static <T> CompletableFuture<T> tracedFuture(Supplier<CompletableFuture<T>> action, String spanName, TableName tableName)
public static <T> CompletableFuture<T> tracedFuture(Supplier<CompletableFuture<T>> action, String spanName)
public static <T> List<CompletableFuture<T>> tracedFutures(Supplier<List<CompletableFuture<T>>> action, String spanName, TableName tableName)
Span
when all the given
futures
are completed.public static void setError(io.opentelemetry.api.trace.Span span, Throwable error)
public static <T> T trace(TraceUtil.IOExceptionCallable<T> callable, String spanName) throws IOException
IOException
public static <T> T trace(TraceUtil.IOExceptionCallable<T> callable, Supplier<io.opentelemetry.api.trace.Span> creator) throws IOException
IOException
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.