WSO2 Agent Manager Instrumentation
Zero-code OpenTelemetry instrumentation for Python agents using the Traceloop SDK, with trace visibility in the WSO2 Agent Manager.
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 Agent Manager 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
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 Agent Manager.