The Service Map for APM is here!

Tracing Python Applications

For Python Django applications, note that tracing is disabled when your application is launched in DEBUG mode. Find more here.

Installation and Getting Started

To begin tracing applications written in Python, first install and configure the Datadog Agent (see additional documentation for tracing Docker applications).

Next, install the Datadog Tracing library, ddtrace, using pip:

pip install ddtrace

Then to instrument your Python application use the included ddtrace-run command. To use it, prefix your Python entry-point command with ddtrace-run.

For example, if your application is started with python app.py then:

$ ddtrace-run python app.py

For more advanced usage, configuration, and fine-grain control, see Datadog’s API documentation.

Compatibility

Python versions 2.7 and 3.4 and onwards are supported.

Integrations

Web Framework Compatibility

The ddtrace library includes support for a number of web frameworks, including:

Framework Support Type PyPi Datadog Documentation
Bottle Fully Supported http://pypi.datadoghq.com/trace/docs/web_integrations.html#bottle
Django Fully Supported http://pypi.datadoghq.com/trace/docs/web_integrations.html#django
Falcon Fully Supported http://pypi.datadoghq.com/trace/docs/web_integrations.html#falcon
Flask Fully Supported http://pypi.datadoghq.com/trace/docs/web_integrations.html#flask
Pylons Fully Supported http://pypi.datadoghq.com/trace/docs/web_integrations.html#pylons
Pyramid Fully Supported http://pypi.datadoghq.com/trace/docs/web_integrations.html#pyramid

Datastore Compatibility

The ddtrace library includes support for the following data stores:

Datastore Support Type PyPi Datadog Documentation
Cassandra Fully Supported http://pypi.datadoghq.com/trace/docs/db_integrations.html#cassandra
Elasticsearch Fully Supported http://pypi.datadoghq.com/trace/docs/db_integrations.html#elasticsearch
Flask Cache Fully Supported http://pypi.datadoghq.com/trace/docs/db_integrations.html#flask-cache
MongoDB Fully Supported http://pypi.datadoghq.com/trace/docs/db_integrations.html#mongodb
Memcached Fully Supported http://pypi.datadoghq.com/trace/docs/db_integrations.html#memcached
MySQL Fully Supported http://pypi.datadoghq.com/trace/docs/db_integrations.html#mysql
Postgres Fully Supported http://pypi.datadoghq.com/trace/docs/db_integrations.html#postgres
Redis Fully Supported http://pypi.datadoghq.com/trace/docs/db_integrations.html#redis
SQLAlchemy Fully Supported http://pypi.datadoghq.com/trace/docs/db_integrations.html#sqlalchemy
SQLite Fully Supported http://pypi.datadoghq.com/trace/docs/db_integrations.html#sqlite

Library Compatibility

The ddtrace library includes support for the following libraries:

Library Support Type PyPi Datadog Documentation
Async Libraries Fully Supported http://pypi.datadoghq.com/trace/docs/async_integrations.html
Boto Fully Supported http://pypi.datadoghq.com/trace/docs/other_integrations.html#boto
Futures Fully Supported http://pypi.datadoghq.com/trace/docs/other_integrations.html#futures
Celery Fully Supported http://pypi.datadoghq.com/trace/docs/other_integrations.html#celery
httplib Fully Supported http://pypi.datadoghq.com/trace/docs/other_integrations.html#httplib
Requests Fully Supported http://pypi.datadoghq.com/trace/docs/other_integrations.html#requests

Further Reading