Socket
Socket
Sign inDemoInstall

opentelemetry-instrumentation-amqplib

Package Overview
Dependencies
3
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

opentelemetry-instrumentation-amqplib


Version published
Weekly downloads
678
decreased by-5.57%
Maintainers
1
Install size
1.42 MB
Created
Weekly downloads
 

Readme

Source

OpenTelemetry amqplib Instrumentation for Node.js

NPM version

This module provides automatic instrumentation for amqplib.

Installation

npm install --save opentelemetry-instrumentation-amqplib

Usage

For further automatic instrumentation instruction see the @opentelemetry/instrumentation package.

const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { AmqplibInstrumentation } = require('opentelemetry-instrumentation-amqplib');

registerInstrumentations({
  tracerProvider,
  instrumentations: [
    new AmqplibInstrumentation({
      // see under for available configuration
    })
  ]
});

amqplib Instrumentation Options

amqplib instrumentation has few options available to choose from. You can set the following:

OptionsTypeDescription
publishHookAmqplibPublishCustomAttributeFunctionhook for adding custom attributes before publish message is sent
consumeHookAmqplibConsumerCustomAttributeFunctionhook for adding custom attributes before consumer message is processed
consumeEndHookAmqplibConsumerEndCustomAttributeFunctionhook for adding custom attributes after consumer message is acked to server
moduleVersionAttributeNamestringIf passed, a span attribute will be added to all spans with key of the provided moduleVersionAttributeName and value of the patched module version
consumeTimeoutMsnumberdefault is 1 minute. read description below

This extension (and many others) was developed by Aspecto with ❤️

Implementation Issues

Instrumentation Timeout

The instrumentation is keeping track on open consumed messages which are not acked yet to support ackAll/allUpTo etc features.

Saving a reference, means the msg will not be garbage collected if user forget about it and never ack the msg. To insure we don't leak memory, the instrumentation has internal timeout which is not correlated to the server timeout if one is set, and which will trigger ending the span when reached. This timeout is by default set to 1 minute, and should be reviewed in each use case, for example if handling consumed messages is expected to take more than 1 minute. If you want to disable this behavior, set consumeTimeoutMs to null or 0.

Keywords

FAQs

Last updated on 13 Apr 2022

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc