DataDog icon

DataDog

Send metrics, logs and events to DataDog using StatsD protocol

Overview

This node sends metrics, events, and service checks to DataDog using the StatsD protocol. Specifically for the Metric - Distribution operation, it tracks the global statistical distribution of a set of values by sending distribution-type metrics to DataDog.

Typical use cases include monitoring application performance, tracking custom business metrics, or aggregating statistical data such as response times, latencies, or other numeric measurements that benefit from distribution analysis.

For example, you might send a distribution metric representing the response time of an API endpoint to analyze its latency distribution over time in DataDog.

Properties

Name Meaning
Metric Name The name of the metric to send to DataDog.
Value The numeric value of the metric to record (e.g., a measurement or count).
Sample Rate A number between 0 and 1 indicating the fraction of events to sample (e.g., 0.5 = 50%).
Tags Comma-separated tags to apply to the metric, formatted as tag1:value1,tag2:value2. These help categorize and filter metrics in DataDog.

Output

The node outputs the original input items enriched with additional JSON 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 DataDog host and port the metric was sent to.
  • dataDogTimestamp: ISO timestamp when the metric was sent.
  • dataDogError (only on failure): Error message describing why sending failed.

No binary data is output by this node.

Dependencies

  • Requires an active connection to a DataDog StatsD server (host and port configured via credentials).
  • Needs an API key credential for authentication (configured in n8n credentials).
  • Uses the hot-shots npm package internally to communicate with DataDog over UDP.
  • The DataDog agent must be running and accessible at the specified host and port.
  • Network policies must allow UDP traffic to the DataDog StatsD port.

Troubleshooting

  • Connection Timeout: If the node cannot connect to DataDog within 5 seconds, it throws a timeout error. Check network connectivity, firewall rules, and that the DataDog agent is running.
  • Socket Errors: Socket errors during communication are logged and cause the node to fail. Verify the DataDog host and port settings.
  • Operation Timeout: Sending a metric times out after 3 seconds if no response is received. This may indicate network issues or an unresponsive DataDog agent.
  • Invalid Operation: If an unsupported metric operation is selected, the node throws an error.
  • Tag Formatting: Incorrectly formatted tags (not comma-separated or missing colon) may cause unexpected behavior; ensure tags follow key:value format.
  • Kubernetes Specific: When running in Kubernetes, ensure network policies allow UDP traffic to the DataDog port, DNS resolves the DataDog host correctly, and VPNs do not block traffic.

Links and References

Discussion