Heroku Postgres Monitoring

September 18, 2026

Heroku Postgres Monitoring: What You Need to Know

Heroku Postgres takes care of a lot of the operational work that comes with running PostgreSQL, but you still need visibility into what your database is doing. A slow query, growing connection count, or increase in disk I/O can affect your app long before the database actually becomes unavailable.

The good news is that Heroku exposes a useful set of database and server metrics that can help you catch these problems early. In this post, we'll look at:

  • Key metrics for Heroku Postgres monitoring
  • Tools for investigating Postgres performance
  • Collecting and monitoring Heroku Postgres metrics with Hosted Graphite

If you're using a Standard or Premium Heroku Postgres database, the Hosted Graphite add-on automatically collects supported Postgres metrics from your Heroku logs. These metrics are available alongside your dyno and application metrics, so you can monitor your database and the rest of your Heroku app from the same Grafana dashboards.

The Heroku Hosted Graphite monitoring add-on will automatically pull in your Heroku metrics and build dashboards for you. You'll see your Heroku dashboards after logging into the add-on:

Heroku postgres dashboard

Key metrics for Heroku Postgres monitoring

Heroku Postgres metrics generally fall into two groups: database metrics and server metrics.

  • Database metrics tell you what's happening inside PostgreSQL. These include database size, active and waiting connections, transaction activity, table counts, and cache hit rates.
  • Server metrics tell you what's happening underneath the database. These include system load, memory usage, read/write IOPS, temporary disk usage, and WAL utilization.

You don't necessarily need to stare at every metric all day. A few are especially useful when you're trying to understand whether your database is healthy. For example, active-connections tells you how many connections are currently established. A sudden increase can indicate slower queries or transactions keeping connections open longer than normal. waiting-connections is even more interesting: connections waiting on locks can point directly to database contention.

Cache hit rates give you another useful performance signal. index-cache-hit-rate and table-cache-hit-rate show how often Postgres can satisfy lookups from its shared buffer cache rather than needing to retrieve the data elsewhere.

On the server side, load-avg-1m, load-avg-5m, and load-avg-15m help identify sustained resource pressure, while read-iops and write-iops show how much work is hitting disk. Taken together, these metrics can tell a much more useful story than simply asking whether Postgres is "up."

‍

Heroku Postgres monitoring tools

Heroku gives you several useful tools for investigating Postgres, and they work best together rather than as replacements for one another.

The Heroku CLI is useful when you need to inspect something right now. For example, you can use Heroku Postgres CLI commands to look at active queries, connections, database information, and other current activity. Heroku also maintains the heroku-pg-extras CLI plugin, which provides commands for investigating common database performance problems. If a graph suddenly shows an increase in connections or load, tools like pg-extras can help you dig further into what's actually happening inside the database.

For ongoing monitoring, Hosted Graphite gives you the historical side of the picture. Instead of checking the database manually whenever something goes wrong, you can graph the Heroku Postgres metrics over time, compare them against the rest of your application, and alert on conditions you care about.

This becomes especially useful when troubleshooting something like a performance spike. You might see database load increase at the same time as write-iops, while your application metrics show increased traffic. Or you might see waiting-connections climb without a corresponding traffic increase, giving you a good reason to start looking for locks or expensive queries.

The Hosted Graphite add-on also collects metrics for other parts of your Heroku application, including web and worker processes, which makes it easier to correlate database behavior with what's happening elsewhere in the app.

Collecting and using Heroku Postgres metrics

Simply provision the Heroku Hosted Graphite Add-on and open the app by running these 2 commands from within your Heroku CLI:

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

‍

Once the add-onis connected to your Heroku app, Heroku Postgres metrics from Standard and Premium databases are automatically forwarded to your HG account. Postgres metrics use the following naming structure: heroku.<app-name>.heroku-postgres.<instance-name>.<type>

‍

Database metrics include:

  • active-connections
  • current_transaction
  • db_size
  • index-cache-hit-rate
  • table-cache-hit-rate
  • tables
  • waiting-connections

Server metrics include:

  • load-avg-15m
  • load-avg-1m
  • load-avg-5m
  • memory-cached
  • memory-free
  • memory-postgres
  • memory-total
  • read-iops
  • tmp-disk-available
  • tmp-disk-used
  • wal-percentage-used
  • write-iops

‍

This naming structure also makes the metrics easy to query together in Graphite. For example, you can build a Grafana panel around connection activity and compare active-connections with waiting-connections, or graph the different load averages together to see whether a spike is temporary or sustained.

Heroku Postgres connections

‍

You can then use the same metrics for configuring service-level alerts with multiple AND / OR conditions. For example, a sustained increase in waiting-connections is worth investigating because it can indicate lock contention. High read-iops combined with falling cache hit rates can point toward increased disk activity. And increasing tmp-disk-used gives you visibility into temporary disk consumption before it becomes a larger problem.

Hosted Graphite Composite alerting

Heroku also recommends monitoring database size, connection utilization, system load, IOPS, and WAL utilization, with alert thresholds based on your database plan and normal application behavior. The result is a fairly simple workflow: Heroku produces the Postgres metrics, Hosted Graphite collects them, and Grafana gives you a place to visualize and alert on them alongside the rest of your Heroku application.

‍

Conclusion

Heroku manages the Postgres infrastructure for you, but that doesn't mean the database should be a black box. Metrics like active and waiting connections, cache hit rates, system load, memory usage, and read/write IOPS give you a much better idea of how your database is behaving and where to start looking when performance changes.

If you're running a Standard or Premium Heroku Postgres database, Hosted Graphite automatically collects supported Postgres metrics and makes them available alongside your other Heroku metrics. From there, you can graph them in Grafana, build alerts around the metrics that matter to your app, and correlate database behavior with what's happening across the rest of your Heroku environment.

Install the Hosted Graphite Heroku add-on to start monitoring your Heroku Postgres metrics today!

Try Hosted Graphite now!

Get Hosted Graphite free for 14 days. No credit card required.

Get Started

Benjamin Pitts

Software and Sales Engineer for MetricFire's Hosted Graphite

Related Posts

No items found.

See why thousands of engineers trust Hosted Graphite with their monitoring

START A FREE TRIAL