Hosted Graphite Docs
Get StartedBook a Demo
  • Welcome to Hosted Graphite
  • Getting Started
  • HG-CLI
  • Sending Metrics
    • Supported Protocols
    • Graphite Tag Support
    • Metric Management
    • Metric APIs
  • Language Guide
    • Metric Libraries
    • .NET
    • Go
    • Java
    • Javascript
    • Node.js
    • PHP
    • Postman
    • Python 2.x
    • Python 3.x
    • Python Pickle
    • Ruby
    • Shell
    • TypeScript
  • Dashboard and Graphs
    • Primary Dashboards
    • Dashboard Library
    • Local Dashboard Integration
    • Worldmap Panel
    • Graphite Dashboard Guide
    • Graphite Graph Menu Reference
    • Other Dashboard Options
  • Alerting Guide
    • Alerting Overview
    • Alerts API
    • Notification Channels API
    • Scheduled Mutes API
    • Using Your Own Alerting
  • Agents Guide
    • The Hosted Graphite Agent
      • Base Metrics
      • System Layout
    • Telegraf
    • K8 Telegraf Daemon
    • OpenTelemetry
    • collectd Agent
    • StatsD Agent
    • Diamond
  • Add-Ons and Integrations Guide
    • AWS CloudWatch
    • Azure Monitor Metrics
    • GCP Metrics
    • Carbon-C-Relay
    • Circle CI
    • Cloudbees
    • Collectd Add Ons
    • GitHub
    • GitLab
    • Heroku
    • Hosted StatsD
    • New Relic
    • Papertrail
    • Pingdom
    • Sentry
    • Sitespeed
    • StatsD Add-on
    • Statuspage
  • Account Management
    • Access Keys
    • Account Diagnostics
    • Account Settings
    • Team Access: Limited Access Groups
    • SAML Authentication
    • Team Access
  • Additional Features
    • Aggregation Rules
    • Data Views
  • API Guides
    • Metrics API
    • Tag API
    • Graphite Render API
    • Render Variables API
    • Dashboard API
    • Annotations and Events API
    • Aggregation Rules API
    • Alerts APIs
  • FAQ
    • General
    • Business
    • Technical
    • Account Metrics and Limiting
    • Customization
    • Troubleshooting
    • Support
    • Changelog
Powered by GitBook
On this page
  • Installing the Hosted Graphite Heroku Add-On
  • Heroku Auto-Dashboard
  • Heroku Add-On Metrics
  • Custom Metrics
  • Router Path Metrics
  • Router Aggregates
  • Heroku Event Annotations
  • Monitoring Heroku Metrics on an Existing HG Account

Was this helpful?

  1. Add-Ons and Integrations Guide

Heroku

Monitor your Heroku Apps with Hosted Graphite.

PreviousGitLabNextHosted StatsD

Last updated 18 days ago

Was this helpful?

Contents:

heroku addons:create hostedgraphite -a <app-name>

Make sure to replace the variable <app-name> with the name of your application, as it appears in your Heroku account. Once the add-on is installed, a new application configuration key will be created, called HOSTEDGRAPHITE_APIKEY. Confirm the key by issuing this command:

heroku config:get HOSTEDGRAPHITE_APIKEY -a <app-name>

You can now navigate to your new account by clicking on the Hosted Graphite add-on link in the Heroku UI, and wait for the metrics to appear.

  • Load average - 1/5/15-minute averages

  • Memory and Swap - Resident memory, disk cache, swap, total memory, and cumulative totals for pages written to/read from disk.

  • HTTP metrics - The number of requests broken down by HTTP method and status codes, data transferred, and connect/service times.

Troubleshooting: If you are not receiving the web dyno metrics (web/cpu/mem), you likely need to enable log-runtime metrics for your Heroku app. Log into your Heroku CLI and run the following commands:

heroku labs:enable log-runtime-metrics -a <app-name>
heroku restart -a <app-name>
heroku config -s | grep HOSTEDGRAPHITE_APIKEY >> .env -a <app-name>
more .env

More information on accessing your API key is detailed in the below section.

apikey = ENV['HOSTEDGRAPHITE_APIKEY']
apikey = os.environ['HOSTEDGRAPHITE_APIKEY']
String apikey = System.getenv("HOSTEDGRAPHITE_APIKEY");
$apikey = getenv('HOSTEDGRAPHITE_APIKEY');
var apikey = process.env.HOSTEDGRAPHITE_APIKEY;

If you enable the Path Metrics feature in the Heroku Config, we will collect and forward router statistics (connection times, request methods/statuses) per path in your Heroku application. This will increase the total number of metrics being stored in the Hosted Graphite backend, but will give you increased visibility into activity within your app, and a higher level of alerting functionality.

We offer these metrics in a dot.notation.format, or an underscore_format giving you the option to choose the metric cardinality that works best for you:

heroku.<appname>.<host>.router.<path(url.com.sub-path)>.<rest_of_metric>

or

heroku.<appname>.<host>.router.<path(url_com_sub-path)>.<rest_of_metric>

If you have Path Metrics enabled, but experience a high cardinality of metrics due to unique identifiers being created in your app's URLs, our Router Aggregates feature will combine these values to reduce your metric overhead. For example, lets say your app generates endpoints with ID placeholders for a customer each time a route is accessed: "GET /api/path/<placeholder-id>"

This could create a lot of unique heroku router metrics in your account and you might be better of receiving only 1 metric with a combined value. Simply define a path with the variable in curly brackets {placeholder-id} to combine multiple metrics into one! NOTE: Path metrics must first be enabled in your HG account, and you can define as many Router Aggregate paths as you like.

