Skip to content

feat(node): Add BullMQ integration#21777

Draft
JPeer264 wants to merge 1 commit into
developfrom
jp/bullmq-queue-insights
Draft

feat(node): Add BullMQ integration#21777
JPeer264 wants to merge 1 commit into
developfrom
jp/bullmq-queue-insights

Conversation

@JPeer264

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-06-25T10%3A08%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-06-25T10%3A00%3A00

Example trace (with span link to the consumer): https://sentry-sdks.sentry.io/explore/traces/trace/375c2cf7901af9c4a2ae660b59e6a2d6/?node=span-d34047629120efaf&project=4510555608449024&source=traces&statsPeriod=15m&targetId=09a7742d453a8b68&timestamp=1782382478

@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 from 1ec4099 to 1247441 Compare June 25, 2026 10:41
@JPeer264 JPeer264 force-pushed the jp/bullmq-queue-insights branch from 1247441 to 212f9d6 Compare June 25, 2026 10:54
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.

Insights: auto-Instrument BullMQ for Queue Insights

1 participant