
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
opentelemetry-instrumentation-bullmq
Advanced tools
Auto-instrumentation for the BullMQ message framework
This module provides automatic tracing instrumentation for BullMQ.
Compatible with OpenTelemetry JS API and SDK 1.0+
.
npm install --save @appsignal/opentelemetry-instrumentation-bullmq
[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.
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("@appsignal/opentelemetry-instrumentation-bullmq");
const provider = new NodeTracerProvider();
provider.register();
registerInstrumentations({
instrumentations: [
new BullMQInstrumentation({
// configuration options, see below
}),
],
});
Name | Type | Default value | Description |
---|---|---|---|
emitCreateSpansForBulk | boolean | true | Whether to emit a create span for each individual job enqueued by Queue.addBulk or FlowProducer.addBulk . The span representing the overall bulk operation is emitted regardless. |
emitCreateSpansForFlow | boolean | true | Whether to emit a create span for each individual job enqueued by FlowProducer.add or FlowProducer.addBulk . The span representing the overall flow operation is emitted regardless. |
requireParentSpanForPublish | boolean | false | Whether to omit emitting a publish span (and the create child spans for it, for bulk and flow operations) when there is no parent span, meaning that the span created would be the root span of a new trace. |
The instrumentation aims to comply with the OpenTelemetry Semantic Convention for Messaging Spans. Whenever possible, attributes from the semantic convention are used in these spans.
Name | Span kind | messaging.bullmq.operation.name attribute [1] | Description |
---|---|---|---|
{queueName} publish | PRODUCER | Queue.add | A new job is added to the queue. |
{queueName} publish | INTERNAL [2] | Queue.addBulk | New jobs are added to the queue in bulk. |
{queueName} publish | INTERNAL [3] | FlowProducer.add | A new job flow is added to a queue. |
(bulk) publish | INTERNAL [2] [3] | FlowProducer.addBulk | New job flows are added to queues in bulk. |
{queueName} create | PRODUCER | Job.add | Each of the individual jobs added to a queue. Only emitted in bulk or flow operations. Child span of a publish span. [4] |
{queueName} process | CONSUMER | Worker.run | Each job execution by a worker. Linked to the corresponding producer span. [5] |
emitCreateSpansForBulk
configuration option is set to false
, it is a PRODUCER
span.emitCreateSpansForFlow
configuration option is set to false
, it is a PRODUCER
span.Queue.addBulk
and FlowProducer.addBulk
when the emitCreateSpansForBulk
configuration option is false
, or for calls to FlowProducer.add
and FlowProducer.addBulk
when the emitCreateSpansForFlow
configuration option is set to false
.requireParentSpanForPublish
is set to true
. In this case, no link is established.Apache 2.0 - See LICENSE for more information.
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.
FAQs
Auto-instrumentation for the BullMQ message framework
We found that opentelemetry-instrumentation-bullmq demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.