honojs / middleware

monorepo for Hono third-party middleware/helpers/wrappers
https://hono.dev
451 stars 164 forks source link

Support for @sentry/serverless as new middleware package or inclusion in current package? #651

Open JQuezada0 opened 3 months ago

JQuezada0 commented 3 months ago

Hello, I was wondering if there'd be support for either adding hono middleware for the @sentry/serverless package, or updating the current one to support choosing which client to use at initialization?

The current one is built off of toucan-js which seems to be geared very much towards cloudflare workers, and so doesn't include some functionality that'd be available in AWS Lambda for ex that isn't available in cloudflare workers.

Specifically, tracing and profiling (minimally starting new spans) doesn't seem to be accessible via the toucan client.

As of the upgrade to Sentry's v8 apis, this issue in toucan-js I think is out of date. The api doesn't allow getting access to a transaction object, nor a sentry client that provides the startSpan method.

I've tried "hacking" my way there using the previous version and what's suggested in that issue thread, but it's a bit of trial and error, so I'm thinking it may be best to just roll a new middleware that's based on the sentry serverless package.

FraBle commented 1 month ago

There is also @sentry/cloudflare now. I wonder whether this might be a replacement for the toucan-based implementation.