Actions5
- Metric Actions
Overview
This node sends metrics, events, and service checks to DataDog using the StatsD protocol. Specifically for the Metric - Gauge operation, it sets a gauge metric in DataDog with a specified value. Gauges represent a snapshot of a value at a point in time, useful for tracking things like current memory usage, temperature, or queue length.
Common scenarios include monitoring system performance metrics, application-specific values, or any real-time measurement that can fluctuate up or down. For example, you might use this node to send the current number of active users or CPU utilization percentage to DataDog for visualization and alerting.
Properties
Name | Meaning |
---|---|
Metric Name | The name of the metric to send to DataDog (e.g., system.cpu.usage ). |
Value | The numeric value to set for the gauge metric (e.g., 75 for 75% CPU usage). |
Sample Rate | A decimal between 0 and 1 indicating the fraction of data points to send (e.g., 1 means all). |
Tags | Comma-separated tags to apply to the metric in the format tag1:value1,tag2:value2 . These help categorize and filter metrics in DataDog. |
Output
The node outputs an array of items corresponding to each input item processed. Each output item contains the original input JSON plus additional fields under json
:
dataDogSuccess
: Boolean indicating if the metric was sent successfully.dataDogResource
: The resource type used (metric
).dataDogTarget
: The target DataDog host and port (e.g.,hostname:8125
).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 a configured API key credential for authenticating with DataDog's StatsD endpoint.
- Needs network access to the DataDog StatsD agent host and UDP port.
- Uses the
hot-shots
npm package internally to communicate via StatsD protocol. - Node configuration requires specifying the DataDog host, port, prefix, environment, and global tags.
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 and listening on the specified UDP port.
- Socket Errors: Socket errors during communication are logged and cause the node to fail. Verify the DataDog agent configuration and network policies.
- Operation Timeout: Sending a metric times out after 3 seconds if no response is received. This may indicate network issues or agent unavailability.
- Invalid Operation: If an unsupported metric operation is selected, the node throws an error.
- Tag Formatting: Tags must be comma-separated and formatted as
key:value
. Incorrect formatting may cause metrics to be rejected or misclassified. - Missing Required Fields: Omitting required properties like Metric Name or Value will cause validation errors.