Over a million developers have joined DZone.

Listening to What Your Heroku Postgres Logs are Telling You

· Performance Zone

Evolve your approach to Application Performance Monitoring by adopting five best practices that are outlined and explored in this e-book, brought to you in partnership with BMC.

[This article was written by Matt Kiernan]

Debugging in development can be challenging enough when dealing with just your application layer. In production, the root cause of an issue could be hiding within one of several locations, including your database.Heroku Postgres

One of the many great things about Heroku is how well it incorporates different types of events into its own logs.

When tailing Heroku logs, you can see events from not only Heroku, but also your application and database. And Postgres is the most popular database used on Heroku, for good reason.

The two services work together seamlessly and can be set-up in seconds. But tailing logs, especially when log events are coming from different services, can become cumbersome and difficult to analyze.

Today, we’re happy to announce the launch of our latestLogentries Community Pack for Heroku and Postgres users, offering pre-configured queries, tags and dashboards specifically built for interpreting Heroku Postgres logs. Here are three specific use cases for how the Logentries Heroku Postgres Community Pack can come in handy:

Unoptimized Queries

Whether you’re missing a necessary index or inadvertently built an N+1 query into your code, unoptimized queries can slow and even take down the fastest databases. The Heroku Postgres Community Pack includes both graphs for average query time and tags identifying queries taking longer than 50ms or 2 seconds on Postgres 9.2+.

Connection Limits

Heroku purposefully sets a limit on the number of connections you can make to your postgres database in an effort to preserve performance. Knowing things like when a user has too many connections or when you’ve reached your connection limit can be crucial to keeping things running smoothly. The Heroku Postgres Community Pack includes a series of tags for understanding what’s happening with your Postgres connections and indicating when it may be time to upgrade your Heroku Postgres plan.

FATAL, WARNING & ERROR Messages

Some log events carry more weight than others. While warning messages may be caused by harmless events, FATAL messages are indicating an error that caused the current session to abort. Understanding if there are larger trends behind the frequency of critical events can be be the difference between catching a hidden underlying issue and finding out about the issue once its too late. The Heroku Postgres Community Pack includes saved queries and charts for comparing the frequency of FATAL, WARNING & ERROR messages to reveal possible trends.

If you’ve come to expect the simple, plug and play nature of Heroku add-ons, the Logentries Heroku Postgres Community pack will not disappoint.

Using the pack is as simple as downloading it from the Logentries Community and uploading it to your Logentries account.

Click here to download the Heroku Postgres Community Pack.

Learn tips and best practices for optimizing your capacity management strategy with the Market Guide for Capacity Management, brought to you in partnership with BMC.

Topics:

Published at DZone with permission of Trevor Parsons, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}