Closed jballentine-sharpen closed 1 year ago
Hey 👋
Kysely will never provide opentelemetry support in its core. This is something that has to be published by opentelemetry, same as they did with Knex.
I'd be happy to collaborate with them.
FYI, I believe it's not required for opentelemetry to publish the instrumentation. Prisma developed their own here. However, it's not super compliant the the otel db spec. This is what brought me here, actually. Was wondering what otel support looked like.
DISCLAIMER: I am a Prisma employee at the time of writing this. These are just my opinions.
Prisma is:
With kysely
you can probably just instrument the underlying drivers (e.g. pg
, mysql2
, etc.) with existing OTEL implementations and call it a day. Isn't it enough or am I missing something?
With
kysely
you can probably just instrument the underlying drivers (e.g.pg
,mysql2
, etc.) with existing OTEL implementations and call it a day. Isn't it enough or am I missing something?
This might be the case. Unsure about the kysely internals. Good to know!
It seems something with OpenTelemetry's mysql2 instrumentation conflicts with Kysely. When I attempt to execute a query, I get an error of
TypeError: format is not a function
as well as some warnings ofWarning: Accessing non-existent property 'format' of module exports inside circular dependency
, with the error coming from@opentelemetry/instrumentation-mysql2/src/utils.ts:105:21
. and caused bykysely/dist/esm/dialect/mysql/mysql-driver.js:117:33
This issue does not happen with regular connections using the mysql2 package directly, or when using connections created via Knex. It seems something Kysely-specific is causing this conflict.
Any suggestions are welcome, but I'm assuming this is just a bug that nobody has encountered before.