Python performance monitoring for Django, Flask, Celery, and more

 

Here's some excellent news for the Pythonistas in the room: You can now monitor the performance of your Python applications with Honeybadger.

Last year, we launched Honeybadger Insights, a new logging and observability tool bundled with Honeybadger. Insights enables you to query your application logs and events to answer performance questions, perform root-cause analyses, and create charts and dashboards to see what's happening in real time. It's also deeply integrated with error tracking, unlocking direct access to query and analyze your error data.

Today, we're taking Python monitoring to the next level with automatic performance instrumentation and pre-built dashboards for Django, Flask, and Celery. Now you can get comprehensive observability and performance insights out of the box in Honeybadger.

Python performance monitoring in Honeybadger

A layered presentation of multiple Honeybadger performance monitoring dashboards showcasing the platform's comprehensive monitoring capabilities across different technologies. The image displays overlapping dashboard screenshots in a 3D perspective view, with Django and Celery monitoring interfaces prominently featured, showing response time charts, job execution metrics, and performance analysis tables. In the background, partial views of additional dashboard widgets are visible, including slowest views and database query performance tables, demonstrating how developers can create multiple specialized dashboards to monitor different aspects of their application stack. This composite view illustrates Honeybadger's ability to provide tailored monitoring solutions for various frameworks and services within a single platform.

Here's what's new for Python developers:

  1. A new Django monitoring dashboard. Instead of building dashboards from scratch, just select "Django" from our list of automatic monitoring dashboards. The dashboard gives you instant visibility into request performance, slow views, Django ORM queries, and more—everything you need to optimize your Django applications.

  2. A new Flask monitoring dashboard. We've built comprehensive Flask monitoring that tracks routes, blueprint-level insights, and SQLAlchemy query performance. Whether you're running a simple Flask app or a complex multi-blueprint application, this dashboard has you covered.

  3. A new Celery monitoring dashboard. Background job monitoring is crucial for Python applications, so we created a dedicated Celery dashboard that tracks job health, worker performance, and helps you identify slow tasks before they become problems.

  4. Automatic performance instrumentation for Python frameworks. Our Python package now automatically sends performance events and telemetry from Django, Flask, FastAPI, and Celery. The new instrumentation powers your dashboards, but you can also use Insights and BadgerQL to dive into the data yourself, which creates some exciting possibilities for custom analysis.

Before we dive into each of these features, here's the tl;dr:

You can try Honeybadger for free right now with 50MB/day ingest included—that's 1.5GB/month for free, plus error tracking, uptime monitoring, and status pages. Our team pricing is also reasonable; Honeybadger is four times cheaper than Papertrail for logging. 🤯

If you already use Honeybadger for Python, upgrade your honeybadger package to version 1.1 or later, then enable Insights with a single configuration flag to start sending data to your automatic dashboards.

Meet your Python performance dashboards

When creating a dashboard in Honeybadger, you now have several Python-specific options. To get started, select the new "Django," "Flask," or "Celery" dashboard from the list:

A Honeybadger dashboard creation interface for setting up performance monitoring on a Django application. The screen displays a project selector showing "Django" with a search field below it. Framework options are organized by technology categories, with "Other" showing Heroku, "PHP" displaying Laravel, and "Python" listing Celery, Django, and Flask options. Django is currently highlighted in teal, indicating it's selected for dashboard creation. An "Add dashboard" button in the top right allows users to proceed with creating the monitoring dashboard for their chosen framework.

Our team curates each dashboard to make it easy for you to ramp up with Honeybadger and BadgerQL. Simply install our latest Python package, select your dashboard(s), and you're all set.

Django performance dashboard

Honeybadger’s automatic Django dashboard gives you instant visibility into your application's performance, helping you spot bottlenecks, track down slow queries, and optimize the endpoints that matter most to your users.

A comprehensive Django performance monitoring dashboard displaying real-time application metrics. The interface shows multiple widgets including response counts, request distributions by duration, status code breakdowns, and performance metrics organized by Django views and apps. Key panels highlight slowest views and database queries with their execution times, providing developers with actionable insights to optimize application performance. The clean, organized layout allows for quick identification of performance bottlenecks and traffic patterns.

The new Django dashboard includes the following widgets by default:

  • Response counts - A line chart showing request volume over time, so you know immediately when you have traffic spikes or unusual patterns.
  • Request distributions - A histogram of response times binned by duration (100ms intervals), showing how the majority of your requests are performing.
  • Responses - A multi-line chart showing response counts by status code (4XX, 3XX, 2XX) over time, making it easy to spot error spikes.
  • Response durations by view - Multi-line chart tracking performance by Django view/controller, helping you identify which views need optimization.
  • Response durations by app - Performance breakdown by Django application, useful for larger projects with multiple apps.
  • Slowest views - Table showing your worst-performing views with average duration, max duration, and Apdex scores. This points you directly to where you can improve performance.
  • Slowest queries - Database queries with performance metrics and full SQL, automatically captured from Django ORM operations.

