Telegraf

Telegraf is a server agent for forwarding metrics, logs, and events. It accepts data from a variety of sources via 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, we recommend Filebeat, Fluent Bit, or fluentd. But you may use whichever option is appropriate for your environment.

Installation

If you are not already using Telegraf, see Get started with Telegraf in the Telegraf documentation for installation details.

Configuration

  1. Configure the HTTP output plugin

    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://collect.observeinc.com/v1/http/telegraf"
    
      username = "${OBSERVE_CUSTOMER}"
      password = "${OBSERVE_TOKEN}"
    
      data_format = "json"
      content_encoding = "gzip"
    
      [outputs.http.headers]
        Content-Type = "application/json"
        X-Observe-Decoder = "nested"
    

    You may also provide the customer ID and token as strings instead:

    username = "12345"
    password = "my_ingest_token"
    
  2. Configure input plugins

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

  3. Troubleshooting Telegraf configurations

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