Search in sources :

Example 1 with PlatformHttpSpanDecorator

use of org.apache.camel.tracing.decorators.PlatformHttpSpanDecorator in project camel-quarkus by apache.

the class CamelQuarkusOpenTelemetryTracer method startExchangeBeginSpan.

@Override
protected SpanAdapter startExchangeBeginSpan(Exchange exchange, SpanDecorator sd, String operationName, SpanKind kind, SpanAdapter parent) {
    // augment the existing incoming one with additional camel specific tags & attributes
    if (sd instanceof PlatformHttpSpanDecorator || sd instanceof ServletSpanDecorator) {
        Span span = Span.fromContext(Context.current());
        Baggage baggage = Baggage.fromContext(Context.current());
        return new OpenTelemetrySpanAdapter(span, baggage);
    }
    return super.startExchangeBeginSpan(exchange, sd, operationName, kind, parent);
}
Also used : PlatformHttpSpanDecorator(org.apache.camel.tracing.decorators.PlatformHttpSpanDecorator) Span(io.opentelemetry.api.trace.Span) Baggage(io.opentelemetry.api.baggage.Baggage) ServletSpanDecorator(org.apache.camel.tracing.decorators.ServletSpanDecorator)

Aggregations

Baggage (io.opentelemetry.api.baggage.Baggage)1 Span (io.opentelemetry.api.trace.Span)1 PlatformHttpSpanDecorator (org.apache.camel.tracing.decorators.PlatformHttpSpanDecorator)1 ServletSpanDecorator (org.apache.camel.tracing.decorators.ServletSpanDecorator)1