The automatic Django ORM query tracking is particularly powerful—you get deep visibility into your database performance without any additional configuration.

Flask performance dashboard

Our automatic Flask dashboard gives you complete visibility into your application's performance, helping you identify slow routes, monitor blueprint-level trends, and optimize database queries for a better user experience.

A comprehensive Flask application performance monitoring dashboard displaying real-time metrics and analytics. The interface features six key monitoring widgets: an overall response count timeline showing traffic patterns over a 24-hour period, a request distribution histogram revealing response time patterns binned by duration, and a status code response chart tracking 2XX, 3XX, and 4XX responses over time. Additional panels show response duration trends broken down by Flask views and blueprints, with multiple colored lines representing different endpoints like blog.detail, comments.create, and tasks.index. Two data tables at the bottom highlight performance bottlenecks, listing the slowest views with their average and maximum durations, and the slowest database queries with execution times and SQL statements. The dashboard provides developers with actionable insights to identify performance issues and optimize their Flask application's response times and database query efficiency.

The Flask dashboard includes these default widgets:

  • Overall Response counts - Request volume trending over time for your Flask application.
  • Request distributions - Response time histogram showing the distribution of your application's performance.
  • Responses - Status code breakdown (4XX, 3XX, 2XX) over time to quickly identify error patterns.
  • Response durations by view - Performance tracking by Flask route/endpoint, helping you optimize slow endpoints.
  • Response durations by blueprint - Blueprint-level performance insights for better application organization.
  • Slowest views - Table highlighting your poorest performing routes with duration metrics and Apdex scores.
  • Slowest queries - Database query performance with automatic SQLAlchemy integration.

The Flask integration provides automatic SQLAlchemy query monitoring and blueprint-level insights, giving you comprehensive visibility into the performance of your Flask application.

Celery performance dashboard

HB’s automatic Celery dashboard gives you real-time visibility into your background job processing, helping you track queue health, identify slow tasks, and ensure your workers are performing optimally.

A Celery task queue performance monitoring dashboard displaying comprehensive job execution metrics and analytics. The interface shows key performance indicators including 17,036 successful jobs alongside counts for ignored, revoked, failed, and retry statuses in prominent summary cards. A stacked bar chart visualizes job counts by status over a 24-hour period, while a multi-line graph tracks job duration trends for different task types like media converter, payment processor, and user onboarding tasks. Two detailed tables provide actionable insights: an overall task statistics summary showing execution counts and average durations for each task type, and a "Slowest 10 Runs" table highlighting specific long-running task instances with timestamps and duration details for performance optimization.

The Celery dashboard includes:

  • Successful jobs - Large counter showing total completed tasks, giving you an immediate health check.
  • Job counts by status - Stacked area chart showing the distribution of job states (SUCCESS, IGNORED, FAILURE, RETRY, REVOKED) over time.
  • Job durations - Multi-line chart showing average execution time by task type over time, helping you identify performance trends.
  • Overall Task Stats - Table with task counts and average durations by worker module.
  • Slowest 10 Runs - Table of individual slow task executions with timestamps and durations for detailed investigation.

After you create a dashboard, you don't have to keep the default widgets—we designed Honeybadger dashboards to be customized. Reading the underlying queries is a great way to learn BadgerQL. To see the query and raw data behind any dashboard widget, click "Open in Query Editor":

A Django database query performance analysis widget displaying the slowest-executing SQL queries with optimization insights. The table shows six database queries ranked by average execution time, with the slowest being a user-posts JOIN query averaging 117ms across 12 executions, followed by feedback, messages, search, audits, and products queries ranging from 44-57ms average execution times. Each row displays the total query count, average execution time, and the actual SQL statement with parameterized values, helping developers identify performance bottlenecks in their Django ORM queries. An "Open in Query Editor" button with a prominent arrow allows users to drill down into detailed query analysis and optimization recommendations.

You can tweak the query, review the results, and update the dashboard from there:

A Honeybadger query editor interface displaying an advanced database performance analysis for Django applications. The top section shows a custom query written in Honeybadger's query language that filters database query events, calculates statistics, and sorts by execution duration. The query aggregates database queries by their SQL text, counting total executions and averaging duration times with human-readable formatting. Below the query editor, a results table displays the slowest database queries with execution counts and average response times, showing the same performance data as the previous dashboard but accessed through the detailed query editor interface. The interface includes time range controls set to "3h" (3 hours) and shows "10 of 21 results" with options to save the query as a dashboard widget.

