Skip to main content

Automatic instrumentation for Python agent applications, monitored via WSO2 Agent Management Platform

Project description

WSO2 AI Agent Management Platform Instrumentation

Zero-code OpenTelemetry instrumentation for Python agents using the Traceloop SDK, with trace visibility in the WSO2 AI Agent Management Platform.

Overview

amp-instrumentation enables zero-code instrumentation for Python agents, automatically capturing traces for LLM calls, MCP 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, MCP 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 built using a wide range of agent frameworks supported by the TraceLoop SDK

Installation

pip install amp-instrumentation

Quick Start

1. Register Your Agent

First, register your agent at the WSO2 AI Agent Management Platform to obtain your agent API key and configuration details.

2. Set Required Environment Variables

export AMP_OTEL_ENDPOINT="https://amp-otel-endpoint.com" # AMP OTEL endpoint
export AMP_AGENT_API_KEY="your-agent-api-key" # Agent-specific key generated after registration

Optionally, you can set custom trace attributes:

export AMP_TRACE_ATTRIBUTES="environment-uid=env,component-uid=comp" # Optional: Custom key-value pairs for trace metadata

3. Run Your Application

Use the amp-instrument command to wrap your application run command:

# Run a Python script
amp-instrument python my_script.py

# Run with uvicorn
amp-instrument uvicorn app:main --reload

# Run with any package manager
amp-instrument poetry run python script.py
amp-instrument uv run python script.py

That's it! Your application is now instrumented and sending traces to the WSO2 AI Agent Management Platform.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amp_instrumentation-0.1.3.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

amp_instrumentation-0.1.3-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file amp_instrumentation-0.1.3.tar.gz.

File metadata

  • Download URL: amp_instrumentation-0.1.3.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for amp_instrumentation-0.1.3.tar.gz
Algorithm Hash digest
SHA256 947de417bd455fbd96eddf57c163914c7404312a33842049509206585d3e86e4
MD5 5a183357f4b540b0e43fd860766b90a3
BLAKE2b-256 f082e87f10d591b6105e240bf070e5c224a3eac4da62f8abfc811b121c9b2bbf

See more details on using hashes here.

File details

Details for the file amp_instrumentation-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for amp_instrumentation-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ff9806721898ee19f50d89c47ded80c43cbc5c7aaa9e4fd0747c2d514f9a5083
MD5 77adb3e7b412eeb19cc87ee1dc6b4139
BLAKE2b-256 3094bfe0fea7ddc66836bf197b6261c89794685b9712422c43e3f27bc4ecb0fa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page