Announcing BullMQ Telemetry Support
Read more:
We are excited to announce the availability of Telemetry Support for BullMQ. Telemetry opens a new world of possibilities for monitoring and observability in BullMQ, allowing users to track the performance of their queues and workers in real-time, as well as diagnose issues more easily within the broader context of their applications.
Users have been asking for this kind of feature for a while, and there have even been third-party efforts to fill the gap with OpenTelemetry integrations such as JenniferPlusPlus's and AppSignal's.
These third-party solutions work great, but their authors find it difficult to maintain as they need to keep pace with any changes we make to BullMQ, since they can only rely on monkey-patching to incorporate their features.
For the built-in telemetry support in BullMQ, we have tried to be a bit more solution-agnostic, and even though we have been heavily inspired by OpenTelemetry, in theory, it should be possible to implement the interface for any other telemetry standards. This approach also helps us keep BullMQ’s codebase cleaner and free from external dependencies, especially for users who do not want to use any telemetry solution.
Therefore, we are providing a separate package that implements BullMQ’s telemetry interface for OpenTelemetry. You can find it here.
Enabling telemetry is straightforward: just pass a Telemetry implementation into the new telemetry option in your Queues like this:
import { Queue } from "bullmq";
import { BullMQOtel } from "bullmq-otel";
const queue = new Queue("myQueue", {
...
telemetry: new BullMQOtel("simple-guide"),
});
and for the workers:
import { Worker } from "bullmq";
import { BullMQOtel } from "bullmq-otel";
const worker = new Worker(
"myQueue",
async (job) => { ... },
{
telemetry: new BullMQOtel("simple-guide"),
}
);
You can then get some nice traces that span from the addition of jobs to the queue to their subsequent processing:
You can find a complete guide on how to start using telemetry in our official documentation.
Our telemetry interface has not yet been incorporated into Flows or BullMQ Pro, but we are already working on providing support for these, so stay tuned for more news very soon.
As Telemetry is a new feature, we would love to hear your feedback. Please feel free to open an issue in our GitHub repository if you have any questions or suggestions.