cloudflare: Several common bindings are not instrumented
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
packages/cloudflare/src/instrumentations/worker/instrumentEnv.ts から始め、既存の R2 の検出およびインストルメンテーションのパスを比較します。JSRPC を除外したうえで、get、put、list、getWithMetadata を使用する KV 固有の検出を追加し、instrumentR2 に一致する span で binding をインストルメントします。完了の条件は、他の binding と混同せずに直接の env.MY_KV 操作がインストルメントされ、関連する Cloudflare のインストルメンテーションテストが更新または追加されていることです。
索引モデルが issue の本文から書いたものです。
説明
packages/cloudflare/src/instrumentations/worker/instrumentEnv.ts detects D1, Queue, R2, RateLimit, Workers AI, DurableObjectNamespace and JSRPC. Nothing else matches, so these fall through untouched:
| Binding | Note |
|---|---|
KV namespace (env.MY_KV) |
the most-used Cloudflare binding. Durable Object storage KV (ctx.storage.kv) is instrumented, which makes this easy to mistake for covered. |
| Vectorize | query, insert, upsert, getByIds |
| Analytics Engine | writeDataPoint |
| Pipelines | send only, so isQueue (which needs send + sendBatch) misses it |
| Secrets Store | get |
| Dispatch namespace | Workers for Platforms |
| Hyperdrive | connection only; the query itself needs the driver instrumented |
| Containers, Browser Rendering | |
Cache API (caches.default.match / .put) |
not a binding, but the same category of missing span. The cache-client test suite is about the SDK client cache, not this. |
Workers KV verification A live KvNamespace binding matches none of the seven duck-type checks, so instrumentEnv's proxy returns it untouched:
kvCtor: "KvNamespace", methods: [get, put, delete, list, getWithMetadata]
isJSRPC: false hasIdFromName: false hasSendAndSendBatch: false
hasPrepareBatchExec: false hasHeadPutMultipart: false hasLimit: false
hasRunGatewayToMarkdown: false
The same worker, one invocation, with two controls to prove the harness works:
| Call | Span |
|---|---|
Sentry.startSpan('control-manual-span') |
test.control | control-manual-span |
env.MY_R2.put() (R2 is instrumented, same env proxy) |
object.put | r2_put |
env.MY_R2.head() |
object.head | r2_head |
env.MY_KV.put() |
none |
env.MY_KV.get() |
none |
env.MY_KV.list() |
none |
env.MY_KV.delete() |
none |
KVNamespace and getWithMetadata appear nowhere in any package's src. Every kv match in packages/cloudflare/src is Durable Object storage (ctx.storage.kv), including the durableObjectSqlSpanAllowlist sibling option at client.ts:386 that mentions "KV reads/writes".
One exception: KV is not completely uncovered across the monorepo. @sentry/nitro and @sentry/nuxt subscribe to unstorage tracing channels (packages/nitro/src/runtime/hooks/captureStorageEvents.ts:84) and emit cache spans with db.system.name taken from the unstorage driver. A Nitro or Nuxt app on Cloudflare that reads through useStorage() over a KV-backed mount therefore does get spans. That path does not help direct env.MY_KV access, and does not exist for Next.js, TanStack Start, SvelteKit, Hono, React Router, or a plain Worker. So the gap is real, but scope any new issue to the binding rather than to "KV", and reuse the op naming that instrumentation already established.
Work item. Start with the KV binding alone: an isKVNamespace duck-type (get + put + list + getWithMetadata, and not JSRPC) plus an instrumentKV that emits spans matching instrumentR2. getWithMetadata is the discriminator worth keying on, since get/put/delete/list are common enough to risk a false positive. Order the check before isRateLimit, which matches anything with a limit method. Ship Vectorize and Analytics Engine as follow-ups.
**Prior art **(tracked). Most of this list is already tracked, one issue per binding:
| Binding | Issue |
|---|---|
| Workers KV | none |
| Vectorize | #20847 (open) |
| Analytics Engine | #20860 (open) |
| Dispatch namespace | #20859 (open) |
| Cache API | #16895 (open) |
| Hyperdrive / relational DBs | #16249 (open) |
| PITR API | #20831 (open) |
| Flagship feature flags | #21184 (open) |
storage.sql |
#20833 (open) |
| Pipelines, Secrets Store, Containers, Browser Rendering | none |
Workers KV having no issue was worth double-checking, because two closed issues look like they cover it and do not: #19384 "Cloudflare Instrument Async KV Api" and #20830 "Cloudflare instrument Sync KV API" are both sub-tickets of #19106 (SQLite-backed Durable Object storage). They are about ctx.storage.kv, not the env.MY_KV binding, and both shipped. So the most-used Cloudflare binding is the one gap with no ticket, and it reads as already done.
- 主要言語
- TypeScript
- スター
- 8.7k
- フォーク
- 1.9k
- 平均マージ
- 1日 16時間
- マージ済み PR(30日)
- 576
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
getsentry/sentry-javascript のほかの issue
-
Browser Bug Next.js Traces Waiting for: Product Owner
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
getsentry/sentry-javascript#24672 · コメント 1 件 ·
-
javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
getsentry/sentry-javascript#24200 · コメント 2 件 ·
-
javascript Task
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
getsentry/sentry-javascript#24134 · コメント 1 件 ·
-
Cloudflare Workers javascript Tests
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
getsentry/sentry-javascript#24051 · コメント 1 件 ·
-
Bug Bun javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
getsentry/sentry-javascript#24045 · コメント 1 件 ·
getsentry/sentry-javascript の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
bcgov/bc-wallet-mobile#4761 · コメント 1 件 ·
-
external-issue to-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
area-deployment area-integrations triage:bot-seen
難易度 2/5 半日 初心者へのやさしさ 86/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100