Skip to content

fix(bun) Export pinoIntegration from @sentry/node#17990

Merged
andreiborza merged 3 commits intogetsentry:developfrom
LudvigHz:pinointegration-bun
Feb 18, 2026
Merged

fix(bun) Export pinoIntegration from @sentry/node#17990
andreiborza merged 3 commits intogetsentry:developfrom
LudvigHz:pinointegration-bun

Conversation

@LudvigHz
Copy link
Contributor

@LudvigHz LudvigHz commented Oct 21, 2025

Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

Resolves #17989

@chargome chargome requested a review from timfish October 22, 2025 07:40
@chargome
Copy link
Member

@timfish not sure if the pino integration works properly on bun due to TracingChannel – anyway we need to either merge this or update the docs for it.

@timfish
Copy link
Collaborator

timfish commented Oct 22, 2025

I think Bun supports TracingChannel so it could work with the latest versions of Pino that include a TracingChannel.

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?

@s1gr1d
Copy link
Member

s1gr1d commented Oct 22, 2025

Bun supports the tracing channel, but they do not publish to the channels we use for the instrumentation.

More about that here: #17779 (comment)

@s1gr1d
Copy link
Member

s1gr1d commented Nov 13, 2025

Follow-up on the above comment: Bun has a PR for supporting the channels oven-sh/bun#24375

@github-actions
Copy link
Contributor

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 PR: no-auto-close I will leave it alone ... forever!

@timfish
Copy link
Collaborator

timfish commented Feb 17, 2026

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!)

@timfish timfish removed the PR: stale label Feb 17, 2026
@andreiborza andreiborza enabled auto-merge (squash) February 18, 2026 18:42
consoleLoggingIntegration,
createConsolaReporter,
createSentryWinstonTransport,
pinoIntegration,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

@andreiborza andreiborza merged commit 4d4a02f into getsentry:develop Feb 18, 2026
37 checks passed
andreiborza added a commit that referenced this pull request Feb 18, 2026
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>
@LudvigHz LudvigHz deleted the pinointegration-bun branch February 19, 2026 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pino integration not exported from @sentry/bun

5 participants

Comments