Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đã đóng Phù hợp với người mới
#24,442 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
86/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
observability

Hướng nghiên cứu

Bắt đầu tại packages/cloudflare/src/instrumentations/instrumentDurableObjectNamespace.ts, nơi trap get hiện đang xử lý riêng get và getByName. Theo dõi cách các hàm namespace khác được liên kết, sau đó xác minh rằng jurisdiction() trả về một namespace được instrument đệ quy với việc truyền trace RPC. Được xem là hoàn tất khi các stub nhận được thông qua một namespace bị giới hạn bởi jurisdiction tạo ra cùng các fetch span và cùng hành vi sentry_rpc_meta như các lệnh gọi namespace trực tiếp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
8.7k
Fork
1.9k
Merge trung bình
1 ngày 16 giờ
Pull request đã merge (30 ngày)
576

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của getsentry/sentry-javascript

Tất cả issue của getsentry/sentry-javascript

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.