Skip to content

Design a Telemetry Interface

Past due by 3 months 66% complete

The telemetry interface should be a Typescript interface that should be part of the BullMQ package. In this milestone it is expected to have a complete (or almost complete as a future implementation may prove that the interface must be changed), and some pseudo code showing the feasibility of the interface for implementing observability add-ons.

The chall…

The telemetry interface should be a Typescript interface that should be part of the BullMQ package. In this milestone it is expected to have a complete (or almost complete as a future implementation may prove that the interface must be changed), and some pseudo code showing the feasibility of the interface for implementing observability add-ons.

The challenge here is that the interface must be used internally in BullMQ, for example, lets say that we enhance BullMQ Queue constructor to accept a Telemetry plugin, something like this:

import { Queue } from "bullmq";
import { Otel } from "bullmq-otel"

const queue = new Queue("test-otel", { telemetry: new Otel(…)});

So when giving a Telemetry plugin the queue will now call the interface methods when doing different operations, for example when the user calls queue.add(…), we may now need to call some method of the plugin to register that call and so on, and similarly with the Worker class in BullMQ.

Some references for inspiration are these third party implementations: https://github.com/appsignal/opentelemetry-instrumentation-bullmq and https://github.com/jenniferplusplus/opentelemetry-instrumentation-bullmq

These are based on monkey patching BullMQ, which is what we want to precisely avoid by defining this new interface.

Here some summary from ChatGPT:

To develop a Telemetry interface for BullMQ with the ability to integrate with frameworks like OpenTelemetry, it's crucial to understand some key OpenTelemetry concepts: Spans, Traces, and Context Propagation.

Key Concepts:

  1. Spans:

  2. Traces:

  3. Context Propagation:

Loading