0.27.1 • Published 2 years ago

opentelemetry-instrumentation-amqplib v0.27.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

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.

0.27.1

2 years ago

0.27.0

2 years ago

0.26.1

2 years ago

0.26.0

3 years ago

0.25.0

3 years ago

0.24.1

3 years ago

0.24.0

3 years ago

0.23.0

3 years ago

0.22.1

3 years ago

0.22.0

3 years ago

0.21.0

3 years ago

0.5.1

3 years ago

0.4.4

3 years ago

0.5.0

3 years ago

0.4.3

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.4.2

3 years ago

0.3.0

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago