@opentelemetry/instrumentation-express middlewares registered on routers do not record spans unless middlewares applied to router in a chain #1834
Labels
bug
Something isn't working
pkg:instrumentation-express
priority:p2
Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect
What version of OpenTelemetry are you using?
v.1.17.0
@opentelemetry/instrumentation-express
version is 0.33.1What version of Node are you using?
v16.18.1
What did you do?
I applied middlewares to
express.Router
via variadic arguments and array, and instrumentation only seems to record spans for the latter of registered middlewares.I will provide as much details as I possibly can in the "Additional context" section.
What did you expect to see?
span for
MiddlewareA
,...B
,...C
,...D
.What did you see instead?
span for
MiddlewareD
Additional context
Case # 1
Result:
Case # 2
Potential workaround
The result is behavior, expected to be with other ways of registering middleware too:
The text was updated successfully, but these errors were encountered: