Open nzapponi opened 2 days ago
Hi, thank you for reporting this. Could you please add debug: true
to your sentry options and paste some output?
Thanks @andreiborza !
Here it is:
$ bun run --hot src/server.ts
Sentry Logger [log]: Initializing Sentry: process: 72557, thread: main.
Sentry Logger [log]: Integration installed: InboundFilters
Sentry Logger [log]: Integration installed: FunctionToString
Sentry Logger [log]: Integration installed: LinkedErrors
Sentry Logger [log]: Integration installed: RequestData
Sentry Logger [log]: Integration installed: Console
Sentry Logger [log]: Integration installed: Http
Sentry Logger [log]: Integration installed: NodeFetch
Sentry Logger [log]: Integration installed: OnUncaughtException
Sentry Logger [log]: Integration installed: OnUnhandledRejection
Sentry Logger [log]: Integration installed: ContextLines
Sentry Logger [log]: Integration installed: Context
Sentry Logger [log]: Integration installed: Modules
Sentry Logger [log]: Integration installed: BunServer
Sentry Logger [log]: Running in CommonJS mode.
Sentry Logger [debug]: @opentelemetry/api: Registered a global for diag v1.9.0.
Sentry Logger [debug]: @opentelemetry/api: Registered a global for trace v1.9.0.
Sentry Logger [debug]: @opentelemetry/api: Registered a global for context v1.9.0.
Sentry Logger [debug]: @opentelemetry/api: Registered a global for propagation v1.9.0.
Sentry Logger [warn]: @opentelemetry/instrumentation-socket.io Module socket.io has been loaded before @opentelemetry/instrumentation-socket.io so it might not work, please initialize it before requiring socket.io
Sentry Logger [warn]: @opentelemetry/instrumentation-socket.io Module socket.io has been loaded before @opentelemetry/instrumentation-socket.io so it might not work, please initialize it before requiring socket.io
server:app Registered data model +0ms
[Sentry] express is not instrumented. This is likely because you required/imported express before calling `Sentry.init()`.
server:app Bootstrapping services +0ms
server:pg Initializing database +0ms
server:pg Running migrations +0ms
server:app Listening on port 28001... +0ms
Weird that it says Running in CommonJS mode
... isn't it?
@nzapponi The logic for that log message basically just checks whether require
is in the global namespace. This is a bit weird in bun, because it maximizes compatibility.
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 I keep getting no span data.
Thanks!
Thank you @nzapponi, we'll look into it!
@nzapponi it seems that there are issues regarding the auto-instrumentation with express and bun.
I keep getting no span data.
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
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.