Python performance instrumentation

The data that feeds these new dashboards is sent automatically from the honeybadger Python package starting in version 1.1—so make sure you upgrade to the latest version. To enable Honeybadger's automatic instrumentation, add the following to your configuration:

honeybadger.configure(insights_enabled=True)

You can alternatively enable insights in your framework config for Django or Flask:

# Django config
HONEYBADGER = {
        # ...
    'INSIGHTS_ENABLED': True,
}

# Flask config
app = Flask(__name__)
# ...
app.config['HONEYBADGER_INSIGHTS_ENABLED'] = True

If you're installing Honeybadger for the first time, check out our integration guides for complete setup instructions:

After deploying your application, new events and metrics will start appearing in Honeybadger Insights, and your dashboards will come to life!

A Honeybadger query editor interface displaying raw event stream data for Django application monitoring. The interface shows a simple query that selects timestamp and preview fields, sorted chronologically, returning 20 of 20 results over a 3-hour timeframe. The results table displays individual monitoring events with precise timestamps and JSON data previews, including Django request events with duration metrics and HTTP methods (GET, POST), database query events with execution times and SQL statements, and error notice events from production environments. This raw event view provides developers with granular access to the underlying telemetry data that powers the aggregated dashboard widgets, enabling detailed debugging and performance analysis of specific application events and database operations.

Supported frameworks & libraries

Honeybadger automatically instruments these Python frameworks and libraries when you enable Insights:

Framework Event Types Captured Key Features
Django django.request, db.query HTTP requests, Django ORM queries, response time tracking
Flask flask.request, db.query HTTP requests, SQLAlchemy queries, blueprint-level insights
ASGI asgi.request Generic ASGI applications (FastAPI, Starlette, etc.)
Celery celery.task_finished Task execution, duration tracking, failure monitoring

The instrumentation captures comprehensive telemetry including request details, database query performance, background job metrics, and response times—all with zero additional configuration.

You can fine-tune the instrumentation for specific frameworks using the insights_config parameter:

honeybadger.configure(
    insights_enabled=True,
    insights_config={
        "django": {
            "include_params": True,  # Include GET/POST params
        },
        "flask": {
            "include_params": True,
        },
        "celery": {
            "include_args": True,    # Include task arguments
            "exclude_tasks": ["internal_cleanup"],
        },
        "db": {
            "include_params": False, # SQL parameter values
            "exclude_queries": [     # Skip common system queries
                "PRAGMA",
                "SHOW ",
            ],
        }
    }
)

Sending custom events

You can also send your own custom events to Honeybadger using the honeybadger.event method:

honeybadger.event('user.signed_up', {
    'user_id': user.id,
    'plan': 'premium'
})

The first argument is the type of the event (event_type), and the second argument is a dictionary containing any additional data you want to include.

You can find these events with the following BadgerQL query:

fields @ts, @preview
| filter event_type::str == "user.signed_up"
| sort @ts

You can also add custom metadata to all events sent from your application using event context, and for advanced use cases, you can filter and transform events before they're sent to Honeybadger.

Sending logs from your infrastructure

Last but not least, Honeybadger isn't just for errors and application data! You can use our syslogVector, or PaaS integrations to send additional data from your infrastructure to Honeybadger, where you can query, visualize, and analyze all of your production data in one place.

A Honeybadger infrastructure monitoring event stream displaying system resource telemetry data in JSON format. The interface shows real-time system reports including memory usage events with available and free bytes metrics, CPU load average reports from specific API hosts, disk usage monitoring with device names and free space measurements, and check-in status events with reporting states. Each event is timestamped and contains structured data about server infrastructure health, providing developers with detailed visibility into system resource utilization, server performance metrics, and operational status across their infrastructure fleet.

Start monitoring your Python performance

To try out the new Python performance monitoring features in Honeybadger, all you need to do is sign up for a free Honeybadger account. We include 50MB/day (1.5GB/month) ingest for free, plus error tracking, uptime monitoring, and status pages. Our pricing is reasonable, too: Honeybadger is four times cheaper than Papertrail for logging.

author photo
Joshua Wood

Josh started hacking on IRC scripts in the late nineties and has been hacking on computers (and businesses) ever since. As a co-founder of Honeybadger he works on the product, leads marketing and developer relations, and is involved in many open-source projects.

More articles by Joshua Wood

Get the Honeybadger Newsletter

Join our community of kick-ass developers as we learn engineering, DevOps, and cloud architecture.

    We'll never spam you; we will send you cool stuff like exclusive content, memes, and swag.

    An advertisement for Honeybadger that reads 'Move fast and fix things.'

    "This was the easiest signup experience I've ever had. Amazing work." — Andrew McGrath

    Get started for free
    Simple 5-minute setup — No credit card required