community / community.general / 3.8.10 / module / statsd Send metrics to StatsD | "added in version" 2.1.0 of community.general" Authors: Mark Mercado (@mamercad)community.general.statsd (3.8.10) — module
Install with ansible-galaxy collection install community.general:==3.8.10
collections: - name: community.general version: 3.8.10
The C(statsd) module sends metrics to StatsD.
For more information, see U(https://statsd-metrics.readthedocs.io/en/latest/).
Supported metric types are C(counter) and C(gauge). Currently unupported metric types are C(timer), C(set), and C(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 C(host) which StatsD is listening on. type: int delta: default: false description: - If the metric is of type C(gauge), change the value by C(delta). type: bool state: choices: - present default: present description: - State of the check, only C(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 C(protocol) is C(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: description: - The prefix to add to the metric. type: str