getsentry / getsentry/sentry-javascript

Elysia events report as `sentry.javascript.bun`

未关闭 适合新手
#24,045 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Bug Bun javascript
主要语言
TypeScript
星标
8.7k
派生
1.8k
平均合并
1 天 17 小时
30 天内合并 PR
523

描述

Running under both node and bun, with the built `@sentry/elysia`:

```
sdk: {"name":"sentry.javascript.bun","version":"10.67.0",
"packages":[{"name":"npm:@sentry/bun","version":"10.67.0"}]}
```

`sentry.javascript.elysia` never appears. `packages/elysia/src/sdk.ts:44` copies `userOptions` into `options` *before* calling `applySdkMetadata(userOptions, 'elysia', ...)`. When `userOptions._metadata` is undefined, `applySdkMetadata` creates a fresh `_metadata` on `userOptions`, which the already-made copy does not have. `initBun(options)` then applies its own `'bun'` metadata to the copy.

The Elysia SDK is invisible in SDK adoption telemetry, and support cannot tell Elysia reports from plain Bun ones.

**Work item.** Call `applySdkMetadata(options, ...)` on the copy, or move the call above the spread. One-line fix. Add an assertion to `packages/elysia/test` that `event.sdk.name === 'sentry.javascript.elysia'`.

**Prior art** the identical bug was already found and fixed one package over: [#15458]()/[#15459]() "fix(bun): Includes correct sdk metadata". That PR also added the SDK-metadata assertion to the Bun tests, which is the test to copy here.

贡献指南

打开贡献指南

调研方向

Inspect packages/elysia/src/sdk.ts around the metadata application and compare the corresponding Bun fix in #15459. Run the tests under packages/elysia/test, then add an assertion that event.sdk.name is sentry.javascript.elysia; done means the assertion passes for the built Elysia SDK.

由索引模型根据 Issue 内容生成。

评估

技术栈
bun, typescript
领域
observability-sre
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
活跃
描述清晰度
描述清楚
新手友好度
92/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。