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

OpenTelemetry instrumentation #442

Open
aldy505 opened this issue Sep 15, 2024 · 0 comments
Open

OpenTelemetry instrumentation #442

aldy505 opened this issue Sep 15, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@aldy505
Copy link
Member

aldy505 commented Sep 15, 2024

Most popular Node.js HTTP server libraries has some kind of OpenTelemetry support (Express, Fastify, Koa, Hapi, Connect, even Restify has it). I'm wondering how much people are needing OpenTelemetry instrumentation capability for Tinyhttp. Please raise a thumbs up 👍 on the issue if you'd like to see it happen.

If people are keen for this, there are two options moving forward:

  1. Provide @tinyhttp/opentelemetry package, which will patch the Tinyhttp library. Very similar to what all the links above did. Personally, I dislike this approach since we're adding maintenance burden if Tinyhttp hits another major version update.
  2. Include the tracer.startSpan() stuff inside the @tinyhttp/app package. This will add additional dependency of @opentelemetry/api in which we can make it as a peerDependency, very similar to what Drizzle did here: https://github.com/drizzle-team/drizzle-orm/blob/c8359a16fff4b05aff09445edd63fc65a7430ce9/drizzle-orm/src/node-postgres/session.ts#L48-L80 (the tracer function is implemented here: https://github.com/drizzle-team/drizzle-orm/blob/c8359a16fff4b05aff09445edd63fc65a7430ce9/drizzle-orm/src/tracing.ts#L25)

Feel free to give out your opinions on this. Personally, for performance reasons, I prefer the second approach. The first approach is popular, but it causes a slowdown on application initialization.

@aldy505 aldy505 added the enhancement New feature or request label Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant