Instruments a Knex instance to emit an OpenTelemetry CLIENT span
for every executed query.
Hooks knex's built-in query, query-response, and query-error
events — every dbset read, change-tracker write, save-graph, and raw
knex(...) call is captured uniformly because they all flow through
the same knex instance.
Spans automatically nest under any ambient OTel context, so DB spans
become children of the enclosing HTTP server span produced by
tracingMiddleware.
Returns the same instance for fluent chaining:
instrumentKnex(knex({...})).
Instruments a Knex instance to emit an OpenTelemetry
CLIENTspan for every executed query.Hooks knex's built-in
query,query-response, andquery-errorevents — every dbset read, change-tracker write, save-graph, and rawknex(...)call is captured uniformly because they all flow through the same knex instance.Spans automatically nest under any ambient OTel context, so DB spans become children of the enclosing HTTP server span produced by
tracingMiddleware.Returns the same instance for fluent chaining:
instrumentKnex(knex({...})).