Skip to main content

Fiddler SDK for Strands Agent instrumentation with OpenTelemetry

Project description

Fiddler Strands SDK

Python 3.10+ License: MIT

OpenTelemetry instrumentation SDK for Strands AI agents, providing automatic observability and monitoring capabilities through Fiddler's platform.

Features

  • 🎯 Automatic Instrumentation: Zero-code instrumentation of Strands agents using OpenTelemetry
  • 🔍 Built-in Observability: Automatic logging hooks for agent interactions
  • 📊 Fiddler Integration: Custom span processors for enhanced trace analysis
  • 🛠️ Extensible: Easy to add custom hooks and processors
  • 🚀 Production Ready: Built on OpenTelemetry standards

Installation

Using uv (Recommended)

# Install the SDK
uv add fiddler-strands

# For development
uv add fiddler-strands[dev]

# For running examples
uv add fiddler-strands[examples]

Using pip

pip install fiddler-strands

Quick Start

Basic Usage

import os
from strands import Agent
from strands.models.openai import OpenAIModel
from strands.telemetry import StrandsTelemetry
from fiddler_strandsagents import StrandsAgentInstrumentor

strands_telemetry = StrandsTelemetry()
strands_telemetry.setup_otlp_exporter()
strands_telemetry.setup_console_exporter()
# Enable automatic instrumentation
StrandsAgentInstrumentor(strands_telemetry).instrument()

# Create your agent as usual - LoggingHook will be automatically injected
model = OpenAIModel(api_key=os.getenv("OPENAI_API_KEY"))
agent = Agent(model=model, system_prompt="You are a helpful assistant")

# Use your agent - all interactions will be automatically instrumented
response = agent("Hello, how are you?")

Examples

The examples/ directory contains complete working examples:

  • travel_agent.py: Complete travel booking agent with tools
  • async_travel_agent.py: Async version of the travel booking agent

Running Examples

# Clone the repository
git clone https://github.com/fiddler-labs/fiddler-strands-sdk
cd fiddler-strands-sdk

# Set up environment
export OPENAI_API_KEY="your-api-key-here"

# Install dependencies
uv sync --extra examples

# Run an example
uv run python examples/travel_agent.py

API Reference

StrandsAgentInstrumentor

The main instrumentor class for automatic agent instrumentation.

from fiddler_strandsagents import StrandsAgentInstrumentor

instrumentor = StrandsAgentInstrumentor()

# Enable instrumentation
instrumentor.instrument()

# Check if instrumentation is active
is_active = instrumentor.is_instrumented_by_opentelemetry

# Disable instrumentation
instrumentor.uninstrument()

Development

Setup Development Environment

# Clone the repository
git clone https://github.com/fiddler-labs/fiddler-strands-sdk
cd fiddler-strands-sdk

# Install with development dependencies
uv sync --extra dev

# Run tests
uv run pytest

# Run linting
uv run black fiddler_strandsagents/ examples/
uv run isort fiddler_strandsagents/ examples/
uv run flake8 fiddler_strandsagents/ examples/

Project Structure

fiddler-strands-sdk/
├── fiddler_strandsagents/    # Main SDK package
│   ├── __init__.py             # Public API exports
│   ├── instrumentation.py      # OpenTelemetry instrumentor
│   ├── hooks.py                # Hook providers
│   └── span_processor.py       # Custom span processors
├── examples/                   # Usage examples
├── tests/                      # Test suite
├── pyproject.toml             # Project configuration
└── README.md                  # This file

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests and linting (uv run pytest && uv run black fiddler_strandsagents/)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

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

fiddler_strands-0.2.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

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

fiddler_strands-0.2.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file fiddler_strands-0.2.0.tar.gz.

File metadata

  • Download URL: fiddler_strands-0.2.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fiddler_strands-0.2.0.tar.gz
Algorithm Hash digest
SHA256 dcfb16261d26a540398ee3903e4d34408e5daa0f027014dc061000fa3583ab3e
MD5 40058e0654d6d10a7a60a92a4903a72b
BLAKE2b-256 08f7a7b6619190b0630f54f836f72f38f334c6ed4e300c7e0ad981c58b4a2a4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for fiddler_strands-0.2.0.tar.gz:

Publisher: publish.yml on fiddler-labs/fiddler-strands-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fiddler_strands-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fiddler_strands-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dfa844bc1d5e7f0ba24749b117639d8ad06b07d835cf0bd7af98baefbd1f5571
MD5 4e46ad7e9be2ac19e42e3f6cfe2a60dd
BLAKE2b-256 1092af6770cfd74b4ff92c96afeed98573223768c4cd946592121cb6765436a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for fiddler_strands-0.2.0-py3-none-any.whl:

Publisher: publish.yml on fiddler-labs/fiddler-strands-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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