Skip to main content

Agent Instrumentation

Automatic OpenTelemetry instrumentation for Python agents using the Traceloop SDK, with trace visibility.

Overview

agent-instrumentation enables zero-code instrumentation for Python agents, automatically capturing traces for LLM calls, API requests, and other operations. It seamlessly wraps your agent’s execution with OpenTelemetry tracing powered by the Traceloop SDK.

Features

  • Zero Code Changes: Instrument existing applications without modifying code
  • Automatic Tracing: Traces LLM calls, HTTP requests, database queries, and more
  • OpenTelemetry Compatible: Uses industry-standard OpenTelemetry protocol
  • Flexible Configuration: Configure via environment variables
  • Framework Agnostic: Works with any Python application or framework

Installation

pip install -i agent-instrumentation

Quick Start

1. Set Required Environment Variables

export AMP_APP_NAME="my-application"
export AMP_OTEL_EXPORTER_OTLP_ENDPOINT="https://your-otel-endpoint.com"
export AMP_API_KEY="your-api-key"

2. Run Your Application

Use the agent-trace command to wrap your application:

# Run a Python script
agent-trace python my_script.py

# Run with uvicorn
agent-trace uvicorn app:main --reload

# Run with any package manager
agent-trace poetry run python script.py
agent-trace uv run python script.py

That's it! Your application is now instrumented and sending traces to your configured endpoint.

Release files for agent-instrumentation 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-instrumentation 1.0.1
File Size Uploaded
agent_instrumentation-1.0.1.tar.gz 11.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agent-instrumentation 1.0.1
File Interpreter ABI Platform
agent_instrumentation-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.7 kB

Release files / agent_instrumentation-1.0.1.tar.gz

Download URL agent_instrumentation-1.0.1.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c0c1f199d5e0756965a960b7efdaa53aba6eacff81b2a0be6edf885b3c4b1cc4
BLAKE2b-256 checksum
How to use checksums
9599b677e562dd329ba5264b8141b861c83ebca4d2905b175dda0b074e843d5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / agent_instrumentation-1.0.1-py3-none-any.whl

Download URL agent_instrumentation-1.0.1-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c23b4c67766ee69a8feefd6f643e26b3ca79e51d7e007a8a560bbb2eee88d090
BLAKE2b-256 checksum
How to use checksums
e5c318b65cdd5815dd61d74bbf86bb84f9711d0341be295b71a7829f6c0cc6fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page