Overview

Deploy this integration to install and launch Telegraf on the dynos of your Heroku app. This integration buildpack downloads the latest Telegraf release, extracts it on your dyno and starts it via a .profile.d script.

Configuring Telegraf to send your Heroku app metrics to Logz.io

Before you begin, you’ll need:

All commands in these instructions should be run from your Heroku app directory.

Download the Telegraf configuration file

wget -O telegraf.conf https://raw.githubusercontent.com/logzio/heroku-buildpack-telegraf/master/telegraf.conf

Enable environment variable

heroku labs:enable runtime-dyno-metadata -a <<HEROKU_APP_NAME>>

heroku config:set LOGZIO_LISTENER=https://<<LISTENER-HOST>>:8053   

heroku config:set LOGZIO_TOKEN=<<PROMETHEUS-METRICS-SHIPPING-TOKEN>>

git add .

git commit -m "Telegraf config" 

git push heroku main

Replace the placeholders to match your specifics. (They are indicated by the double angle brackets << >>):

  • Replace <<PROMETHEUS-METRICS-SHIPPING-TOKEN>> with a token for the Metrics account you want to ship to.
    Here’s how to look up your Metrics token.
  • Replace <<LISTENER-HOST>> with the Logz.io Listener URL for your region, configured to use port 8052 for http traffic, or port 8053 for https traffic. For example, listener.logz.io if your account is hosted on AWS US East, or listener-nl.logz.io if hosted on Azure West Europe.
  • Replace <<HEROKU_APP_NAME>> with the name of your Heroku app
Add the buildpack to the list of your Heroku buildpacks

heroku buildpacks:add --index 1 https://github.com/logzio/heroku-buildpack-telegraf.git

git commit --allow-empty -m "Rebuild slug"

git push heroku main

Check Logz.io for your metrics

Give your data some time to get from your system to ours, then log in to your Logz.io Metrics account, and open the Logz.io Metrics tab.