Open
Description
openedon Aug 28, 2023
Describe the bug
Inactive APM Tracer produces invalid spans for OpenTelemetry Tracing bridge. The bug lives inside
go.elastic.co/apm/module/apmotel/v2@v2.4.3/tracer.go:105 in this code:
s.tx = t.provider.apmTracer.StartTransactionOptions(spanName, "", tranOpts)
It returns an APM transaction with invalid trace and span ids (all the zero bytes).
To Reproduce
Steps to reproduce the behavior:
- Use Elastic APM as a bridge to OpenTelemetry API as described here https://www.elastic.co/guide/en/apm/agent/go/current/opentelemetry.html I've taken an existent working ELK Apm instance and have created a tracing provider like it described in the docs.
- Try to create a new span with the tracer with the code (I've done so in a webserver middleware):
ctx, span := ot.tracer.Start(
handlerContext.GetContext(),
serverRequestName(handlerContext.GetHandler()),
)
defer span.End()
Expected behavior
I suppose that in any case span should have a correct state (or there should be something like Noop span with message details that tracer is not in active state right now).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment