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.1.0.tar.gz (13.2 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.1.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fiddler_strands-0.1.0.tar.gz
  • Upload date:
  • Size: 13.2 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.1.0.tar.gz
Algorithm Hash digest
SHA256 9bdc306b0648d7286a50471b2470a73d3ef4ca89734a4d38061321dc1b9692e4
MD5 5bc9328f5dcfcc9a51ca22a714c3039f
BLAKE2b-256 a53f6d12fa91f3bb16ec2a0c520ff187aa4fb6415524539ee141874c209aea50

See more details on using hashes here.

Provenance

The following attestation bundles were made for fiddler_strands-0.1.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.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fiddler_strands-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2819285e41717713b113eb54a1367ec84f0c2776e7ab29ff33d13282c2b07bf
MD5 a533d840b224bae4dbe51a0e58f7fb4a
BLAKE2b-256 4e27da0c972f266c9582dfc78baa4dd83e87428f6aceb7eb8a33239f01d59bc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for fiddler_strands-0.1.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