Only create Cloudflare storage and D1 db spans when there is a parent span

未关闭 适合新手
#25,804 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@nicohrubec 已经在做这个了。

开始于 2026年10月29日。

  • #25860 来自 @lazerg —— 已关闭,未合并
  • #25879 来自 @nicohrubec —— 未关闭

评估

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

调研方向

阅读提到的五个 instrumentation 文件,并找到其中对 startSpan 的调用。在这些调用中添加 onlyIfParent: true,然后检查现有的 Cloudflare instrumentation 测试,并添加一个测试,表明没有活动 span 的操作不会创建 span。五个 instrumentation 都在没有父 span 时跳过创建 span,且测试通过后,即为完成。

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

描述

Cloudflare Workers Improvement Spans

The Cloudflare D1, KV, Durable Object storage and SqlStorage instrumentations create db spans when there is no active span. Each of these spans becomes its own root span and has no context.

Pass onlyIfParent: true to the startSpan calls in:

  • packages/cloudflare/src/instrumentations/worker/instrumentD1.ts
  • packages/cloudflare/src/instrumentations/worker/instrumentKV.ts
  • packages/cloudflare/src/instrumentations/instrumentDurableObjectStorage.ts
  • packages/cloudflare/src/instrumentations/instrumentDurableObjectSyncKvStorage.ts
  • packages/cloudflare/src/instrumentations/instrumentSqlStorage.ts

Add a test that checks that an operation without an active span creates no span.

主要语言
TypeScript
星标
8.8k
派生
1.9k
平均合并
1 天 21 小时
30 天内合并 PR
617

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

getsentry/sentry-javascript 的其他 Issue

查看 getsentry/sentry-javascript 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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