You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This only affects the JavaScript OpenTelemetry library
As explained in the docs there is experimental support for projects that use ES Modules as well as a sample app with a http server. This all works great until Node 18.
Using express instead of http doesn't work though. I found a WIP to make express work (stale PR) but it doesn't seem to be completed:
It moans about the module loading order, even though in the sample app @opentelemetry/instrumentation-express is clearly loaded before express.
❯ yarn start-express
yarn run v1.22.21
$ node --experimental-loader=@opentelemetry/instrumentation/hook.mjs ./build/express.js
(node:48798) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
@opentelemetry/api: Registered a global for diag v1.7.0.
@opentelemetry/api: Registered a global for trace v1.7.0.
@opentelemetry/api: Registered a global for context v1.7.0.
@opentelemetry/api: Registered a global for propagation v1.7.0.
@opentelemetry/instrumentation-express Module express has been loaded before @opentelemetry/instrumentation-express so it might not work, please initialize it before requiring express
Applying patch for [email protected]
hello!
No modules instrumentation has been defined for '[email protected]', nothing will be patched
Now listening on: http://0.0.0.0:3000/
Are there plans in place to support express using esm?
🎉 I found a working solution here! My project is using esm and I switched my runtime from node to jiti and NOW EVERYTHING JUST WORKS!!!!!! even works on node20
If we are living in a simulation then this is a complete cheat code 🥷🏼
As explained in the docs there is experimental support for projects that use ES Modules as well as a sample app with a
http
server. This all works great until Node 18.Using
express
instead ofhttp
doesn't work though. I found a WIP to make express work (stale PR) but it doesn't seem to be completed:It moans about the module loading order, even though in the sample app
@opentelemetry/instrumentation-express
is clearly loaded beforeexpress
.Are there plans in place to support express using esm?
Likely related:
The text was updated successfully, but these errors were encountered: