Fiddler SDK for Strands Agent instrumentation with OpenTelemetry
Project description
Fiddler Strands SDK
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 toolsasync_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
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests and linting (
uv run pytest && uv run black fiddler_strandsagents/) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- 📧 Email: support@fiddler.ai
- 📖 Documentation: https://docs.fiddler.ai/strands-sdk
- 🐛 Issues: https://github.com/fiddler-labs/fiddler-strands-sdk/issues
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcfb16261d26a540398ee3903e4d34408e5daa0f027014dc061000fa3583ab3e
|
|
| MD5 |
40058e0654d6d10a7a60a92a4903a72b
|
|
| BLAKE2b-256 |
08f7a7b6619190b0630f54f836f72f38f334c6ed4e300c7e0ad981c58b4a2a4b
|
Provenance
The following attestation bundles were made for fiddler_strands-0.2.0.tar.gz:
Publisher:
publish.yml on fiddler-labs/fiddler-strands-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fiddler_strands-0.2.0.tar.gz -
Subject digest:
dcfb16261d26a540398ee3903e4d34408e5daa0f027014dc061000fa3583ab3e - Sigstore transparency entry: 692551434
- Sigstore integration time:
-
Permalink:
fiddler-labs/fiddler-strands-sdk@f5b636cc64d3278b7b51ae764329310f6efd6908 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/fiddler-labs
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
publish.yml@f5b636cc64d3278b7b51ae764329310f6efd6908 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file fiddler_strands-0.2.0-py3-none-any.whl.
File metadata
- Download URL: fiddler_strands-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfa844bc1d5e7f0ba24749b117639d8ad06b07d835cf0bd7af98baefbd1f5571
|
|
| MD5 |
4e46ad7e9be2ac19e42e3f6cfe2a60dd
|
|
| BLAKE2b-256 |
1092af6770cfd74b4ff92c96afeed98573223768c4cd946592121cb6765436a6
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fiddler_strands-0.2.0-py3-none-any.whl -
Subject digest:
dfa844bc1d5e7f0ba24749b117639d8ad06b07d835cf0bd7af98baefbd1f5571 - Sigstore transparency entry: 692551452
- Sigstore integration time:
-
Permalink:
fiddler-labs/fiddler-strands-sdk@f5b636cc64d3278b7b51ae764329310f6efd6908 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/fiddler-labs
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
publish.yml@f5b636cc64d3278b7b51ae764329310f6efd6908 -
Trigger Event:
workflow_dispatch
-
Statement type: