Skip to content

feat(node): Add BullMQ integration - #21777

Open
JPeer264 wants to merge 39 commits into
developfrom
jp/bullmq-queue-insights
Open

JPeer264 wants to merge 39 commits into
developfrom
jp/bullmq-queue-insights

Conversation

@JPeer264

@JPeer264 JPeer264 commented Jun 25, 2026 •

Copy link
Copy Markdown
Member

closes #12956
closes JS-89

Description

This adds telemetry for BullMQ. It only piggybacks on the telemetry option. It has metrics, tracing with span links between producer and consumer

It can be used as following:

import * as Sentry from '@sentry/node';
import { Queue, Worker } from 'bullmq';

const telemetry = new Sentry.BullMQTelemetry();

const queue = new Queue('myQueue', {
  connection: { host: '127.0.0.1', port: 6379 },
  telemetry,
});

It is the same usage as the BullMQ OTel package: https://docs.bullmq.io/guide/telemetry/getting-started

To make this an integration the types were vendored in and based on that the integration was done.

OP decisions

The consumer spans generate queue.task where the producer emits queue.submit, this should be reflecting our span operations. I didn't use queue.task.bullmq, like it is for Celery - but this can be changed if wanted.

Sentry traces / metrics

Example metrics: https://sentry-sdks.sentry.io/explore/metrics/?end=2026-10-05T07%3A25%3A00&metric=%7B%22metric%22%3A%7B%22name%22%3A%22bullmq.jobs.completed%22%2C%22type%22%3A%22counter%22%2C%22unit%22%3A%22none%22%7D%2C%22query%22%3A%22%22%2C%22aggregateFields%22%3A%5B%7B%22yAxes%22%3A%5B%22sum%28value%2Cbullmq.jobs.completed%2Ccounter%2Cnone%29%22%5D%7D%5D%2C%22aggregateSortBys%22%3A%5B%7B%22field%22%3A%22sum%28value%2Cbullmq.jobs.completed%2Ccounter%2Cnone%29%22%2C%22kind%22%3A%22desc%22%7D%5D%2C%22sortBys%22%3A%5B%7B%22field%22%3A%22timestamp%22%2C%22kind%22%3A%22desc%22%7D%5D%2C%22mode%22%3A%22samples%22%7D&project=4510555608449024&start=2026-10-05T07%3A15%3A00

Consumer trace (queue.task span with a link to the producer): https://sentry-sdks.sentry.io/explore/traces/trace/1a21906f0d8d4db7bbf80bf9cf7d32f3/?node=span-9b305b00fd106329&project=4510555608449024&source=traces&targetId=9b305b00fd106329&timestamp=1791184722
Producer trace (GET /enqueue with a queue.submit span): https://sentry-sdks.sentry.io/explore/traces/trace/f135329fd15a440091a2ee445a8df4fc/?node=span-9db4d2c0668abe46&project=4510555608449024&source=traces&targetId=9db4d2c0668abe46&timestamp=1791184722

@JPeer264 JPeer264 self-assigned this Jun 25, 2026
@linear-code

linear-code Bot commented Jun 25, 2026

Copy link
Copy Markdown

JS-89

@JPeer264
JPeer264 force-pushed the jp/bullmq-queue-insights branch 2 times, most recently from 1247441 to 212f9d6 Compare June 25, 2026 10:54
@github-actions

Copy link
Copy Markdown
Contributor

This pull request 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 apply the label PR: no-auto-close I will leave it alone ... forever!

@andreiborza

Copy link
Copy Markdown
Member

@JPeer264 can we close this? Is this still relevant?

@JPeer264

Copy link
Copy Markdown
Member Author

Actually I still want to ship this, it just had lower prio because of v11. I'll make this pretty next week

@JPeer264
JPeer264 force-pushed the jp/bullmq-queue-insights branch from 212f9d6 to 589f150 Compare September 29, 2026 14:47
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: 9074f3d (PR test merge using develop at eff54dd)

Against: eff54dd (develop) · base run #63548

✅ Baseline matches: this diff contains only this PR's changes.

Path Size % Change Change
@sentry/browser 29.98 kB - -
@sentry/browser - with treeshaking flags 28.13 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.03 kB - -
@sentry/browser (incl. Tracing) 52.17 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 52.18 kB - -
@sentry/browser (incl. Tracing, Profiling) 55.12 kB - -
@sentry/browser (incl. Tracing, Replay) 91.97 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 80.86 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 96.7 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 109.64 kB - -
@sentry/browser (incl. Feedback) 47.51 kB - -
@sentry/browser (incl. sendFeedback) 35.05 kB - -
@sentry/browser (incl. FeedbackAsync) 40.15 kB - -
@sentry/browser (incl. Metrics) 31.01 kB - -
@sentry/browser (incl. Logs) 31.28 kB - -
@sentry/browser (incl. Metrics & Logs) 31.94 kB - -
@sentry/react 31.81 kB - -
@sentry/react (incl. Tracing) 54.5 kB - -
@sentry/vue 38.14 kB - -
@sentry/vue (incl. Tracing) 55.11 kB - -
@sentry/svelte 30.01 kB - -
@sentry/remix (Remix 3 client bundle) 57.19 kB - -
CDN Bundle 31.76 kB - -
CDN Bundle (incl. Tracing) 52.71 kB - -
CDN Bundle (incl. Logs, Metrics) 33.95 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 54.66 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74.93 kB - -
CDN Bundle (incl. Tracing, Replay) 90.41 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 92.33 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 96.55 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.5 kB - -
CDN Bundle - uncompressed 93.51 kB - -
CDN Bundle (incl. Tracing) - uncompressed 156.36 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.06 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 162.33 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 230.28 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 276.71 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 282.66 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 290.41 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 296.35 kB - -
@sentry/nextjs (client) 57.38 kB - -
@sentry/sveltekit (client) 52.55 kB - -
@sentry/core/server 43.62 kB - -
@sentry/core/browser 13.81 kB - -
@sentry/node 153.77 kB -0.01% -1 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.58 kB - -
@sentry/node - without tracing 95.32 kB - -
@sentry/node - without channel injection 134.42 kB - -
@sentry/aws-serverless 103.48 kB - -
@sentry/cloudflare (withSentry) - minified 195.52 kB - -
@sentry/cloudflare (withSentry) 486.37 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 216.19 kB - -

