Search in sources :

Example 1 with SpanBuilder

use of io.opentelemetry.api.trace.SpanBuilder in project hbase by apache.

the class IpcClientSpanBuilder method build.

@SuppressWarnings("unchecked")
public Span build() {
    final SpanBuilder builder = TraceUtil.getGlobalTracer().spanBuilder(name).setSpanKind(SpanKind.CLIENT);
    attributes.forEach((k, v) -> builder.setAttribute((AttributeKey<? super Object>) k, v));
    return builder.startSpan();
}
Also used : AttributeKey(io.opentelemetry.api.common.AttributeKey) SpanBuilder(io.opentelemetry.api.trace.SpanBuilder)

Example 2 with SpanBuilder

use of io.opentelemetry.api.trace.SpanBuilder in project hbase by apache.

the class TableSpanBuilder method build.

@SuppressWarnings("unchecked")
public Span build() {
    final SpanBuilder builder = TraceUtil.getGlobalTracer().spanBuilder(name).setSpanKind(SpanKind.CLIENT);
    attributes.forEach((k, v) -> builder.setAttribute((AttributeKey<? super Object>) k, v));
    return builder.startSpan();
}
Also used : AttributeKey(io.opentelemetry.api.common.AttributeKey) SpanBuilder(io.opentelemetry.api.trace.SpanBuilder)

Example 3 with SpanBuilder

use of io.opentelemetry.api.trace.SpanBuilder in project hbase by apache.

the class ConnectionSpanBuilder method build.

@SuppressWarnings("unchecked")
public Span build() {
    final SpanBuilder builder = TraceUtil.getGlobalTracer().spanBuilder(name).setSpanKind(SpanKind.CLIENT);
    attributes.forEach((k, v) -> builder.setAttribute((AttributeKey<? super Object>) k, v));
    return builder.startSpan();
}
Also used : AttributeKey(io.opentelemetry.api.common.AttributeKey) SpanBuilder(io.opentelemetry.api.trace.SpanBuilder)

Example 4 with SpanBuilder

use of io.opentelemetry.api.trace.SpanBuilder in project hbase by apache.

the class TableOperationSpanBuilder method build.

@SuppressWarnings("unchecked")
public Span build() {
    final String name = attributes.getOrDefault(DB_OPERATION, unknown) + " " + (tableName != null ? tableName.getNameWithNamespaceInclAsString() : unknown);
    final SpanBuilder builder = TraceUtil.getGlobalTracer().spanBuilder(name).setSpanKind(SpanKind.CLIENT);
    attributes.forEach((k, v) -> builder.setAttribute((AttributeKey<? super Object>) k, v));
    return builder.startSpan();
}
Also used : AttributeKey(io.opentelemetry.api.common.AttributeKey) SpanBuilder(io.opentelemetry.api.trace.SpanBuilder)

Example 5 with SpanBuilder

use of io.opentelemetry.api.trace.SpanBuilder in project hbase by apache.

the class IpcServerSpanBuilder method build.

@SuppressWarnings("unchecked")
public Span build() {
    final SpanBuilder builder = TraceUtil.getGlobalTracer().spanBuilder(name).setSpanKind(SpanKind.SERVER);
    attributes.forEach((k, v) -> builder.setAttribute((AttributeKey<? super Object>) k, v));
    return builder.setParent(Context.current().with(((ServerCall<?>) rpcCall).getSpan())).startSpan();
}
Also used : AttributeKey(io.opentelemetry.api.common.AttributeKey) IpcClientSpanBuilder(org.apache.hadoop.hbase.client.trace.IpcClientSpanBuilder) SpanBuilder(io.opentelemetry.api.trace.SpanBuilder)

Aggregations

SpanBuilder (io.opentelemetry.api.trace.SpanBuilder)7 AttributeKey (io.opentelemetry.api.common.AttributeKey)5 Span (io.opentelemetry.api.trace.Span)1 TextMapGetter (io.opentelemetry.context.propagation.TextMapGetter)1 URI (java.net.URI)1 ContainerRequestContext (javax.ws.rs.container.ContainerRequestContext)1 UriInfo (javax.ws.rs.core.UriInfo)1 IpcClientSpanBuilder (org.apache.hadoop.hbase.client.trace.IpcClientSpanBuilder)1