Telegraf#

Notice: On April 27th 2023, InfluxData announced they rotated their Linux signing keys for telegraf on Linux. If you installed Telegraf using the Observe linux monitoring configuration script prior to January 27, 2023, or manually installed telegraf, your existing installation continues to function, however upgrading to future releases of Telegraf requires you to update the signing keys as descibed here.

Telegraf provides a server agent for forwarding metrics, logs, and events, and accepts data from a variety of sources through input plugins and forwards them to other destinations with output plugins.

Send data to Observe using the Telegraf HTTP output plugin and JSON data.

Note

For logs and events, Observe recommends Filebeat, Fluent Bit, or fluentd. But you may use an appropriate option for your environment.

Installation#

If you do not currently use Telegraf, see Get started with Telegraf in the Telegraf documentation for installation details.

To install on a Kubernetes cluster, InfluxData recommends using the InfluxData Helm Charts.

Configuration#

  1. Configure the HTTP output plugin.

  2. Add the following output configuration to your telegraf.conf file, where OBSERVE_CUSTOMER and OBSERVE_TOKEN are environment variables containing your customer ID and ingest token.

    [[outputs.http]]
      url = "https://${OBSERVE_CUSTOMER}.collect.observeinc.com/v1/http/telegraf"
      data_format = "json"
      content_encoding = "gzip"
    
      [outputs.http.headers]
        Authorization = "Bearer ${OBSERVE_TOKEN}"
        Content-Type = "application/json"
        X-Observe-Decoder = "nested"
    
  3. Configure input plugins.

If needed, configure the appropriate Telegraf input plugin so Telegraf can forward data from the original sources.

For example, to forward metrics from servers that expose a Prometheus metrics endpoint, use the Prometheus input plugin:

[[inputs.prometheus]]
  ## An array of urls to scrape metrics from.
  urls = ["http://localhost:9100/metrics"]

Replace 9100 with the port number for your Prometheus metrics endpoint/exporter.

4. Troubleshooting Telegraf configurations

To debug Telegraf inputs or outputs, see Troubleshoot Telegraf in the Telegraf documentation.