elastic / elastic-otel-java

Apache License 2.0
14 stars 12 forks source link

Check the behaviour of inferred spans with remote span activation #250

Closed JonasKunz closed 3 months ago

JonasKunz commented 4 months ago

OpenTelemetry has the concept of remote spans: When an incoming W3C-tracecontext is encountered, it is parsed and put as a PropagatedSpan (via Span.fromRemoteContext) into the current OpenTelemetry context.

This means, PropagatedSpans can be activated and deactivated just like normal spans. Because we didn't have an equivalent concept in our elastic-apm-agent, I didn't account for this case when porting the implementation over. This means that we potentially might end up creating inferred spans with a remote-span as parent, which definitely don't want.

We should add a test case for this and fix the behaviour if required.