Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 12 additions & 79 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,86 +1,19 @@
# Kairo Python SDK
# Microsoft Agent 365 Python SDK

A Python SDK for Kairo, providing telemetry and monitoring capabilities.
The Microsoft Agent365 SDK provides comprehensive observability, tooling, and runtime capabilities for AI agents and tools built with Python.

## Installation
## 📚 Library Documentation

```bash
pip install microsoft-kairo
```
Each library includes comprehensive documentation:

## Usage

### Basic Configuration

```python
import microsoft_kairo

# Configure Kairo with console output (default)
microsoft_kairo.configure_kairo(
service_name="my-service",
service_namespace="my-namespace",
agent_id="agent-123"
)
```

### Advanced Configuration

```python
import microsoft_kairo

# Configure with Azure Monitor
microsoft_kairo.configure_kairo(
service_name="my-service",
service_namespace="my-namespace",
agent_id="agent-123",
exporter_type="azure_monitor",
exporter_endpoint="InstrumentationKey=your-instrumentation-key"
)

# Configure with OTLP exporter
microsoft_kairo.configure_kairo(
service_name="my-service",
service_namespace="my-namespace",
agent_id="agent-123",
exporter_type="otlp",
exporter_endpoint="http://localhost:4317"
)
```

### Available Exports

- `configure_kairo()`: Main configuration function
- `KairoSpanProcessor`: Custom span processor class
- `KAIRO_AGENT_ID_KEY`: Constant for agent ID attribute key

## Optional Dependencies

- `otlp`: OpenTelemetry OTLP exporter
- `jaeger`: Jaeger exporter
- `azure`: Azure Monitor exporter
- `all`: All optional dependencies

Install with optional dependencies:

```bash
pip install microsoft-kairo[azure]
```

## Building and publishing the package

Build the package with:

```
uv build --wheel
```

which will generate a date-based wheel package in the `dist/` folder. Ex.: `dist\microsoft_kairo-2025.10.7+preview.15276-py3-none-any.whl`.

Then publish it with:

```
uv run twine upload --config-file .\.pypirc -r Agent365 dist/*
```
| Library | Purpose | Documentation |
|---------|---------|---------------|
| **Observability Core** | Core telemetry and tracing | [`/libraries/microsoft-agents-a365-observability-core/README.md`](./libraries/microsoft-agents-a365-observability-core/README.md) |
| **Runtime** | Environment management and utilities | [`/libraries/microsoft-agents-a365-runtime/README.md`](./libraries/microsoft-agents-a365-runtime/README.md) |
| **Tooling** | MCP server configuration and utilities | [`/libraries/microsoft-agents-a365-tooling/README.md`](./libraries/microsoft-agents-a365-tooling/README.md) |
| **OpenAI Extensions** | OpenAI integration and observability | [`/libraries/microsoft-agents-a365-observability-extensions-openai/README.md`](./libraries/microsoft-agents-a365-observability-extensions-openai/README.md) |
| **LangChain Extensions** | LangChain integration and observability | [`/libraries/microsoft-agents-a365-observability-extensions-langchain/README.md`](./libraries/microsoft-agents-a365-observability-extensions-langchain/README.md) |
| **Semantic Kernel Extensions** | Semantic Kernel integration | [`/libraries/microsoft-agents-a365-observability-extensions-semantickernel/README.md`](./libraries/microsoft-agents-a365-observability-extensions-semantickernel/README.md) |

## 📋 **Telemetry**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ ENABLE_A365_OBSERVABILITY_EXPORTER=true # Use Agent365 exporter (otherwise fa
PYTHON_ENVIRONMENT=production # Or development; influences target cluster/category resolution
```

Alias (legacy) environment variables still honored for backward compatibility:

```properties
ENABLE_KAIRO_EXPORTER=true # Legacy name (deprecated)
```

Prefer the canonical `ENABLE_A365_OBSERVABILITY_EXPORTER`. If you omit `ENABLE_OBSERVABILITY` or set it to false, scopes become no‑ops and no spans are recorded.

## Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
TRACE_CONTENTS_SWITCH = "Azure.Experimental.TraceGenAIMessageContent"
TRACE_CONTENTS_ENVIRONMENT_VARIABLE = "AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED"
ENABLE_OBSERVABILITY = "ENABLE_OBSERVABILITY"
ENABLE_KAIRO_EXPORTER = "ENABLE_KAIRO_EXPORTER"
ENABLE_A365_OBSERVABILITY_EXPORTER = "ENABLE_A365_OBSERVABILITY_EXPORTER"
ENABLE_A365_OBSERVABILITY = "ENABLE_A365_OBSERVABILITY"

Expand Down Expand Up @@ -100,9 +99,6 @@
GEN_AI_EXECUTION_SOURCE_NAME_KEY = "gen_ai.channel.name"
GEN_AI_EXECUTION_SOURCE_DESCRIPTION_KEY = "gen_ai.channel.link"

# Legacy constant for backward compatibility
KAIRO_AGENT_ID_KEY = AGENT_ID_KEY

# custom parent id and parent name key
CUSTOM_PARENT_SPAN_ID_KEY = "custom.parent.span.id"
CUSTOM_SPAN_NAME_KEY = "custom.span.name"
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from ..constants import (
ENABLE_A365_OBSERVABILITY_EXPORTER,
ENABLE_KAIRO_EXPORTER,
GEN_AI_AGENT_ID_KEY,
TENANT_ID_KEY,
)
Expand Down Expand Up @@ -69,6 +68,5 @@ def partition_by_identity(
def is_agent365_exporter_enabled() -> bool:
"""Check if agent365 exporter is enabled."""
# Check environment variable
env_value = os.getenv(ENABLE_KAIRO_EXPORTER, "").lower()
enable_exporter = os.getenv(ENABLE_A365_OBSERVABILITY_EXPORTER, "").lower()
return (env_value or enable_exporter) in ("true", "1", "yes", "on")
return (enable_exporter) in ("true", "1", "yes", "on")
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ instrumentor.instrument()
```properties
# Core observability settings
ENABLE_OBSERVABILITY=true
ENABLE_KAIRO_EXPORTER=true
ENABLE_A365_OBSERVABILITY_EXPORTER=true
PYTHON_ENVIRONMENT=production

# OpenAI Agents-specific settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ instrumentor.instrument()
```properties
# Core observability settings
ENABLE_OBSERVABILITY=true
ENABLE_KAIRO_EXPORTER=true
ENABLE_A365_OBSERVABILITY_EXPORTER=true
PYTHON_ENVIRONMENT=production

# Semantic Kernel-specific settings
Expand Down
Loading