fix(bun) Export pinoIntegration from @sentry/node#17990
fix(bun) Export pinoIntegration from @sentry/node#17990andreiborza merged 3 commits intogetsentry:developfrom
Conversation
|
@timfish not sure if the pino integration works properly on bun due to |
|
I think Bun supports What won't work is the code injection via ESM loader hook because Bun doesn't support them. If loader hook registration is simply a no-op in Bun, it might just work with the latest versions of Pino without causing runtime errors? @LudvigHz have you tested this working with Bun? |
|
Bun supports the tracing channel, but they do not publish to the channels we use for the instrumentation. More about that here: #17779 (comment) |
|
Follow-up on the above comment: Bun has a PR for supporting the channels oven-sh/bun#24375 |
|
This pull request has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you apply the label |
|
I think this can probably be merged! The Pino integration will work with Bun for any Pino version that publishes tracing channel events (I forget the exact version!) |
| consoleLoggingIntegration, | ||
| createConsolaReporter, | ||
| createSentryWinstonTransport, | ||
| pinoIntegration, |
There was a problem hiding this comment.
Bug: The PR exports pinoIntegration for Bun, but a test file marks it as unsupported. This will cause CI failure and likely runtime errors due to missing runtime APIs.
Severity: HIGH
Suggested Fix
Either remove the pinoIntegration export from packages/bun/src/index.ts if it is indeed unsupported by Bun, or, if it is now supported, remove pinoIntegration from the ignoreExports array in dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts and provide evidence that the underlying diagnosticsChannel API works correctly in Bun.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: packages/bun/src/index.ts#L169
Potential issue: The pull request adds `pinoIntegration` to the `@sentry/bun` package
exports. However, the test file `consistentExports.ts` still lists `pinoIntegration` in
its `ignoreExports` array with a comment stating it is "not supported in bun". This will
cause the `consistentExports` CI test to fail. More critically, the `pinoIntegration`
relies on the Node.js `diagnosticsChannel` API, which is likely unsupported in the Bun
runtime. Exporting this integration without verifying its compatibility will lead to a
broken feature that causes runtime errors for any user who attempts to use it.
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| consoleLoggingIntegration, | ||
| createConsolaReporter, | ||
| createSentryWinstonTransport, | ||
| pinoIntegration, |
There was a problem hiding this comment.
Stale ignoreExports entry undermines test coverage for new export
Medium Severity
pinoIntegration is now exported from @sentry/bun, but consistentExports.ts still lists it in ignoreExports with the comment "not supported in bun." This means the consistency check skips verifying this export exists, so if someone accidentally removes it later, no test will catch the regression. The ignoreExports entry needs to be removed to get proper test coverage. Additionally, this is a fix PR with no test that actually validates the fix — updating consistentExports.ts would serve as that regression test.
Triggered by project rule: PR Review Guidelines for Cursor Bot
This PR adds the external contributor to the CHANGELOG.md file, so that they are credited for their contribution. See #17990 Co-authored-by: andreiborza <168741329+andreiborza@users.noreply.github.com>


Before submitting a pull request, please take a look at our
Contributing guidelines and verify:
yarn lint) & (yarn test).Resolves #17989