Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/cloudflare
SDK Version
10.75.1
Framework Version
Cloudflare Workers, compatibility_date 2026-05-25, nodejs_compat
Link to Sentry event
No response
Reproduction Example/SDK Setup
import * as Sentry from '@sentry/cloudflare';
export default Sentry.withSentry(env => ({ dsn: env.SENTRY_DSN }), {
async scheduled(_controller, env) {
await env.MY_QUEUE.metrics();
},
} satisfies ExportedHandler<Env>);
Steps to Reproduce
- Bind a Queue producer as
MY_QUEUE in wrangler.jsonc.
- Call
env.MY_QUEUE.metrics() from any handler wrapped with withSentry (we hit it in scheduled).
Expected Result
metrics() resolves with the queue's backlog metrics, as it does on the raw binding from import { env } from 'cloudflare:workers'.
Actual Result
TypeError: Illegal invocation: function called with incorrect `this` reference. See https://developers.cloudflare.com/workers/observability/errors/#illegal-invocation-errors for details.
Additional Context
instrumentQueueProducer wraps send and sendBatch and returns every other property from the Proxy unbound. metrics is a native method, so calling it through the Proxy runs it with the Proxy as this, which workerd rejects. The Durable Object namespace/storage and Workers AI proxies bind passed-through functions to the target, which avoids this.
Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/cloudflare
SDK Version
10.75.1
Framework Version
Cloudflare Workers,
compatibility_date2026-05-25,nodejs_compatLink to Sentry event
No response
Reproduction Example/SDK Setup
Steps to Reproduce
MY_QUEUEinwrangler.jsonc.env.MY_QUEUE.metrics()from any handler wrapped withwithSentry(we hit it inscheduled).Expected Result
metrics()resolves with the queue's backlog metrics, as it does on the raw binding fromimport { env } from 'cloudflare:workers'.Actual Result
Additional Context
instrumentQueueProducerwrapssendandsendBatchand returns every other property from the Proxy unbound.metricsis a native method, so calling it through the Proxy runs it with the Proxy asthis, which workerd rejects. The Durable Object namespace/storage and Workers AI proxies bind passed-through functions to the target, which avoids this.Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it.