-
Notifications
You must be signed in to change notification settings - Fork 621
Closed
Labels
bugSomething isn't workingSomething isn't workingpkg:instrumentation-expresspriority:p2Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrectBugs and spec inconsistencies which cause telemetry to be incomplete or incorrect
Description
What version of OpenTelemetry are you using?
├── @opentelemetry/[email protected]
└─┬ @opentelemetry/[email protected]
├── @opentelemetry/[email protected] deduped
└── @opentelemetry/[email protected]
What version of Node are you using?
v18.19.1
What did you do?
Run the included express sample https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/examples/express
What did you expect to see?
Async work should be accounted for in the handler duration.
What did you see instead?
The handler span has very short duration, only accounting for synchronous work. This is already a known caveat documented here but I couldn't find a tracking bug.
This screenshot demonstrates the problems

Additional context
A common pattern for express is to use an async function as the handler, as demonstrated in the sample
| app.get('/run_test', async (req, res) => { |
For handlers that return a promise, it should be possible to chain a span.end() call to the promise. However this also seems related to #2022
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpkg:instrumentation-expresspriority:p2Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrectBugs and spec inconsistencies which cause telemetry to be incomplete or incorrect