Express not instrumented when using own HTTP server
luismiramirez opened this issue · 2 comments
The Express instrumentation does not work if the app server is initialized using the http/https Node.js modules as in:
var express = require('express');
var http = require('http');
var app = express();
var server = http.createServer(app);
server.listen(1234);
When starting the app like this, the request root span is an HTTP one with a generic name that misses all the info set up by the Express instrumentation.
To do
- Timebox 1 day - research if it's not an issue on our end, if not;
- Report the issue on OpenTelemetry upstream
Can't reproduce. In my local tests, running an Express application with the Node.js HTTP server using http.createServer(app)
results in both Express and HTTP spans appearing, and the instrumentation behaves as expected.
I have found this closed issue describing a similar problem in the OpenTelemetry repo. The solution to their issue was to use --external
in their esbuild
build, which was also an issue with the affected user's setup (see Intercom conversation)
As such, I believe this issue is fixed by @luismiramirez's esbuild documentation PR.
Closing.