Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OTEL tracing in driver #100

Open
IAmJSD opened this issue Sep 9, 2024 · 1 comment
Open

OTEL tracing in driver #100

IAmJSD opened this issue Sep 9, 2024 · 1 comment

Comments

@IAmJSD
Copy link

IAmJSD commented Sep 9, 2024

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

@nicksrandall
Copy link
Contributor

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));
}; 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants