Datadog Python APM Client#

ddtrace is Datadog’s Python APM client. It is used to profile code and trace requests as they flow across web servers, databases and microservices. This enables developers to have greater visibility into bottlenecks and troublesome requests in their application.

Getting Started#

For a basic product overview: check out the setup documentation.

For details about developing and contributing: refer to the development guide.

For descriptions of the terminology of Datadog APM: take a look at the official documentation.

Supported Libraries#

We officially support Python 3.7 and above.

The versions listed are the versions that we have tested, but ddtrace can still be compatible with other versions of these libraries. If a version of a library you use is unsupported, feel free to contribute or request it by contacting support.

Integration

Supported Version

Automatically Instrumented 1

aiobotocore

>= 1.4.2

No

aiohttp (client)

>= 3.7

Yes

aiohttp (server)

>= 3.7

No

aiomysql

>= 0.1.0

Yes

aiopg

>= 0.16.0

Yes

aioredis

>= 1.3.0

Yes

algoliasearch

>= 2.5.0

Yes

aredis

*

Yes

asgi

>= 3.0

No

asyncio

*

Yes 4

asyncpg

>= 0.22.0

Yes

botocore

*

Yes

Bottle

>= 0.12

No

Cassandra

>= 3.24

Yes

Celery

>= 4.4

Yes

CherryPy

>= 17.0

No

confluent-kafka

>= 1.9.2

Yes

Consul

>= 1.1

Yes 2

Django

>= 3.2

Yes

djangorestframework

>= 3.11

No

dogpile.cache

>= 0.9

Yes

Elasticsearch

>= 1.10,< 8.0

Yes

Fastapi

>= 0.64

Yes

Flask

>= 1.0

Yes

Flask Cache

>= 0.13

No

Flask Login

>= 0.6.2

Yes 6

gevent

>= 1.5

No

Grpc

>= 1.34

Yes 5

graphene

>= 3.0.0

Yes

graphql-core

>= 3.1

Yes

gunicorn

>= 20.0.04

No

httplib

*

Yes

httpx

>= 0.17

Yes

Jinja2

>= 2.11

Yes

kombu

>= 4.2

No

LangChain

>= 0.0.192

Yes

Logbook

>= 1.0.0

No

Loguru

>= 0.3.0

No

Mako

>= 0.1.0

Yes

MariaDB

>= 1.0.0

Yes

Molten

>= 1.0

Yes

Mongoengine

>= 0.23

Yes

mysql-connector

>= 8.0.5

No

OpenAI

>= 0.26.5

Yes

opensearch-py

>= 1.1

Yes

psycopg

>= 2.8

Yes

pylibmc

>= 1.6.2

Yes

pymemcache

>= 3.4

Yes

Pymongo

>= 3.12.3

Yes

pymysql

>= 1.0

Yes

PynamoDB

>= 5.0

Yes

PyODBC

>= 4.0.31

Yes

Pyramid

>= 1.10

No

pytest

>= 6.0

Yes

redis

*

Yes

redis-py-cluster

>= 2.0

Yes

Requests

>= 2.20

Yes

RQ

>= 1.8

Yes

Sanic

>= 20.12.0

Yes 3

Snowflake

>= 2.3.0

No

SQLAlchemy

>= 1.3

No

SQLite

*

Yes

Starlette

>= 0.14.0

Yes

Structlog

>= 20.2.0

No

Tornado

>= 5.1

No

urllib3

>= 1.25.8

No

Vertica

>= 0.6

Yes

WSGI

*

No

yaaredis

>= 2.0.0

Yes

1

Libraries that are automatically instrumented when the ddtrace-run command is used or the import ddtrace.auto import is used. Always use patch(), patch_all(), and import ddtrace.auto as soon as possible in your Python entrypoint.

2

only the synchronous client

3

only in Python 3.7 and above.

4

Activating the legacy context provider is required in Python < 3.7. See asyncio for more details.

5

grpc.aio is automatically instrumented starting with grpcio>=1.32.0.

6

Automatically instrumented if DD_APPSEC_ENABLED=1.

Instrumentation Telemetry#

Datadog may gather environmental and diagnostic information about instrumentation libraries; this includes information about the host running an application, operating system, programming language and runtime, APM integrations used, and application dependencies. Additionally, Datadog may collect information such as diagnostic logs, crash dumps with obfuscated stack traces, and various system performance metrics.

To disable set DD_INSTRUMENTATION_TELEMETRY_ENABLED=false environment variable.

See our official datadog documentation for more details.

Release Notes#

You can view historical release notes for all past versions of this repository on GitHub.

Indices and tables#