Skip to content

Commit 604b4e6

Browse files
authored
fix(telemetry): upgrade Sentry SDK to 10.39.0 and remove custom patches (#249)
## Summary Upgrade `@sentry/bun` and `@sentry/node` from 10.38.0 → 10.39.0 and remove all custom patches/workarounds that are now fixed upstream. ## Changes - **Removed `patches/@sentry%2Fcore@10.38.0.patch`** (92 lines) — Added `.unref()` to timers in `setupWeightBasedFlushing`, `_isClientDoneProcessing`, and `makePromiseBuffer` to prevent the CLI from hanging on exit. Fixed upstream by [#19062](getsentry/sentry-javascript#19062) and [#19174](getsentry/sentry-javascript#19174). - **Removed runtime context workaround in `src/lib/telemetry.ts`** (14 lines) — Manually overrode `options.runtime` after `Sentry.init()` to report Bun instead of Node.js. Fixed upstream — `NodeClient` now uses `options.runtime || { name: 'node', ... }` and `@sentry/bun` passes `{ name: 'bun', version: Bun.version }`. Tracked as [#19269](getsentry/sentry-javascript#19269). - **Updated `package.json`** — Bumped both SDK packages to `10.39.0` and removed `@sentry/core` from `patchedDependencies`. ## Verification - Verified all three upstream fixes by reading the 10.39.0 source code and linked PRs - `bun install`, typecheck, lint, and tests all pass cleanly - No new test failures introduced (pre-existing ~95 failures on `main` are unrelated)
1 parent 805804e commit 604b4e6

File tree

4 files changed

+10
-118
lines changed

4 files changed

+10
-118
lines changed

bun.lock

Lines changed: 7 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
"devDependencies": {
2929
"@biomejs/biome": "2.3.8",
3030
"@sentry/api": "^0.1.0",
31-
"@sentry/bun": "10.38.0",
31+
"@sentry/bun": "10.39.0",
3232
"@sentry/esbuild-plugin": "^2.23.0",
33-
"@sentry/node": "10.38.0",
33+
"@sentry/node": "10.39.0",
3434
"@stricli/auto-complete": "^1.2.4",
3535
"@stricli/core": "^1.2.4",
3636
"@types/bun": "latest",
@@ -62,7 +62,6 @@
6262
},
6363
"packageManager": "bun@1.3.9",
6464
"patchedDependencies": {
65-
"@stricli/core@1.2.5": "patches/@stricli%2Fcore@1.2.5.patch",
66-
"@sentry/core@10.38.0": "patches/@sentry%2Fcore@10.38.0.patch"
65+
"@stricli/core@1.2.5": "patches/@stricli%2Fcore@1.2.5.patch"
6766
}
6867
}

patches/@sentry%2Fcore@10.38.0.patch

Lines changed: 0 additions & 91 deletions
This file was deleted.

src/lib/telemetry.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -214,21 +214,6 @@ export function initSentry(enabled: boolean): Sentry.BunClient | undefined {
214214
const isBun = typeof process.versions.bun !== "undefined";
215215
const runtime = isBun ? "bun" : "node";
216216

217-
// Fix runtime context: @sentry/bun v10 delegates to @sentry/node's NodeClient,
218-
// which always overrides runtime to { name: 'node', version: process.version }.
219-
// Under Bun, process.version returns the Node.js compat version (e.g. v24.3.0),
220-
// not the Bun version. Override it so event.contexts.runtime is correct and
221-
// Sentry's server-side tag promotion creates an accurate 'runtime' tag.
222-
// TODO: Remove once fixed upstream: https://github.com/getsentry/sentry-javascript/issues/19269
223-
if (isBun) {
224-
// biome-ignore lint/suspicious/noExplicitAny: accessing internal SDK option not exposed in NodeClientOptions
225-
const options = client.getOptions() as any;
226-
options.runtime = {
227-
name: "bun",
228-
version: process.versions.bun as string,
229-
};
230-
}
231-
232217
// Tag whether running as bun binary or node (npm package).
233218
// Kept alongside the SDK's promoted 'runtime' tag for explicit signaling
234219
// and backward compatibility with existing dashboards/alerts.

0 commit comments

Comments
 (0)