View base workflow run

@JPeer264
JPeer264 force-pushed the jp/bullmq-queue-insights branch 2 times, most recently from 254e5ec to 9d58e2b Compare September 30, 2026 06:25
@JPeer264
JPeer264 marked this pull request as ready for review September 30, 2026 06:43
@JPeer264
JPeer264 requested review from a team as code owners September 30, 2026 06:43
@JPeer264
JPeer264 requested review from chargome, isaacs, mydea, nicohrubec and s1gr1d and removed request for a team, isaacs and mydea September 30, 2026 06:43
Comment thread packages/node/src/integrations/tracing/bullmq/span.ts
Comment thread packages/node/src/integrations/tracing/bullmq/tracer.ts Outdated
Comment thread packages/node/src/integrations/tracing/bullmq/span.ts
Comment thread packages/node/src/integrations/tracing/bullmq/tracer.ts Outdated
Comment thread packages/node/src/integrations/tracing/bullmq/tracer.ts Outdated
Comment thread packages/node/src/integrations/tracing/bullmq/tracer.ts
Comment thread packages/node/src/integrations/tracing/bullmq/span.ts
Comment thread packages/node/src/integrations/tracing/bullmq/tracer.ts Outdated
Comment thread packages/node/src/integrations/tracing/bullmq/tracer.ts Outdated
Comment thread packages/node/src/integrations/tracing/bullmq/span.ts Outdated
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

👋 @chargome, @nicohrubec — Please review this PR when you get a chance!

@JPeer264
JPeer264 force-pushed the jp/bullmq-queue-insights branch from e4c22e7 to 9fdf51f Compare October 24, 2026 15:38
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Optional E2E tests

Some optional checks were not successful. They do not block the merge. 3 not successful, 62 successful. See the run.

Check Status
❌ CI: Optional E2E Tests / E2E node-anthropic-send-to-sentry (latest) Test (optional) Failing after 13s Details
❌ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Failing after 1m Details
❌ CI: Optional E2E Tests / E2E react-send-to-sentry Test (optional) Failing after 3m Details
Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E angular (canary) Test (optional) Successful in 52s Details
✅ CI: Optional E2E Tests / E2E cloudflare-mastra Test (optional) Successful in 28s Details
✅ CI: Optional E2E Tests / E2E nextjs-14 (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-flue-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-mastra (latest) Test (optional) Successful in 43s Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Successful in 42s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (canary, webpack) Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E cloudflare-think Test (optional) Successful in 33s Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E angular (canary) Test (optional) Successful in 54s Details
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E astro-7-static Test (optional) Successful in 43s Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable Test (optional) Successful in 18s Details
✅ CI: Optional E2E Tests / E2E deno (latest) Test (optional) Successful in 55s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (deno) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-think (ai v6) Test (optional) Successful in 29s Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) Successful in 30s Details
✅ CI: Optional E2E Tests / E2E node-eve (latest) Test (optional) Successful in 34s Details
✅ CI: Optional E2E Tests / E2E nextjs-14 (canary) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-eve Test (optional) Successful in 38s Details
✅ CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) Successful in 21s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) Successful in 15s Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) Successful in 22s Details
✅ CI: Optional E2E Tests / E2E node-flue Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions-send-to-sentry Test (optional) Successful in 58s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 20s Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-4 (canary) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (canary, turbopack) Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) Successful in 20s Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) Successful in 15s Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 (tracer provider) Test (optional) Successful in 20s Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions-send-to-sentry (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-mastra Test (optional) Successful in 43s Details
✅ CI: Optional E2E Tests / E2E node-anthropic-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry-static Test (optional) Successful in 49s Details
✅ CI: Optional E2E Tests / E2E node-pi-durable Test (optional) Successful in 21s Details
✅ CI: Optional E2E Tests / E2E nextjs-orpc Test (optional) Successful in 57s Details
✅ CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) Successful in 32s Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) Successful in 27s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16-standalone (canary, turbopack) Test (optional) Successful in 23s Details
✅ CI: Optional E2E Tests / E2E supabase-nextjs Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 33s Details
✅ CI: Optional E2E Tests / E2E vue-3 (canary) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) Successful in 26s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 19s Details
✅ CI: Optional E2E Tests / E2E nuxt-4-static (canary) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-openai-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 20s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) Successful in 18s Details
✅ CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) Successful in 23s Details
✅ CI: Optional E2E Tests / E2E node-openai-send-to-sentry (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-3 (canary) Test (optional) Successful in 53s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 18s Details
✅ CI: Optional E2E Tests / E2E vue-3 (no Options API) Test (optional) Successful in 51s Details

@JPeer264
JPeer264 requested a review from Lms24 October 25, 2026 11:40

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Insights: auto-Instrument BullMQ for Queue Insights

4 participants