@sentry/cloudflare registers its own ProxyTracerProvider globally (even when tracesSampleRate is 0) via its OpenTelemetry compatibility shim. That clobbers the WorkerTracerProvider that otel-cf-workers installs, causing every request to throw 'The global tracer is not of type WorkerTracer' and the worker to 1101 on every route. Passing skipOpenTelemetrySetup: true to the Sentry config opts out of that shim. Sentry error capture still works — it uses its own transport and scope management, independent of OTEL. otel-cf-workers is then free to own the provider and flush spans reliably via ctx.waitUntil.
Unified · Split
| @@ -35,6 +35,11 @@ export default Sentry.withSentry( · 34 unmodified lines | ||
| 35 | 35 | tracesSampleRate: 0, |
| 36 | 36 | enableLogs: true, |
| 37 | 37 | sendDefaultPii: true, |
| 38 | + // otel-cf-workers owns the global TracerProvider. Sentry's OTEL compat | |
| 39 | + // shim registers a ProxyTracerProvider of its own, which prevents | |
| 40 | + // otel-cf-workers from finding its WorkerTracer and breaks the whole | |
| 41 | + // request path with "global tracer is not of type WorkerTracer". | |
| 42 | + skipOpenTelemetrySetup: true, | |
| 38 | 43 | }), |
| 39 | 44 | instrumentedHandler, |
| 40 | 45 | ); |