semvec/pypi-packages huggingface dataset:
wso2-agent-instrumentation 1.0.0
Automatic instrumentation for Python applications using WSO2 Agent Management Platform and Traceloop SDK
License: Apache-2.0
Requires Python: >=3.10

# WSO2 Agent Instrumentation

Automatic OpenTelemetry instrumentation for Python agents using the Traceloop SDK, with trace visibility in the WSO2 Agent Management Platform.

## Overview

`wso2-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

Install from Test PyPI (dependencies will be fetched from main PyPI):

```bash
pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ wso2-agent-instrumentation
```

**Note**: This package is currently published on Test PyPI. The `--extra-index-url` flag is required to install dependencies like `traceloop-sdk` from the main PyPI repository.

## Quick Start

### 1. Set Required Environment Variables

```bash
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 `wso2-agent-trace` command to wrap your application:

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

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

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

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