---
mapped_pages:
  - https://www.elastic.co/guide/en/apm/agent/python/current/getting-started.html
  - https://www.elastic.co/guide/en/apm/agent/python/current/index.html
applies_to:
  stack:
  serverless:
    observability:
  product:
    apm_agent_python: ga
---

# APM Python agent [getting-started]

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](/reference/supported-technologies.md) below. Consider using the [EDOT Python SDK](elastic-otel-python://reference/edot-python/index.md) for observability data so you continue to get the full power of Elastic's platform.
:::::

## How does the Agent work? [how-it-works]

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](/reference/supported-technologies.md) 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](/reference/how-agent-works.md).


## Additional components [additional-components]

APM Agents work in conjunction with the [APM Server](docs-content://solutions/observability/apm/index.md), [Elasticsearch](docs-content://get-started/introduction.md#what-is-es), and [Kibana](docs-content://get-started/introduction.md#what-is-kib). The [APM documentation](docs-content://solutions/observability/apm/index.md) provides details on how these components work together, and provides a matrix outlining [Agent and Server compatibility](docs-content://solutions/observability/apm/apm-agent-compatibility.md).

## Troubleshooting

If you're experiencing issues with the APM Python agent, refer to [Troubleshoot APM Python Agent](docs-content://troubleshoot/observability/apm-agent-python/apm-python-agent.md).