Skip to main content
This guide covers Python applications running on ECS, EC2, Kubernetes, or any container/VM environment. For AWS Lambda, see the Python Lambda guide.

1. Install the OpenTelemetry SDK

2. Install Instrumentation Libraries

opentelemetry-bootstrap automatically detects your installed packages (Django, FastAPI, Boto3, etc.) and installs the matching instrumentation libraries.

3. Install the Resource Detector Package

Install the resource detector package for the platform your application is running on.

4. Set Environment Variables

Add these environment variables to your service. Replace YOUR_TRACE0_ENV_API_KEY with the API key from your Trace0 environment. If your application is running on AWS, set the following additional environment variable for your deployment platform.

5. Kubernetes Setup

If your application runs on Kubernetes, including Amazon EKS, Google Kubernetes Engine or Azure Kubernetes Service, add the following environment variables to your container specification.

6. Deploy Service

Deploy your service and watch traces, metrics, and logs appear in the Trace0 dashboard within seconds.

Example Service

See our Python FastAPI EC2 example app for a working service you can deploy to your AWS account.