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 package provides async-hooks based context manager which is used internally by OpenTelemetry plugins to propagate specific context between function calls and async operations. It only targets NodeJS since async-hooks is only available there.
OpenTelemetry relies on node.js async hooks context in async calls. More details here:
Unfortunately, this doesn't work with "thenables" which is knex.js uses (see open-telemetry/opentelemetry-js#940, knex/knex#3550) for node versions <14.5.0 (see nodejs/node#22360).
Thankfully, there is an existing plugin that solves this has solved this context issue for knex, which sqlcommenter-knex can base a solution on: https://github.com/myrotvorets/opentelemetry-plugin-knex/blob/bd5f2d918eeaa86c257f5e433772ec57b4834582/lib/knex.ts#L115
I have verified that this is working in newer node versions without any code changes.