Skip to content

feat(nestjs): Instrument @nestjs/bullmq#19759

Open
nicohrubec wants to merge 9 commits intodevelopfrom
nh/nestjs-bullmq-instrumentation
Open

feat(nestjs): Instrument @nestjs/bullmq#19759
nicohrubec wants to merge 9 commits intodevelopfrom
nh/nestjs-bullmq-instrumentation

Conversation

@nicohrubec
Copy link
Member

@nicohrubec nicohrubec commented Mar 11, 2026

Add automatic instrumentation for BullMQ queue processors in NestJS via the @Processor decorator from @nestjs/bullmq. Wraps the process() method on @Processor decorated classes to fork an isolation scope per job, create a queue.process transaction, and capture unhandled exceptions. Also adds a dedicated nestjs-bullmq e2e test application to test this setup.

Note: @OnWorkerEvent lifecycle handlers (e.g. completed, failed) run outside the isolation scope created by process(). Breadcrumbs/tags set in these handlers leak to the default isolation scope. This is documented with a test and will be addressed in a follow-up.

Closes #12823

@github-actions
Copy link
Contributor

github-actions bot commented Mar 11, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 25.64 kB - -
@sentry/browser - with treeshaking flags 24.14 kB - -
@sentry/browser (incl. Tracing) 42.62 kB - -
@sentry/browser (incl. Tracing, Profiling) 47.28 kB - -
@sentry/browser (incl. Tracing, Replay) 81.42 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 71 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 86.12 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 98.37 kB - -
@sentry/browser (incl. Feedback) 42.45 kB - -
@sentry/browser (incl. sendFeedback) 30.31 kB - -
@sentry/browser (incl. FeedbackAsync) 35.36 kB - -
@sentry/browser (incl. Metrics) 26.92 kB - -
@sentry/browser (incl. Logs) 27.07 kB - -
@sentry/browser (incl. Metrics & Logs) 27.74 kB - -
@sentry/react 27.39 kB - -
@sentry/react (incl. Tracing) 44.95 kB - -
@sentry/vue 30.08 kB - -
@sentry/vue (incl. Tracing) 44.48 kB - -
@sentry/svelte 25.66 kB - -
CDN Bundle 28.27 kB - -
CDN Bundle (incl. Tracing) 43.5 kB - -
CDN Bundle (incl. Logs, Metrics) 29.13 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 44.34 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 68.2 kB - -
CDN Bundle (incl. Tracing, Replay) 80.32 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 81.22 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 85.86 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 86.76 kB - -
CDN Bundle - uncompressed 82.56 kB - -
CDN Bundle (incl. Tracing) - uncompressed 128.5 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 85.43 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 131.37 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 209.06 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 245.35 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 248.21 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 258.26 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 261.11 kB - -
@sentry/nextjs (client) 47.37 kB - -
@sentry/sveltekit (client) 43.07 kB - -
@sentry/node-core 52.27 kB +0.02% +8 B 🔺
@sentry/node 174.76 kB +0.01% +4 B 🔺
@sentry/node - without tracing 97.44 kB +0.02% +13 B 🔺
@sentry/aws-serverless 113.24 kB +0.01% +8 B 🔺

View base workflow run

@nicohrubec nicohrubec marked this pull request as ready for review March 11, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add instrumentation for @nestjs/bullmq

1 participant