porsager / postgres

Postgres.js - The Fastest full featured PostgreSQL client for Node.js, Deno, Bun and CloudFlare
The Unlicense
7.09k stars 259 forks source link

Instrumentation with new relic #739

Open eduardvercaemer opened 8 months ago

eduardvercaemer commented 8 months ago

I'm trying to instrument the library for monitoring with New Relic.

I'm trying to follow this guide: https://newrelic.github.io/node-newrelic/tutorial-Datastore-Simple.html

The issue is I don't think the library provides any base prototypes I can use the shims on. I looked at the source code and failed to come up with a way of hooking onto the query methods since the Query class is not exposed and the Sql objects also don't have a base class?

Any tips or work arounds?