-
-
Notifications
You must be signed in to change notification settings - Fork 132
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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:
- Provide
@tinyhttp/opentelemetrypackage, 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. - Include the
tracer.startSpan()stuff inside the@tinyhttp/apppackage. This will add additional dependency of@opentelemetry/apiin which we can make it as apeerDependency, 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 (thetracerfunction 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request