Telegraf는 서버 기반 agent로 데이터베이스, 시스템 및 IoT 센서에서 메트릭 및 이벤트를 수집/전송할 수 있는 오픈소스이다.
최근 centOS 서버의 메트릭을 수집하는 용도로 적용했는데, 설치 및 설정이 매우 간단하며 telegraf에서 다양한 플러그인을 제공하고 있다.
설치는 https://portal.influxdata.com/downloads/를 참고한다.
docker image부터 각 패키지 설치 및 바이너리 설치 가이드가 나와있다.
$ sudo yum install -y telegraf
telegraf.conf에 수집할 메트릭과 전송할 플러그인 등을 설정하고 실행하면 된다.
플러그인 적용은 https://docs.influxdata.com/telegraf/v1.23/plugins/ 를 참고하면 된다.
[[outputs.http]]
url = "http://127.0.0.1:8080/telegraf"
timeout = "5s"
method = "POST"
data_format = "json"
[outputs.http.headers]
Content-Type = "application/json"
$ telegraf --config telegraf.conf