community.general.statsd module – Send metrics to StatsD
Note
This module is part of the community.general collection (version 10.7.5).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.general.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.general.statsd.
New in community.general 2.1.0
Synopsis
- The - statsdmodule sends metrics to StatsD.
- For more information, see https://statsd-metrics.readthedocs.io/en/latest/. 
- Supported metric types are - counterand- gauge. Currently unupported metric types are- timer,- set, and- gaugedelta.
Requirements
The below requirements are needed on the host that executes this module.
- statsd 
Parameters
| Parameter | Comments | 
|---|---|
| StatsD host (hostname or IP) to send metrics to. Default:  | |
| The name of the metric. | |
| The prefix to add to the metric. Default:  | |
| The type of metric. Choices: 
 | |
| The port on  Default:  | |
| The transport protocol to send metrics over. Choices: 
 | |
| State of the check, only  Choices: 
 | |
| Sender timeout, only applicable if  Default:  | |
| The value of the metric. | 
Attributes
| Attribute | Support | Description | 
|---|---|---|
| Support: none | Can run in  | |
| Support: none | Will return details on what has changed (or possibly needs changing in  | 
Examples
- 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
