Skip to content

Cloudflare queues #14387

Description

@masylum

Problem Statement

I'm using sentry's hono middleware for the http requests, but I can't find any information about how to wrap my queue endpoint to capture errors. I understand that this is not provided by default, but is there any workaround for the time being? Also, would you recommend using cloudflare sdk to wrap the fetch endoint or keep using the hono middleware?

Cheers,
Pau

Solution Brainstorm

no ideas, sorry :)

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Nov 20, 2024
  2. andreiborza commented on Nov 21, 2024

    @andreiborza
    Member

    Hey @masylum, thanks for filing this.

    As far as I know, we don't yet offer instrumentation for queues in our cloudflare sdk yet (see #13365).

    As for workarounds, could you please provide a minimal reproduction repo?

  3. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Nov 21, 2024
  4. moved this to Waiting for: Community in GitHub Issues with 👀 3on Dec 9, 2024
  5. getsantry commented on Dec 31, 2024

    @getsantry

    This issue has gone three weeks without activity. In another week, I will close it.

    But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


    "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

  6. FraBle commented on Feb 26, 2026

    @FraBle

    @andreiborza

    As for workarounds, could you please provide a minimal reproduction repo?

    index.ts:

    ...
    const app = new Hono<Environment>();
    ...
    const handler = Sentry.withSentry((env: CloudflareBindings) => {
      const { id: versionId } = env.CF_VERSION_METADATA;
      return {
        // https://docs.sentry.io/platforms/javascript/guides/cloudflare/configuration/options/#core-options
        dsn: env.SENTRY_DSN,
        release: versionId,
        environment: process.env.NODE_ENV,
        attachStacktrace: true,
        sendDefaultPii: true,
        _experiments: { enableLogs: true },
        tracesSampleRate: 1.0,
        profilesSampleRate: 1.0,
      };
    }, {
      fetch: app.fetch,
      queue,
    });
    
    export default handler satisfies ExportedHandler<
      CloudflareBindings,
      LifecycleEventMessage
    >;

    queue/index.ts:

    ...
    const queue: ExportedHandlerQueueHandler<
      CloudflareBindings,
      LifecycleEventMessage
    > = async (batch, env): Promise<void> => {
      console.log(`Processing batch from queue: ${batch.queue}`);
      switch (batch.queue) {
        ...[do some processing based on what queue the message is in]
      }
    };
    
    export default queue;
  7. 1 remaining item

  8. linear commented on Feb 26, 2026

    @linear
  9. moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 3on Feb 26, 2026
  10. JPeer264 commented on Feb 26, 2026

    @JPeer264
    Member

    @FraBle thanks for the hints. I'll take a look on this

  11. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Feb 26, 2026
  12. self-assigned this
    on Apr 27, 2026
  13. JPeer264 commented on May 4, 2026

    @JPeer264
    Member

    @FraBle FYI there is an open PR that is including this feature. However the functionality of having links between producer and consumer has been moved into a separate ticket. How important would be this feature for you?

  14. FraBle commented on May 6, 2026

    @FraBle

    @JPeer264 not urgent, I was running into this limitation for a side project.

  15. github-actions commented on May 7, 2026

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #20529, which was included in the 10.52.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions