Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jenniferplusplus/opentelemetry-instrumentation-bullmq

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jenniferplusplus/opentelemetry-instrumentation-bullmq

Auto-instrumentation for the BullMQ message framework

  • 0.5.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.1K
increased by12.02%
Maintainers
0
Weekly downloads
 
Created
Source

OpenTelemetry Bullmq Instrumentation for Node.js

Node.js CI npm version

This module provides automatic tracing instrumentation for BullMQ.

Compatible with OpenTelemetry JS API and SDK 1.0+.

Installation

npm install --save @jenniferplusplus/opentelemetry-instrumentation-bullmq

Supported Versions

  • [1.90.1, 2.x, 3.x, 4.x, 5.x]

It's likely that the instrumentation would support earlier versions of BullMQ, but I haven't tested it.

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 { BullMQInstrumentation } = require('@jenniferplusplus/opentelemetry-instrumentation-bullmq');

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

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

Emitted Spans

NameBullMQ methodDescription
{QueueName.JobName} Queue.addQueue.add A new job is added to the queue
{QueueName} Queue.addBulkQueue.addBulk New jobs are added to the queue in bulk
{QueueName.FlowName} FlowProducer.addFlowProducer.add A new job flow is added to a queue
FlowProducer.addBulk FlowProducer.addBulk New job flows are added to queues in bulk
{QueueName.JobName} Job.addJobJob.addJob Each individual job added to a queue
{WorkerName} Worker.runWorker.run While a worker is accepting jobs
{QueueName.JobName} Worker.{WorkerName} #{attempt}Worker.callProcessJobEach job execution by a worker's processor function

License

Apache 2.0 - See LICENSE for more information.

Contributing

Contributions are welcome. Feel free to open an issue or submit a PR. I would like to have this package included in opentelemetry-js-contrib at some point. Until then, it lives here.

BullMQ has a hard dependency on Redis, which means that Redis is (for now) a test dependency for the instrumentations. To run the tests, you should have a redis server running on localhost at the default port. If you have docker installed, you can just do docker-compose up and be ready to go.

Keywords

FAQs

Package last updated on 23 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc