/ 
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.

What's included?

dashboards
1
Psycopg2 quickstart contains 1 dashboard. These interactive visualizations let you easily explore your data, understand context, and resolve problems faster.
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.
Transaction Errors
This alert is triggered when the the transactions fail more than 10% of the time in 5 minutes.
Memory Usage
This alert is triggered when Memory usage is above 90%
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%.
documentation
1
Psycopg2 observability quickstart contains 1 documentation reference. This is how you'll get your data into New Relic.

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 was designed with concurrency in mind(supporting large numbers of simultaneous operations to a single database).

While thread safety protects against 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 multiple simultaneous connections with the database. When this many connections are active at once, applications running Psycopg2 become prone to slowdowns or failure.

This observability pack can help you detect those before they become an issue. For example, the New Relic dashboards and alerts relating to CPU utilization 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 speed up the debugging process as visibility into the sources of errors.

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.
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.