-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
@sentry/bun not reporting any span data #12705
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
Comments
Hi, thank you for reporting this. Could you please add |
Thanks @andreiborza ! Here it is:
|
Weird that it says |
@nzapponi The logic for that log message basically just checks whether Could you provide a reproduction of where this is not working? Thanks! It's a bit hard to gauge things from looking afar. |
Here is a sample repo to reproduce: https://github.com/nzapponi/bun-sentry-repro Thanks! |
Thank you @nzapponi, we'll look into it! |
@nzapponi it seems that there are issues regarding the auto-instrumentation with express and bun.
For now, although you do not receive auto-generated span data you can still make use of custom instrumentation and error monitoring for your app with your current setup. We'll reference this issue once we have a fix. |
Ok thanks |
Solved by replacing |
Hmm strange, we basically do the same thing within export function setupExpressErrorHandler(
app: { use: (middleware: ExpressMiddleware | ExpressErrorMiddleware) => unknown },
options?: ExpressHandlerOptions,
): void {
app.use(expressRequestHandler());
app.use(expressErrorHandler(options));
ensureIsWrapped(app.use, 'express');
} Thanks for sharing your findings @nzapponi ! |
Weird! Given that, it feels like I should also add the And shouldn't that be called before any routes and not after (like it is with your current implementation)? The way you implemented looks odd because any successful request will never hit the request handler. Finally, I guess I may be wrong and it's not working any differently - the reason why I'm not seeing the warning anymore is likely because I'll do more digging and report back. |
This just checks if express is properly wrapped and emits a warning if not.
Yes I would say so. Yes I think this is likely a timing/esm problem, but there are still issues with bun and preloading the instrumentation: oven-sh/bun#13165 |
Sorry, I just updated my comment above. |
Alright, so here's how I fixed it actually - I went back to using To get Express to work with Bun, I had to manually enable the Express integration during Sentry.init:
I can now see the full Express data! |
Huh, that is a good point - we actually do not add any node performance integrations by default in bun. I wonder if we should do that 🤔 |
A PR closing this issue has just been released 🚀This issue was referenced by PR #15586, which was included in the 9.5.0 release. |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/bun
SDK Version
8.13.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup/Reproduction Example
Entrypoint line 1:
sentry.ts
Steps to Reproduce
curl
) to the serverExpected Result
A trace of the API call from request to response, including all the middleware calls, database queries (I'm using
pg
), etc.Actual Result
I get a trace, but every transaction just says "Empty - Transaction did not report any span data"
This also happens on server-side events that I instrumented using
await Sentry.startSpan(...)
: I get a trace that the span is there, but no data within it.The text was updated successfully, but these errors were encountered: