# Connect Telegraf

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

Last reviewed 2026-10-11

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?[​](#telegraf-vs-categraf "Direct link to Telegraf or Categraf?")

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

|                               | Telegraf                                                                       | Categraf                                                                                                                              |
| ----------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- |
| Plugins                       | 300+ inputs, plus processors and many outputs                                  | 90+ inputs covering operating systems, databases, middleware, network gear and Kubernetes                                             |
| How it sends to Nightingale   | `outputs.http` with `data_format = "prometheusremotewrite"` (configured below) | Prometheus Remote Write by default                                                                                                    |
| Hosts list in Nightingale     | Does not send Nightingale's heartbeat                                          | Sends a [heartbeat](https://n9e.io/docs/data/categraf/targets.md) every 10 s with host metadata that fills **Infrastructure → Hosts** |
| Built-in dashboards and rules | A few templates include Telegraf rule groups (Linux, for example)              | Many [integration templates](https://n9e.io/integrations.md) ship a Categraf rule group and Categraf dashboards                       |
| Metric names                  | Telegraf plugin naming, for example `cpu_usage_active`                         | Several 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](https://n9e.io/alert-rules.md) to work without rewriting metric names. The two can run side by side during a migration.

## Before you start[​](#before-you-start "Direct link to Before you start")

* Nightingale is running and reachable from the Telegraf host on port 17000.
* `[HTTP.APIForAgent].Enable` is `true`.
* Choose the [embedded TSDB](https://n9e.io/docs/install/embedded-tsdb.md) or configure an [external writer](https://n9e.io/docs/install/external-tsdb.md).

Keep your existing Telegraf installation. For a new installation, use the [official instructions](https://docs.influxdata.com/telegraf/v1/install/) rather than the old 1.20.4 download script.

## Configure the output[​](#configure-output "Direct link to 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[​](#verify "Direct link to 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](https://github.com/influxdata/telegraf/blob/v1.36.3/plugins/serializers/prometheusremotewrite/README.md) for Histogram and Summary batching limitations.

## Next[​](#next "Direct link to Next")

* [Data ingestion protocols](https://n9e.io/docs/reference/write-protocols.md)
* [Create your first alert](https://n9e.io/docs/alerting/first-rule.md)
