knex icon indicating copy to clipboard operation
knex copied to clipboard

Add diagnostics_channel hooks

Open kibertoad opened this issue 4 years ago • 1 comments

Consider using https://github.com/simon-id/diagnostics_channel-polyfill#readme polyfill for older Node versions.

kibertoad avatar Aug 26 '21 20:08 kibertoad

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.js hooks in lib/client.js initializePool.

One note: 4 years on, I don't think we still need the polyfill...!

mercmobily avatar Oct 28 '25 01:10 mercmobily