• Log in
banner-left
Instant ObservabilityPsycopg2
psycopg2

Psycopg2

New Relic’s Psycopg2 quickstart provides valuable visibility into Python applications interfacing with PostgreSQL databases via a series of visual dashboards and alerts that monitor connections, CPU utilization, memory, and more.
Psycopg2
Install now
Install now
banner-right

What's included?

Dashboard  
1
Psycopg2 quickstart contains 1 dashboard. These interactive visualizations let you easily explore your data, understand context, and resolve problems faster.

Psycopg2

Alerts  
4
Psycopg2 observability quickstart contains 4 alerts. These alerts detect changes in key performance metrics. Integrate these alerts with your favorite tools (like Slack, PagerDuty, etc.) and New Relic will let you know when something needs your attention.

Apdex Score

This alert is triggered when the Apdex score is below 0.5 for 5 minutes

High CPU Utilization

This alert is triggered when the CPU Utilization is above 90%.

Memory Usage

This alert is triggered when Memory usage is above 90%

Transaction Errors

This alert is triggered when the the transactions fail more than 10% of the time in 5 minutes.

Documentation  
1
Psycopg2 observability quickstart contains 1 documentation reference. This is how you'll get your data into New Relic.

Psycopg2 installation docs

Psycopg is the most popular PostgreSQL database adapter for the Python programming language.

Monitoring Psycopg2

Psycopg2 is a popular PostgreSQL database adapter for Python. It is an API which allows Python to interface with Postgres databases. It has a number of features such as thread safety, and it was designed with concurrency in mind(it support large numbers of simultaneous operations to a single database).

While thread safety protects against a lot of common parallel programming errors, there are still things that can go wrong. Parallel connections increase memory and CPU utilization and can cause difficult-to-catch bugs. The Psycopg2 quickstart automatically monitors your Psycopg2 instances and provides instantaneous feedback on key metrics that affect performance.

New Relic Psycopg2 quickstart features

The Quickstart offers a number of visual dashboards that display the following data:

  • CPU Utilization
  • Memory heap used
  • Garbage collection CPU time
  • Top 5 slowest transactions
  • Throughput reports
  • Most popular transactions
  • And more…

It also offers alerts which will notify you when any of the metrics you’re monitoring fall into a critical range, or if an error arises. Alerts include

  • Apdex score
  • CPU utilization
  • Transaction error
New Relic - The complete Psycopg2 dashboard tool

Any Python application which interfaces with a Postgres database is likely to use Psycopg2. This spans a huge array of applications from web backends to machine learning tools to general data stores. Regardless of the specific application, working with Psycopg2 on large-scale projects requires instantiating tens to hundreds to thousands of simultaneous connections with the database. When this many connections are active at once, applications running Psycopg2 become prone to slowdowns or failure.

For example, the New Relic dashboards and alerts relating to CPU utilization can provide notifications when a CPU running Psycopg2 nears full capacity. This can be used as a diagnostic tool to identify which sections of an application might need refinements or refactoring.

Another great tool are the alerts on transaction errors. This alert quick catches errors related to database transactions before they derail the rest of an application. They also make the debugging process much quicker and simpler as visibility into the sources of errors is available immediately.

How to use this quickstart

  • Sign Up for a free New Relic account or Log In to your existing account.
  • Click the install button.
  • Install the quickstart to get started or improve how you monitor your environment. They’re filled with pre-built resources like dashboards, instrumentation, and alerts.
Install now
Install now
Authors

New Relic, Emil Hammarstrand

Support
Built by New Relic

Need help? Visit our Support Center or check out our community forum, the Explorers Hub.

Collaborate on this quickstart
View repo
View repo
Build your own
Build your own
Related resources

Get started today for free.

Sign Up
Sign Up
Get Demo
Get Demo
Follow us
©2008-22 New Relic, Inc. All rights reserved