@sentry/cloudflare: Durable Object RPC methods drop metrics, logs and errors unless the caller propagates a trace
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 63/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- observability
Línea de trabajo
Empieza en createRpcPrototypeWrapper y compara su ruta de metadatos ausentes con el wrapper de captura únicamente de instrumentWorkerEntrypoint y wrapMethodWithSentry. Reproduce una llamada RPC externa desde el plain worker del issue y verifica después que las llamadas sin metadatos se ejecuten con un cliente y un isolation scope, hagan flush de las métricas y los errores, y dejen sin envolver las llamadas internas a this.method().
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 8.7k
- Forks
- 1.9k
- Merge medio
- 1 d 16 h
- PR fusionados (30 d)
- 576
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de getsentry/sentry-javascript
-
Browser Bug Next.js Traces Waiting for: Product Owner
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
getsentry/sentry-javascript#24672 · 1 comentario ·
-
Flaky Test React Router Framework Spans Tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
getsentry/sentry-javascript#24348 · 1 comentario ·
-
javascript
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
getsentry/sentry-javascript#24200 · 2 comentarios ·
-
javascript Task
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
getsentry/sentry-javascript#24134 · 1 comentario ·
-
Cloudflare Workers javascript Tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
getsentry/sentry-javascript#24051 · 1 comentario ·
Todos los issues de getsentry/sentry-javascript
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
mksglu/context-mode#1200 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
anthropics/claude-code#96687 ·
-
good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
AOSSIE-Org/DebateAI#582 · 2 comentarios ·