@sentry/cloudflare: Durable Object RPC methods drop metrics, logs and errors unless the caller propagates a trace
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 63/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
- Bereich
- observability
Rechercherichtung
Beginne bei createRpcPrototypeWrapper und vergleiche dessen Pfad für fehlende Metadaten mit dem capture-only wrapper von instrumentWorkerEntrypoint und wrapMethodWithSentry. Reproduziere einen externen RPC-Aufruf vom plain worker im Issue und überprüfe anschließend, dass Aufrufe ohne Metadaten mit einem Client und einem Isolation Scope ausgeführt werden, Metriken und Fehler flushen und interne this.method()-Aufrufe unverpackt bleiben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Environment
@sentry/cloudflare: 10.74.0 (same logic ondevelop/11.0.0-beta.2)- DO wrapped with
instrumentDurableObjectWithSentry,enableRpcTracePropagation: true(the only
supported way to instrument RPC methods in v11, now thatinstrumentPrototypeMethodsis removed)
Description
createRpcPrototypeWrapper only calls wrapMethodWithSentry when the last argument carries
__sentry_rpc_meta__. Otherwise the original method runs with no client bound. Then:
Sentry.metrics.count/gauge/distributionreturn early (no client);Sentry.captureExceptionandSentry.logger.*are dropped;- no
rpcspan is recorded, and a thrown error is not captured.
Callers send the metadata only if they are Sentry-instrumented, have an active trace, and got the stub
through get/getByName on the instrumented env (see #24442). Common cases that lose everything:
- calls from uninstrumented workers or mixed deployments;
- calls from code running outside the request's async context;
- any call through
jurisdiction().
WorkerEntrypoint already covers this case: instrumentWorkerEntrypoint uses a capture-only wrapper
when the metadata is missing. Durable Objects have no equivalent. fetch, alarm and webSocket* are
always wrapped, so only RPC is affected. That makes the gap easy to miss: our production data had
14 days of DO alarm spans and zero DO rpc spans.
Reproduction
class MyDO extends DurableObject {
async ping() {
Sentry.metrics.count('my_do.ping', 1);
throw new Error('boom');
}
}
export const MyDOInstrumented = Sentry.instrumentDurableObjectWithSentry(
env => ({ dsn: env.SENTRY_DSN, tracesSampleRate: 1, enableRpcTracePropagation: true }),
MyDO,
);
// From a plain (uninstrumented) worker:
await env.MY_DO.get(env.MY_DO.idFromName('x')).ping();
Neither the metric nor the error reaches Sentry.
Expected
External RPC calls without metadata still run inside a client and isolation scope with flush, as
WorkerEntrypoint does. Internal this.method() calls stay unwrapped.
Proposed fix
A PR with this change will follow.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 8.7k
- Forks
- 1.9k
- Ø Merge
- 1 T. 16 Std.
- Gemergte PRs (30 T.)
- 576
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus getsentry/sentry-javascript
-
Browser Bug Next.js Traces Waiting for: Product Owner
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
getsentry/sentry-javascript#24672 · 1 Kommentar ·
-
Flaky Test React Router Framework Spans Tests
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
getsentry/sentry-javascript#24348 · 1 Kommentar ·
-
javascript
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
getsentry/sentry-javascript#24200 · 2 Kommentare ·
-
javascript Task
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
getsentry/sentry-javascript#24134 · 1 Kommentar ·
-
Cloudflare Workers javascript Tests
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
getsentry/sentry-javascript#24051 · 1 Kommentar ·
Alle Issues in getsentry/sentry-javascript
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
mksglu/context-mode#1200 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
anthropics/claude-code#96687 ·
-
good first issue
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 95/100
AOSSIE-Org/DebateAI#582 · 2 Kommentare ·