knex
knex copied to clipboard
Add diagnostics_channel hooks
Consider using https://github.com/simon-id/diagnostics_channel-polyfill#readme polyfill for older Node versions.
I like this idea. diagnostics_channel hooks will allow observbility without intrusive APIs. We can add diagnostics_channel publish calls around key event.
Good insertion points (maybe):
- Query lifecycle in
lib/client.js:query()and_stream(); emit before/after with context (sql,bindings,timing,error). - Pool events (acquire/release) via
tarn.jshooks inlib/client.jsinitializePool.
One note: 4 years on, I don't think we still need the polyfill...!