telegraf
Installation
SKILL.md
Telegraf
Overview
Set up Telegraf to collect, process, and forward metrics from systems, databases, and applications. Covers input/output plugin configuration, metric filtering, aggregation processors, and deployment patterns.
Two behaviours matter on current releases (1.38 and later):
- Strict environment-variable handling is the default.
$VARand${VAR}are substituted only inside quoted string values; a variable that is not set is not reported:${NAME}stays as literal text (or the value ends up empty), so write${NAME:?NAME is required}for anything mandatory, and a literal$must be written$$. Start with--non-strict-env-handlingonly as a stop-gap. fieldpass/fielddropare deprecated. Usefieldinclude/fieldexclude;namepass,namedrop,tagpass,tagincludeand friends are unchanged.
Install with the vendor's apt/yum repository (package telegraf, config in /etc/telegraf/) or run the telegraf Docker image (see Task F). Validate before every deploy:
telegraf --config /etc/telegraf/telegraf.conf --config-directory /etc/telegraf/telegraf.d --test # one gather, prints line protocol, writes nothing