-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
Description
Description
Today, we use import-in-the-middle and require-in-the-middle based instrumentation for Node libraries in our Node SDK, e.g. for express, mysql, etc.
This has some downsides:
- For ESM, to have
import-in-the-middlework reliably it should be configured via--importin the Node CLI import-in-the-middleis flawed in a couple of ways that means it can't be used to wrap all libraries- Neither
import-in-the-middleorrequire-in-the-middlework with bundled code (as it instrumentsimport/require, basically)
To "fix" this, we want to migrate to using diagnostics_channel for the packages we instrument. With this, both of these downsides disappear.
In order to achieve this, we need to actually PR the libraries themselves (e.g. express, mysql, ...) and make them emit diagnostics_channel (or a tracing channel). Then, the OTEL instrumentation can be updated to use this instead of using import-in-the-middle.
This will be a gradual approach, we can update libraries as we go, starting with more important ones.
### Libraries to update
- [ ] http
- [ ] express
- [ ] fastify
- [ ] graphql
- [ ] mongo
- [ ] mongoose
- [ ] mysql
- [ ] mysql2
- [ ] redis
- [ ] postgres
- [ ] hapi
- [ ] koa
- [ ] connect
- [ ] tedious
- [ ] genericPool
- [ ] kafka
- [ ] amqlib
- [ ] lruMemoizer
- [ ] vercelAIIntergation (?)
chalkygames123