Performance Monitoring for Flask apps

Application Performance Monitoring with Airbrake makes it easy to:

  • See a broad performance overview for your whole application
  • Measure user satisfaction with your app performance using Apdex
  • Identify routes with slow or error-prone performance
  • Zoom into specific endpoints to see time spent in the DB, view, cache, external requests, and more
  • Analyze SQL database queries being called and how long they take

Flask Support

Flask support for Performance Monitoring is currently in early access

The pybrake package makes it quick and easy to monitor your Flask app’s performance. It only takes a few minutes to start collecting real performance data so let’s jump right in!

Step 1: Install the latest version of pybrake

Airbrake for Flask uses our official Python notifier pybrake. To install run:

pip install pybrake

Step 2: Configure the Airbrake Flask middleware

Replace the placeholder project_id and project_key values from the example below with the real values from your project’s setting page.

from flask import Flask
import pybrake.flask

app = Flask(__name__)
app.config['PYBRAKE'] = dict(
    project_id=123123,
    project_key='FIX-ME',
)
app = pybrake.flask.init_app(app)


@app.route('/')
def hello_airbrake():
    return 'Hello, Airbrake!'

Congratulations!

Great job! Just visit your Airbrake project’s Performance Dashboard to see route data for your app. Soon enough you’ll have more insights into your application’s performance. In the meantime why not check out the Performance Dashboard features. If you have questions about Performance Monitoring, visit the Performance Monitoring FAQ.

Want to learn more?

Want to learn more about pybrake? Check out our official GitHub repo.