Supported technologies
Serverless Observability Stack APM Agent Python
The Elastic APM Python Agent comes with support for the following frameworks:
For other frameworks and custom Python code, the agent exposes a set of APIs for integration.
The following Python versions are supported:
- 3.6
- 3.7
- 3.8
- 3.9
- 3.10
- 3.11
- 3.12
- 3.13
We support these Django versions:
- 1.11
- 2.0
- 2.1
- 2.2
- 3.0
- 3.1
- 3.2
- 4.0
- 4.2
- 5.0
For upcoming Django versions, we generally aim to ensure compatibility starting with the first Release Candidate.
we currently don’t support Django running in ASGI mode.
We support these Flask versions:
- 0.10 (Deprecated)
- 0.11 (Deprecated)
- 0.12 (Deprecated)
- 1.0
- 1.1
- 2.0
- 2.1
- 2.2
- 2.3
- 3.0
We support these aiohttp versions:
- 3.0+
We support these tornado versions:
- 6.0+
We support these sanic versions:
- 20.12.2+
We support these Starlette versions:
- 0.13.0+
Any FastAPI version which uses a supported Starlette version should also be supported.
We support these grpcio versions:
- 1.24.0+
The Python APM agent comes with automatic instrumentation of various 3rd party modules and standard library modules.
We support these Celery versions:
- 4.x (deprecated)
- 5.x
Celery tasks will be recorded automatically with Django and Flask only.
Instrumented methods:
elasticsearch.transport.Transport.perform_requestelasticsearch.connection.http_urllib3.Urllib3HttpConnection.perform_requestelasticsearch.connection.http_requests.RequestsHttpConnection.perform_requestelasticsearch._async.transport.AsyncTransport.perform_requestelasticsearch_async.connection.AIOHttpConnection.perform_request
Additionally, the instrumentation wraps the following methods of the Elasticsearch client class:
elasticsearch.client.Elasticsearch.delete_by_queryelasticsearch.client.Elasticsearch.searchelasticsearch.client.Elasticsearch.countelasticsearch.client.Elasticsearch.update
Collected trace data:
- the query string (if available)
- the
queryelement from the request body (if available) - the response status code
- the count of affected rows (if available)
We recommend using keyword arguments only with elasticsearch-py, as recommended by the elasticsearch-py docs. If you are using positional arguments, we will be unable to gather the query element from the request body.
Instrumented methods:
sqlite3.connectsqlite3.dbapi2.connectpysqlite2.dbapi2.connect
The instrumented connect method returns a wrapped connection/cursor which instruments the actual Cursor.execute calls.
Collected trace data:
- parametrized SQL query
Library: MySQLdb
Instrumented methods:
MySQLdb.connect
The instrumented connect method returns a wrapped connection/cursor which instruments the actual Cursor.execute calls.
Collected trace data:
- parametrized SQL query
Library: mysql-connector-python
Instrumented methods:
mysql.connector.connect
The instrumented connect method returns a wrapped connection/cursor which instruments the actual Cursor.execute calls.
Collected trace data:
- parametrized SQL query
Library: pymysql
Instrumented methods:
pymysql.connect
The instrumented connect method returns a wrapped connection/cursor which instruments the actual Cursor.execute calls.
Collected trace data:
- parametrized SQL query
Library: aiomysql
Instrumented methods:
aiomysql.cursors.Cursor.execute
Collected trace data:
- parametrized SQL query
Library: psycopg2, psycopg2-binary (>=2.9)
Instrumented methods:
psycopg2.connect
The instrumented connect method returns a wrapped connection/cursor which instruments the actual Cursor.execute calls.
Collected trace data:
- parametrized SQL query
Library: aiopg (>=1.0)
Instrumented methods:
aiopg.cursor.Cursor.executeaiopg.cursor.Cursor.callproc
Collected trace data:
- parametrized SQL query
Library: asyncpg (>=0.20)
Instrumented methods:
asyncpg.connection.Connection.executeasyncpg.connection.Connection.executemany
Collected trace data:
- parametrized SQL query
Library: pyodbc, (>=4.0)
Instrumented methods:
pyodbc.connect
The instrumented connect method returns a wrapped connection/cursor which instruments the actual Cursor.execute calls.
Collected trace data:
- parametrized SQL query
Library: pymssql, (>=2.1.0)
Instrumented methods:
pymssql.connect
The instrumented connect method returns a wrapped connection/cursor which instruments the actual Cursor.execute calls.
Collected trace data:
- parametrized SQL query
Library: pymongo, >=2.9,<3.8
Instrumented methods:
pymongo.collection.Collection.aggregatepymongo.collection.Collection.bulk_writepymongo.collection.Collection.countpymongo.collection.Collection.create_indexpymongo.collection.Collection.create_indexespymongo.collection.Collection.delete_manypymongo.collection.Collection.delete_onepymongo.collection.Collection.distinctpymongo.collection.Collection.droppymongo.collection.Collection.drop_indexpymongo.collection.Collection.drop_indexespymongo.collection.Collection.ensure_indexpymongo.collection.Collection.find_and_modifypymongo.collection.Collection.find_onepymongo.collection.Collection.find_one_and_deletepymongo.collection.Collection.find_one_and_replacepymongo.collection.Collection.find_one_and_updatepymongo.collection.Collection.grouppymongo.collection.Collection.inline_map_reducepymongo.collection.Collection.insertpymongo.collection.Collection.insert_manypymongo.collection.Collection.insert_onepymongo.collection.Collection.map_reducepymongo.collection.Collection.reindexpymongo.collection.Collection.removepymongo.collection.Collection.renamepymongo.collection.Collection.replace_onepymongo.collection.Collection.savepymongo.collection.Collection.updatepymongo.collection.Collection.update_manypymongo.collection.Collection.update_one
Collected trace data:
- database name
- method name
Library: redis (>=2.8)
Instrumented methods:
redis.client.Redis.execute_commandredis.client.Pipeline.execute
Collected trace data:
- Redis command name
Library: aioredis (<2.0)
Instrumented methods:
aioredis.pool.ConnectionsPool.executeaioredis.commands.transaction.Pipeline.executeaioredis.connection.RedisConnection.execute
Collected trace data:
- Redis command name
Library: cassandra-driver (>=3.4,<4.0)
Instrumented methods:
cassandra.cluster.Session.executecassandra.cluster.Cluster.connect
Collected trace data:
- CQL query
Library: python-memcached (>=1.51)
Instrumented methods:
memcache.Client.addmemcache.Client.appendmemcache.Client.casmemcache.Client.decrmemcache.Client.deletememcache.Client.delete_multimemcache.Client.disconnect_allmemcache.Client.flush_allmemcache.Client.getmemcache.Client.get_multimemcache.Client.get_slabsmemcache.Client.get_statsmemcache.Client.getsmemcache.Client.incrmemcache.Client.prependmemcache.Client.replacememcache.Client.setmemcache.Client.set_multimemcache.Client.touch
Collected trace data:
- Destination (address and port)
Library: pymemcache (>=3.0)
Instrumented methods:
pymemcache.client.base.Client.addpymemcache.client.base.Client.appendpymemcache.client.base.Client.caspymemcache.client.base.Client.decrpymemcache.client.base.Client.deletepymemcache.client.base.Client.delete_manypymemcache.client.base.Client.delete_multipymemcache.client.base.Client.flush_allpymemcache.client.base.Client.getpymemcache.client.base.Client.get_manypymemcache.client.base.Client.get_multipymemcache.client.base.Client.getspymemcache.client.base.Client.gets_manypymemcache.client.base.Client.incrpymemcache.client.base.Client.prependpymemcache.client.base.Client.quitpymemcache.client.base.Client.replacepymemcache.client.base.Client.setpymemcache.client.base.Client.set_manypymemcache.client.base.Client.set_multipymemcache.client.base.Client.statspymemcache.client.base.Client.touch
Collected trace data:
- Destination (address and port)
Library: kafka-python (>=2.0)
Instrumented methods:
kafka.KafkaProducer.send,kafka.KafkaConsumer.poll,kafka.KafkaConsumer.\__next__
Collected trace data:
- Destination (address and port)
- topic (if applicable)
Library: urllib2 (Python 2) / urllib.request (Python 3)
Instrumented methods:
urllib2.AbstractHTTPHandler.do_open/urllib.request.AbstractHTTPHandler.do_open
Collected trace data:
- HTTP method
- requested URL
Library: urllib3
Instrumented methods:
urllib3.connectionpool.HTTPConnectionPool.urlopen
Additionally, we instrumented vendored instances of urllib3 in the following libraries:
requestsbotocore
Both libraries have "unvendored" urllib3 in more recent versions, we recommend to use the newest versions.
Collected trace data:
- HTTP method
- requested URL
Instrumented methods:
requests.sessions.Session.send
Collected trace data:
- HTTP method
- requested URL
Instrumented methods:
aiohttp.client.ClientSession._request
Collected trace data:
- HTTP method
- requested URL
Instrumented methods:
- `httpx.Client.send
Collected trace data:
- HTTP method
- requested URL
Library: boto3 (>=1.0)
Instrumented methods:
botocore.client.BaseClient._make_api_call
Collected trace data for all services:
- AWS region (e.g.
eu-central-1) - AWS service name (e.g.
s3) - operation name (e.g.
ListBuckets)
Additionally, some services collect more specific data
Library: aiobotocore (>=2.2.0)
Instrumented methods:
aiobotocore.client.BaseClient._make_api_call
Collected trace data for all services:
- AWS region (e.g.
eu-central-1) - AWS service name (e.g.
s3) - operation name (e.g.
ListBuckets)
Additionally, some services collect more specific data
- Bucket name
- Table name
- Topic name
- Queue name
Library: Django (see Django for supported versions)
Instrumented methods:
django.template.Template.render
Collected trace data:
- template name
Library: jinja2
Instrumented methods:
jinja2.Template.render
Collected trace data:
- template name