The configuration of the Telegraf agent is stored in the telegraf
section
of the Reclass model.
To configure Telegraf:
Log in to the Salt Master node.
Configure the telegraf
section in the
classes/cluster/cluster_name/init.yml
file of the Reclass model as
required.
Apply the Salt formula:
salt -C 'I@linux:system' state.sls telegraf
Example configuration:
telegraf:
agent:
enabled: true
interval: 15
round_interval: false
metric_batch_size: 1000
metric_buffer_limit: 10000
collection_jitter: 2
output:
prometheus_client:
bind:
address: 0.0.0.0
port: 9126
engine: prometheus
In the example above, the Reclass model is converted to a configuration file
recognized by Telegraf. For details about options, see the
Telegraf documentation and
the */meta/telegraf.yml
file in every Salt formula.
The input
and output
YAML dictionaries contain a list of defined inputs
and outputs for Telegraf. To add input
or output
parameters to
Telegraf, use the same format as used in */meta/telegraf.yml
of the
required Salt formula.
However, this should be performed only by deployment engineers or developers.