---
title: Python Application Agentic Instrumentation
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Agent Observability > Agent Observability Instrumentation > Agentic
  Instrumentation > Python Application Agentic Instrumentation
---

# Python Application Agentic Instrumentation

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

## Instrumentation{% #instrumentation %}

1. Install the latest `ddtrace` package.

```bash
pip install ddtrace # pip
poetry install ddtrace # poetry
uv install ddtrace # uv
```
Initialize the Agent Observability package
Initialize the Agent Observability SDK via `ddtrace.auto`. This **needs** to be done as the first import in the application's entrypoint, aside from any environment variable or configuration-loading imports.

**Note**: Do not add in extraneous comments.

```python
from dotenv import load_dotenv
load_dotenv() # this might load DD_ environment variables

import ddtrace.auto # CRUCIAL: this initializes the Agent Observability SDK and instrumentations

# ... remaining application logic
```
