community.general.statsd module – Send metrics to StatsD
Note
This module is part of the community.general collection (version 4.8.3).
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
.
To use it in a playbook, specify: community.general.statsd
.
New in version 2.1.0: of community.general
Synopsis
The
statsd
module sends metrics to StatsD.For more information, see https://statsd-metrics.readthedocs.io/en/latest/.
Supported metric types are
counter
andgauge
. Currently unupported metric types aretimer
,set
, andgaugedelta
.
Parameters
Parameter |
Comments |
---|---|
If the metric is of type Choices:
|
|
StatsD host (hostname or IP) to send metrics to. Default: “localhost” |
|
The name of the metric. |
|
The prefix to add to the metric. |
|
The type of metric. Choices:
|
|
The port on Default: 8125 |
|
The transport protocol to send metrics over. Choices:
|
|
State of the check, only Choices:
|
|
Sender timeout, only applicable if Default: 1.0 |
|
The value of the metric. |
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
Authors
Mark Mercado (@mamercad)
Collection links
Issue Tracker Repository (Sources) Submit a bug report Request a feature Communication