Fastify instrumentation incorrectly sets middleware span as parent span to route handler with sync hooks #2619
Labels
bug
Something isn't working
pkg:instrumentation-fastify
pkg-status:unmaintained
This package is unmaintained. Only bugfixes may be acceped until a new owner has been found.
priority:p2
Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect
What version of OpenTelemetry are you using?
What version of Node are you using?
20.18
What did you do?
Repo to reproduce with steps in the README: https://github.com/drewcorlin1/fastify-otel-bug-example
What did you expect to see?
The route handler as a child span of the
GET /example
from@opentelemetry/instrumentation-http
(and thus, jaeger correctly identifying the critical path of the request)What did you see instead?
The route handler has a child span of the first middleware span
middleware - fastify -> @fastify/request-context
from@opentelemetry/instrumentation-fastify
(and thus jaeger incorrectly identifying the critical path of my trace)Additional context
Screenshot of what I'm seeing and full JSON of the trace downloaded from jaeger attached
fastify-trace.json
The text was updated successfully, but these errors were encountered: