0.0.9 • Published 14 days ago

@useparagon/opentelemetry-instrumentation-bull v0.0.9

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
14 days ago

OpenTelemetry Bull Instrumentation

This module provides automatic tracing instrumentation for Bull.

Installation

npm install --save @useparagon/opentelemetry-instrumentation-bull

Usage

OpenTelemetry Bullmq Instrumentation allows the user to automatically collect trace data from Bullmq jobs and workers and export them to the backend of choice.

To load the instrumentation, specify it in the instrumentations list to registerInstrumentations. There is currently no configuration option.

const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { BullInstrumentation } = require('@useparagon/opentelemetry-instrumentation-bull');

const provider = new NodeTracerProvider();
provider.register();

registerInstrumentations({
  instrumentations: [
    new BullInstrumentation(),
  ],
});

Emitted Spans

NameBullMQ methodDescription
{QueueName.JobName} Queue.addQueue.addA new job is added to the queue
{QueueName} Queue.addBulkQueue.addBulkNew jobs are added to the queue in bulk
{QueueName} Queue.getNextJobQueue.getNextJobgetting next job from queue
{QueueName} Queue.cleanQueue.cleanCleaning jobs from queue
{QueueName} Queue.processJobQueue.processJobJob processing