Setup Data Streams Monitoring for Node.js
Prerequisites
Supported libraries
Technology | Library | Minimal tracer version | Recommended tracer version |
---|
Kafka | kafka-node | 2.39.0 or 3.26.0 or 4.5.0 | 5.25.0 or later |
RabbitMQ | amqplib | 3.48.0 or 4.27.0 or 5.3.0 | 5.3.0 or later |
Amazon SQS | client-sqs | 3.47.0 or 4.26.0 or 5.2.0 | 5.18.0 or later |
Amazon Kinesis | client-kinesis | 3.47.0 or 4.26.0 or 5.2.0 | 5.18.0 or later |
Amazon SNS | client-sns | 3.47.0 or 4.26.0 or 5.2.0 | 5.18.0 or later |
Google Pub/Sub | google-cloud/pubsub | 5.25.0 or 4.49.0 | 5.25.0 or later |
Installation
Node.js uses auto-instrumentation to inject and extract additional metadata required by Data Streams Monitoring for measuring end-to-end latencies and the relationship between queues and services. To enable Data Streams Monitoring, set the DD_DATA_STREAMS_ENABLED
environment variable to true
on services sending messages to (or consuming messages from) Kafka.
For example:
environment:
- DD_DATA_STREAMS_ENABLED: "true"
Monitoring SQS pipelines
Data Streams Monitoring uses one message attribute to track a message’s path through an SQS queue. As Amazon SQS has a maximum limit of 10 message attributes allowed per message, all messages streamed through the data pipelines must have 9 or fewer message attributes set, allowing the remaining attribute for Data Streams Monitoring.
Further Reading
Additional helpful documentation, links, and articles: