Python Performance Monitoring
Errors, logs, and traces for your Django, Flask, and FastAPI applications. Scout's Python agent automatically instruments your code, detects N+1 queries in Django ORM and SQLAlchemy, and catches memory bloat. Requires Python 3.8+ on Linux or macOS.
Three signals, one view for Python apps
Scout connects errors, logs, and transaction traces for your Python application in a single view. When an exception fires in Django, Flask, or FastAPI, you see the error, the request trace, and surrounding log lines together. No context-switching between tools.
Error Monitoring
Automatic exception capture across Django, Flask, FastAPI, Celery, and Dramatiq. Errors are linked to the request trace and log context that produced them, so you can see what happened before, during, and after the failure.
Log Management
Log output is enriched with trace context and forwarded alongside performance data. Filter logs by endpoint, trace ID, or error group to understand what your Python application was doing at the time of an issue.
App Traces
Transaction tracing with code-level visibility into Django views, Flask route handlers, FastAPI endpoints, and Celery/Dramatiq background jobs. Detailed backtraces show the exact line of code responsible for slow responses.
N+1 Detection and Query Analysis for Python
Scout automatically detects N+1 query patterns in Django ORM and SQLAlchemy without configuration. The agent monitors database queries across request handling and background jobs, identifying repeated query patterns and showing the exact code location and performance impact. Supports SQLite, PostgreSQL, MySQL, MariaDB, Oracle, MS SQL, and CockroachDB.
What Scout instruments in your Python app
Scout auto-instruments the libraries your Python application already uses. Django, Flask, FastAPI, Celery, Dramatiq, Starlette, Bottle, Falcon, Huey, Hug, RQ, Dash, and FastMCP are instrumented at the framework level. ElasticSearch, Jinja2, PyMongo, Redis, and UrlLib3/Requests are instrumented automatically with zero configuration. Database queries through SQLAlchemy and Django ORM are captured across SQLite, PostgreSQL, MySQL, MariaDB, Oracle, MS SQL, and CockroachDB.
Python libraries and frameworks auto-instrumented by Scout
- Django
- Flask
- FastAPI
- Celery
- SQLAlchemy
- Starlette
- Dramatiq
- Bottle
- Falcon
- Huey
- RQ
- Jinja2
- Redis
- ElasticSearch
- PyMongo
Memory Bloat Detection for Python
Python processes can accumulate memory over time, especially in long-running Django or Celery workers. Scout detects memory bloat at the application level, showing which code paths and requests are responsible for memory growth. This goes beyond host-level metrics by telling you what is causing the increase, not just that it is happening.
Query Your Python App Data from AI Assistants and the Terminal
Scout offers hosted and local MCP servers with 17 tools, a Go CLI via Homebrew with TOON format, and a public API. Query your Django, Flask, or FastAPI application's errors, traces, N+1 issues, and Celery job performance from your AI coding assistant or the terminal.
MCP Server
Hosted or local MCP server with 17 tools covering apps, endpoints, traces, errors, insights, background jobs, and usage data. Works with Claude Code, Cursor, VS Code Copilot, and any MCP-enabled assistant.
Scout CLI
Go binary available via Homebrew. Query app metrics, endpoint performance, traces, error groups, and insights from the terminal. Outputs human-friendly tables or TOON format for LLM consumption.
Public API
Full programmatic access to your monitoring data for building custom integrations, dashboards, or automation workflows.
Add Scout to Your Python App
Get started in under 3 minutes with our easy to install Python agent.
Install the package:
pip install scout-apmConfigure in your settings (Django: add to INSTALLED_APPS; Flask/FastAPI: use middleware).
Deploy and see data in 5 minutes.
Python Monitoring FAQ
What is the best app monitoring for Python?
Scout Monitoring provides integrated errors, logs, and traces for Python applications built with Django, Flask, FastAPI, and other frameworks. The Python agent includes automatic N+1 detection in Django ORM and SQLAlchemy, memory bloat detection, Celery and Dramatiq background job monitoring, and auto-instrumentation for 15 libraries. Scout is built for development teams that want all their monitoring signals in one place without enterprise complexity.
What is the best APM for Python?
Scout is a Python APM designed for developer teams that value fast setup and actionable data. The agent requires Python 3.8+ and runs on Linux and macOS. It covers Django, Flask, FastAPI, Bottle, Falcon, Starlette, Celery, Dramatiq, Huey, and RQ out of the box, with automatic instrumentation for ElasticSearch, Jinja2, PyMongo, Redis, and UrlLib3/Requests. You get errors, logs, traces, N+1 detection, and memory profiling in a single tool.
How do I detect N+1 queries in Django?
Scout automatically detects N+1 query patterns in Django ORM without any configuration. The agent monitors database queries within Django views and Celery tasks, identifies repeated query patterns, and shows the code location and performance impact of each N+1. The same detection works for SQLAlchemy in Flask and FastAPI applications.
How do I find memory leaks in Python?
Scout's memory bloat detection identifies which code paths and requests in your Python application are responsible for memory growth. This works across Django views, Flask route handlers, FastAPI endpoints, and Celery background jobs. Instead of only showing that memory is increasing at the host level, Scout tells you which specific transactions are causing the bloat.
Does Scout support error monitoring for Python?
Yes. Scout captures exceptions automatically across Django, Flask, FastAPI, Celery, Dramatiq, and other supported frameworks. Each error is linked to the request trace and surrounding log context, so you see the full picture in one view without switching between separate error tracking and APM tools.
How do I monitor Celery jobs with Scout?
Scout auto-instruments Celery and Dramatiq background jobs in Python. Each job appears with execution timing, queue metrics, and error tracking. N+1 detection and memory bloat analysis apply to background jobs the same way they apply to web requests. Huey and RQ workers are also supported.
Can I use my AI coding assistant with Scout for Python apps?
Yes. Scout offers hosted and local MCP servers with 17 tools that work with Claude Code, Cursor, VS Code Copilot, and any MCP-enabled assistant. You can query your Django, Flask, or FastAPI application's errors, traces, N+1 issues, and Celery job performance in natural language from your editor. The Scout CLI, available via Homebrew, gives you terminal access to the same data and outputs in TOON format for LLM consumption. There is also a public API for custom integrations.