Skip to main content

Connect Telegraf

Send Telegraf metrics to Nightingale with HTTP output and Prometheus Remote Write, then verify the stored data.

Last reviewed

By the end of this page, your existing Telegraf will write metrics to the store used by Nightingale. The example targets Telegraf 1.36.3 and Nightingale v9. Nightingale writes received metrics to its embedded TSDB or a configured external store.

Telegraf or Categraf?​

Both are MIT-licensed agents written in Go, and Nightingale accepts metrics from either. The differences that matter in practice:

TelegrafCategraf
Plugins300+ inputs, plus processors and many outputs90+ inputs covering operating systems, databases, middleware, network gear and Kubernetes
How it sends to Nightingaleoutputs.http with data_format = "prometheusremotewrite" (configured below)Prometheus Remote Write by default
Hosts list in NightingaleDoes not send Nightingale's heartbeatSends a heartbeat every 10 s with host metadata that fills Infrastructure → Hosts
Built-in dashboards and rulesA few templates include Telegraf rule groups (Linux, for example)Many integration templates ship a Categraf rule group and Categraf dashboards
Metric namesTelegraf plugin naming, for example cpu_usage_activeSeveral host plugins use the same names, so some rules work for both

Keep Telegraf if it is already deployed or you rely on plugins Categraf does not have; nothing about alerting in Nightingale requires switching. Choose Categraf for new hosts when you want the host list and the bundled dashboards and alert rules to work without rewriting metric names. The two can run side by side during a migration.

Before you start​

  • Nightingale is running and reachable from the Telegraf host on port 17000.
  • [HTTP.APIForAgent].Enable is true.
  • Choose the embedded TSDB or configure an external writer.

Keep your existing Telegraf installation. For a new installation, use the official instructions rather than the old 1.20.4 download script.

Configure the output​

Merge this into telegraf.conf and replace the URL. outputs.http is the output plugin; prometheusremotewrite is its serialization format.

[agent]
interval = "15s"
flush_interval = "15s"

[[outputs.http]]
url = "http://127.0.0.1:17000/prometheus/v1/write"
method = "POST"
data_format = "prometheusremotewrite"
[outputs.http.headers]
Content-Type = "application/x-protobuf"
Content-Encoding = "snappy"
X-Prometheus-Remote-Write-Version = "0.1.0"

[[inputs.cpu]]
percpu = false
totalcpu = true
collect_cpu_time = false
report_active = true

[[inputs.mem]]

If Nightingale configures [HTTP.APIForAgent.BasicAuth], add matching username and password inside [[outputs.http]], before its headers table. Leave them out when authentication is disabled.

Review any default InfluxDB output already enabled in the file; an unrelated failing output can obscure the result. OpenTSDB remains a compatibility protocol, but its metric names differ. Check existing dashboards when switching formats.

Verify collection and delivery​

telegraf --config /etc/telegraf/telegraf.conf --test
telegraf --config /etc/telegraf/telegraf.conf --once

Expected result: --test shows CPU and memory samples; --once performs collection and delivery without authentication, routing or connection errors. --test alone does not test delivery.

In Nightingale's metrics explorer, select the destination store and query cpu_usage_active. You should see series with Telegraf tags. Then restart the existing service. An installation with the official systemd unit can use sudo systemctl restart telegraf.

Telegraf does not send Categraf heartbeat metadata. Receiving metrics does not grant the same target-registration or self-healing capabilities. See the 1.36.3 format documentation for Histogram and Summary batching limitations.

Next​