Actions5
- Metric Actions
Overview
This node sends metrics to DataDog using the StatsD protocol. It supports sending different types of metrics, including counters, gauges, histograms, distributions, and sets (which count unique occurrences). The node is useful for monitoring applications by reporting custom metrics such as event counts, performance timings, or unique user actions.
For the Metric - Set operation specifically, it counts unique occurrences of events by sending a "set" type metric to DataDog. This can be used to track distinct elements like unique users, sessions, or error codes over time.
Practical example:
- Counting unique visitors on a website by sending their user IDs as values in a set metric.
- Tracking unique error codes returned by an API during a time window.
Properties
Name | Meaning |
---|---|
Metric Name | The name of the metric to send to DataDog. |
Value | The value associated with the metric. For "Set" operation, this represents the unique item. |
Sample Rate | A number between 0 and 1 to apply sampling rate to the metric (e.g., 0.5 means 50% sampled). |
Tags | Comma-separated tags to apply to the metric in the format tag1:value1,tag2:value2 . |
Output
The node outputs the original input data enriched with additional fields in the json
property:
dataDogSuccess
: Boolean indicating if the metric was sent successfully.dataDogResource
: The resource type used ("metric").dataDogTarget
: The target DataDog host and port.dataDogTimestamp
: ISO timestamp when the metric was sent.dataDogError
: Present only if sending failed; contains the error message.
No binary data output is produced by this node.
Dependencies
- Requires a configured connection to a DataDog StatsD server (host and port).
- Needs an API key credential that provides access to the DataDog StatsD endpoint.
- Uses the
hot-shots
library internally to communicate with DataDog via UDP. - The DataDog agent must be running and accessible at the specified host and port to receive metrics.
Troubleshooting
Connection timeout or failure:
If the node cannot connect to DataDog within 5 seconds, it throws a connection timeout error.
Resolution: Verify network connectivity, ensure UDP traffic to the DataDog port is allowed, confirm the DataDog agent is running and reachable.Operation timeout:
Sending a metric times out after 3 seconds.
Resolution: Check DataDog agent responsiveness and network latency.Invalid operation:
If an unsupported metric operation is selected, the node throws an error.
Resolution: Use one of the supported operations: counter, gauge, histogram, distribution, or set.Socket errors:
Socket-level errors are logged and cause the node to fail.
Resolution: Inspect logs for detailed socket error messages and verify DataDog agent configuration.