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 摘要。