Search in sources :

Example 1 with AttributeKey

use of io.opentelemetry.api.common.AttributeKey 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 AttributeKey

use of io.opentelemetry.api.common.AttributeKey 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 AttributeKey

use of io.opentelemetry.api.common.AttributeKey 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 AttributeKey

use of io.opentelemetry.api.common.AttributeKey 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 AttributeKey

use of io.opentelemetry.api.common.AttributeKey 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

AttributeKey (io.opentelemetry.api.common.AttributeKey)5 SpanBuilder (io.opentelemetry.api.trace.SpanBuilder)5 IpcClientSpanBuilder (org.apache.hadoop.hbase.client.trace.IpcClientSpanBuilder)1