Search in sources :

Example 1 with SpanKey

use of io.opentelemetry.instrumentation.api.internal.SpanKey in project opentelemetry-java-instrumentation by open-telemetry.

the class AgentSpanTestingInstrumenter method startSpanWithAllKeys.

public static Context startSpanWithAllKeys(String name) {
    Context context = start(name, SpanKind.INTERNAL);
    Span span = Span.fromContext(context);
    for (SpanKey spanKey : getSpanKeys()) {
        context = spanKey.storeInContext(context, span);
    }
    return context;
}
Also used : Context(io.opentelemetry.context.Context) SpanKey(io.opentelemetry.instrumentation.api.internal.SpanKey) Span(io.opentelemetry.api.trace.Span)

Aggregations

Span (io.opentelemetry.api.trace.Span)1 Context (io.opentelemetry.context.Context)1 SpanKey (io.opentelemetry.instrumentation.api.internal.SpanKey)1