Python SDK
The SideSeat Python SDK (sideseat) provides OpenTelemetry instrumentation with automatic binary data handling, framework detection, and multiple export options. Stream runs into the local AI development workbench while keeping your stack intact.
What you’ll learn:
- Install and configure the Python SDK
- Set up OTLP, console, and file exporters
- Handle binary data and framework detection
Prerequisites
Section titled “Prerequisites”- SideSeat running locally (
sideseat) - Python 3.9+
Installation
Section titled “Installation”pip install sideseat# oruv add sideseatOr with your package manager:
pip install sideseatuv add sideseatpoetry add sideseatQuick Start
Section titled “Quick Start”Add two lines at the top of your entry point:
from sideseat import SideSeat, FrameworksSideSeat(framework=Frameworks.Strands)
# Your existing codefrom strands import Agent
agent = Agent()response = agent("Hello!")That’s it. Runs flow to SideSeat at http://localhost:5388.
Features
Section titled “Features”Automatic Framework Detection
Section titled “Automatic Framework Detection”The SDK auto-detects your AI framework and sets the service name:
| Priority | Package | Service Name |
|---|---|---|
| 1 | strands-agents | strands-agents |
| 2 | langchain-core | langchain-core |
| 3 | crewai | crewai |
| 4 | autogen-agentchat | autogen-agentchat |
| 5 | agents | agents |
| 6 | google-adk | google-adk |
| 7 | pydantic-ai | pydantic-ai |
Override with:
SideSeat(service_name="my-custom-service")Binary Data Handling
Section titled “Binary Data Handling”AI frameworks often use binary data (images, audio). The SDK automatically encodes binary data as base64:
# Default: encode binary as base64client = SideSeat(encode_binary=True)
# Disable if not needed (saves bandwidth)client = SideSeat(encode_binary=False)Debug Exporters
Section titled “Debug Exporters”Configure additional exporters for debugging:
client = SideSeat()
# Console (for debugging)client.telemetry.setup_console_exporter()
# File (JSONL format)client.telemetry.setup_file_exporter("traces.jsonl")Resource Attributes
Section titled “Resource Attributes”The SDK automatically sets these OpenTelemetry resource attributes:
| Attribute | Value |
|---|---|
service.name | Auto-detected or user-provided |
service.version | Package version (if detected) |
telemetry.sdk.name | sideseat |
telemetry.sdk.version | SDK version |
telemetry.sdk.language | python |
Context Manager
Section titled “Context Manager”Use the context manager for automatic shutdown:
with SideSeat() as client: # Your code here# Traces flushed and connection closed automaticallyGraceful Shutdown
Section titled “Graceful Shutdown”The SDK registers an atexit handler for automatic shutdown. You can also call it explicitly:
client = SideSeat()
# ... your code ...
# Flush all pending spans before exitclient.shutdown()Next Steps
Section titled “Next Steps”- Configuration — detailed configuration options
- API Reference — SideSeat class reference
- Exporters — console and file exporters for debugging