Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

@sentry/cloudflare: stubs from namespace.jurisdiction() bypass Durable Object instrumentation

クローズ 初心者向け
#24,442 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
86/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
observability

調査の方向性

packages/cloudflare/src/instrumentations/instrumentDurableObjectNamespace.ts から始めます。ここでは現在、get トラップが get と getByName を特別扱いしています。他の namespace 関数がどのようにバインドされているかを追跡し、jurisdiction() が RPC トレースの伝播を伴う再帰的に計装された namespace を返すことを確認します。完了の条件は、jurisdiction に制限された namespace を通じて取得したスタブが、直接の namespace 呼び出しと同じ fetch スパンおよび sentry_rpc_meta の動作を生成することです。

索引モデルが issue の本文から書いたものです。

説明

Bug Cloudflare Workers Spans
Environment
  • @sentry/cloudflare: 10.74.0 (also present on develop and 11.0.0-beta.2)
  • Caller wrapped with Sentry.withSentry(), enableRpcTracePropagation: true
  • Durable Object namespace restricted to a jurisdiction (env.MY_DO.jurisdiction('eu'))
Description

instrumentDurableObjectNamespace wraps get and getByName so the returned stub gets fetch spans and
RPC trace propagation. Every other function on the namespace, including jurisdiction, goes through
value.bind(target), so a jurisdiction-restricted namespace is the raw binding. Stubs from it get
no fetch span and never append __sentry_rpc_meta__.

That applies to every Durable Object call from an app that uses data-location jurisdictions (for
example EU residency). The traces break at the Durable Object boundary. Combined with the receiver-side gap in #24443, the receiver
also loses all of its telemetry.

Reproduction
const ns = env.MY_DO.jurisdiction('eu');
const stub = ns.get(ns.idFromName('x'));
await stub.someRpcMethod('a'); // receiver sees no __sentry_rpc_meta__; no caller-side span

Compare with env.MY_DO.get(env.MY_DO.idFromName('x')), which does propagate.

Expected

jurisdiction() returns a namespace instrumented the same way, i.e.
instrumentDurableObjectNamespace(value.apply(target, args), propagateRpcTrace).

Code

packages/cloudflare/src/instrumentations/instrumentDurableObjectNamespace.ts: the get trap only
special-cases get/getByName.

主要言語
TypeScript
スター
8.7k
フォーク
1.9k
平均マージ
1日 16時間
マージ済み PR(30日)
576

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

getsentry/sentry-javascript のほかの issue

getsentry/sentry-javascript の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。