We also provide a convenient webhook that you can upload to your Heroku account and import real-time Heroku events to your Hosted Graphite account:

Its easy to forward your log drain metrics to an existing Hosted Graphite account. This is actually a better value because a dedicated HG account allows you to configure multiple heroku apps, get the full 2 year data retention, and premium level support for the same price as the Heroku add-on.

First, you will need to make sure the Heroku ‘appname format’ is enabled if you wish to include your appname in the metric naming scheme (recommended). Navigate to Add-Ons => Heroku, and confirm that the checkbox is checked.

heroku labs:enable log-runtime-metrics -a <app-name>

Then, after enabling runtime metrics, you need to restart your Heroku application:

heroku restart -a <app-name>

Finally, you can just point the Heroku app logs to your existing Hosted Graphite account by running the following command:

heroku drains:add https://webhooks.hostedgraphite.com/heroku/<app-name>/logs/\?apikey=<your-api-key> -a <app-name>

NOTE: To avoid any duplicate metrics, make sure to enable both the 'appname format' checkbox in the Add-Ons UI, and include the appname in the above drains:add command. You are able to ship metrics from as many Heroku apps as you like, but it takes about 15 minutes for all of the metrics to appear for the first time.

Hosted Graphite has a ! Installing the add-on can be done through the UI of your Heroku account in the ‘Resources’ section, or by issuing the following command in your Heroku CLI:

For more documentation around our Heroku Add-On, please visit the page.

This dashboard will be automatically created when you enable the Heroku Add-On, or configure Log-Drain metrics to your .

Using Heroku’s we retrieve and process Heroku’s syslog information for your Dynos including:

If you use the Heroku at the standard or premium tier, these metrics will automatically be forwarded to your Hosted Graphite account. They are prefixed with: heroku.<app-name>.heroku-postgres.<instance-name>.<type> and report dyno statistics for cpu load, memory, db_size, tables, active/waiting-connections, tmp-disk-available/used, read/write operations, and more!

We also have a handy Heroku Postgres dashboard that is available in our .

If you use the Heroku at any tier, these metrics will be automatically forwarded to your Hosted Graphite account. They are prefixed with: heroku.<app-name>.heroku-redis.<instance-name>.<type> and report dyno statistics for load, memory, reads/writes, connections, and more!

We also have a Heroku Redis dashboard that is available in our .

If you use the Heroku at the Standard tier or above, these metrics will automatically forward to your Hosted Graphite account. They are prefixed with: heroku.<app-name>.heroku-kafka.<node>.<instance-name>.<type> and report per-node statistics for load, memory, reads/writes, operations, and more!

We also have a Heroku Kafka dashboard that is available in our .

In your local development environment, it will be necessary to replicate the above configuration. Since the will look in the .env file for development environment variables, use the following command to copy the HOSTEDGRAPHITE_APIKEY from the Heroku config (Do not check the file .env into source control).

Now that the add-on has been set up, the Hosted Graphite will be available via the environment variable HOSTEDGRAPHITE_APIKEY. See the appropriate language snippet below for an example of how to access this variable in your app.

Ruby See also:

Python See also:

Java See also:

PHP See also:

Node.js See also:

You can also send custom application metrics to your Hosted Graphite account. We provide code snippets in our that can be configured throughout the codebase of your Heroku app to send Graphite metrics through a socket connection. Custom metrics can be tailored to track anything you want in your app like logins, sign ups, or cancellations.

Check out our on configuring a custom StatsD metric to report an event from your Heroku app => to your Hosted Graphite account.

If left on the 'default' metric format, you will receive the standard router metrics giving you a good overview of the activity within your Heroku app. The default router metrics are what can be seen on your .

Once you have added the webhook into your Heroku account, you can configure on your dashboards to display events from your Heroku environment around deployments, builds, domains, collaborators, add-ons, and more!

Next, you will need to enable by running the following command in your Heroku CLI:

Installing the Hosted Graphite Heroku Add-On
Heroku Add-On
Hosted Graphite on Heroku
Heroku Auto-Dashboard
existing Hosted Graphite account
Log-Runtime metrics
Heroku Add-On Metrics
Postgres add-on
Dashboard Library
Redis add-on
Dashboard Library
Kafka add-on
Dashboard Library
Local Development Configuration
Foreman tool
Accessing the API Key Within Your App
API Key
Sending Metrics with Ruby
Sending Metrics with Python
Sending Metrics with Java
Sending Metrics with PHP
Sending Metrics with Node.js
Custom Metrics
language guide
video tutorial
Router Path Metrics
Heroku Auto Dashboard
Router Aggregates
Heroku Event Annotations
annotations
Monitoring Heroku Metrics on an Existing HG Account
Log-Runtime metrics
Installing the Hosted Graphite Heroku Add-On
Heroku Auto-Dashboard
Heroku Add-On Metrics
Local Development Configuration
Accessing the API Key Within Your App
Custom Metrics
Router Path Metrics
Router Aggregates
Heroku Event Annotations
Monitoring Heroku Metrics on an Existing HG Account
Heroku Video Tutorial
Access your new HG account
Heroku Auto Dashboard
Heroku Postgres Dashboard
Heroku Redis Dashboard
Heroku Kafka Dashboard
Heroku Path Metrics
Heroku Router Aggregates
Heroku Webhook
Heroku Annotations
Heroku Integration