community / community.general / 8.5.0 / module / statsd Send metrics to StatsD | "added in version" 2.1.0 of community.general" Authors: Mark Mercado (@mamercad)community.general.statsd (8.5.0) — module
Install with ansible-galaxy collection install community.general:==8.5.0
collections: - name: community.general version: 8.5.0
The C(statsd) module sends metrics to StatsD.
For more information, see U(https://statsd-metrics.readthedocs.io/en/latest/).
Supported metric types are V(counter) and V(gauge). Currently unupported metric types are V(timer), V(set), and V(gaugedelta).
- name: Increment the metric my_counter by 1 community.general.statsd: host: localhost port: 9125 protocol: tcp metric: my_counter metric_type: counter value: 1
- name: Set the gauge my_gauge to 7 community.general.statsd: host: localhost port: 9125 protocol: tcp metric: my_gauge metric_type: gauge value: 7
host: default: localhost description: - StatsD host (hostname or IP) to send metrics to. type: str port: default: 8125 description: - The port on O(host) which StatsD is listening on. type: int delta: default: false description: - If the metric is of type V(gauge), change the value by O(delta). type: bool state: choices: - present default: present description: - State of the check, only V(present) makes sense. type: str value: description: - The value of the metric. required: true type: int metric: description: - The name of the metric. required: true type: str timeout: default: 1.0 description: - Sender timeout, only applicable if O(protocol) is V(tcp). type: float protocol: choices: - udp - tcp default: udp description: - The transport protocol to send metrics over. type: str metric_type: choices: - counter - gauge description: - The type of metric. required: true type: str metric_prefix: default: '' description: - The prefix to add to the metric. type: str