serverless
serverless copied to clipboard
OTEL tracing in driver
Support for OpenTelemetry in the serverless driver for transactions/individual queries would be useful to allow for full tracing from request to response of all queries my application is performing
I believe you could solve this with a custom fetchFunction, you'd just need to set it up like so:
import { neonConfig, neon } from `@neondatabase/serverless`
neonConfig.fetchFunction = async (url, init) => {
// pull attrs of the the init object (like from the headers)
const attrs = {};
return currentTracer.startActiveSpan(`neon-query`, attrs, async () => fetch(url, init));
};
Has PR #102