DataDog StatsD icon

DataDog StatsD

Send metrics, logs and events to DataDog using StatsD protocol

Overview

This node sends metrics to DataDog using the StatsD protocol. It supports sending different types of metrics, events, and service checks to a configured DataDog agent. The "Metric" resource with the "Counter" operation allows incrementing or decrementing a counter metric by a specified value.

Common scenarios include monitoring application performance, tracking event counts, or aggregating custom counters such as user signups, API calls, or error occurrences. For example, you could use this node to increment a counter each time a user completes a purchase, helping you monitor sales volume in real-time.

Properties

Name Meaning
Metric Name The name of the metric to send to DataDog.
Value The numeric value to increment or decrement the counter by (e.g., 1 to increment by one).
Sample Rate A number between 0 and 1 representing the sample rate to apply when sending the metric.
Tags Comma-separated tags to associate with the metric, formatted as tag1:value1,tag2:value2.

Output

The node outputs an array of items corresponding to the input items. Each output item contains the original JSON data plus additional fields indicating the result of the DataDog operation:

  • dataDogSuccess: Boolean indicating if the metric was sent successfully.
  • dataDogResource: The resource type used ("metric").
  • dataDogTarget: The host and port of the DataDog agent targeted.
  • dataDogTimestamp: ISO timestamp of when the metric was sent.
  • dataDogError (if any): Error message if sending failed.

No binary data is produced by this node.

Dependencies

  • Requires a configured DataDog agent accessible via UDP at a specified host and port.
  • Needs an API key credential for authentication (configured in n8n credentials).
  • Uses the hot-shots library internally to communicate with DataDog over StatsD.
  • Node configuration requires specifying the DataDog host, port, prefix, environment, and global tags.

Troubleshooting

  • Connection Timeout: If the node times out connecting to DataDog, verify network connectivity, UDP port accessibility, and that the DataDog agent is running and correctly configured.
  • Socket Errors: Socket errors indicate issues sending metrics; check the DataDog agent logs and network policies.
  • Operation Timeouts: Sending metrics may timeout after 3 seconds; ensure the DataDog agent is responsive.
  • Invalid Operation: Using unsupported operations will throw an error; confirm the operation is one of the supported metric types.
  • Tag Formatting: Incorrect tag formatting can cause unexpected behavior; tags must be comma-separated key:value pairs.

Links and References

Discussion