Type to search.

APM Python agent

Serverless Observability

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Stack

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

APM Agent Python

The Elastic APM Python agent enables you to trace the execution of operations in your Python applications, sending performance metrics and errors to the Elastic APM Server.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

The Elastic APM Python agent sends performance metrics and error logs to the APM Server. It has built-in support for Django and Flask performance metrics and error logging, as well as generic support of other WSGI frameworks for error logging.

Note

Elastic supports OpenTelemetry, which allows logs, metrics, and trace signal collection for many of the supported technologies below. Consider using the EDOT Python SDK for observability data so you continue to get the full power of Elastic's platform.

The Python Agent instruments your application to collect APM events in a few different ways:

To collect data about incoming requests and background tasks, the Agent integrates with supported technologies to make use of hooks and signals provided by the framework. These framework integrations require limited code changes in your application.

To collect data from database drivers, HTTP libraries etc., we instrument certain functions and methods in these libraries. Instrumentations are set up automatically and do not require any code changes.

In addition to APM and error data, the Python agent also collects system and application metrics in regular intervals. This collection happens in a background thread that is started by the agent.

More detailed information on how the Agent works can be found in the advanced topics.

APM Agents work in conjunction with the APM Server, Elasticsearch, and Kibana. The APM documentation provides details on how these components work together, and provides a matrix outlining Agent and Server compatibility.

If you're experiencing issues with the APM Python agent, refer to Troubleshoot APM Python Agent.