Skip to content

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
  • SideSeat running locally (sideseat)
  • Python 3.9+
Terminal window
pip install sideseat
# or
uv add sideseat

Or with your package manager:

Terminal window
pip install sideseat

Add two lines at the top of your entry point:

from sideseat import SideSeat, Frameworks
SideSeat(framework=Frameworks.Strands)
# Your existing code
from strands import Agent
agent = Agent()
response = agent("Hello!")

That’s it. Runs flow to SideSeat at http://localhost:5388.

The SDK auto-detects your AI framework and sets the service name:

PriorityPackageService Name
1strands-agentsstrands-agents
2langchain-corelangchain-core
3crewaicrewai
4autogen-agentchatautogen-agentchat
5agentsagents
6google-adkgoogle-adk
7pydantic-aipydantic-ai

Override with:

SideSeat(service_name="my-custom-service")

AI frameworks often use binary data (images, audio). The SDK automatically encodes binary data as base64:

# Default: encode binary as base64
client = SideSeat(encode_binary=True)
# Disable if not needed (saves bandwidth)
client = SideSeat(encode_binary=False)

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")

The SDK automatically sets these OpenTelemetry resource attributes:

AttributeValue
service.nameAuto-detected or user-provided
service.versionPackage version (if detected)
telemetry.sdk.namesideseat
telemetry.sdk.versionSDK version
telemetry.sdk.languagepython

Use the context manager for automatic shutdown:

with SideSeat() as client:
# Your code here
# Traces flushed and connection closed automatically

The SDK registers an atexit handler for automatic shutdown. You can also call it explicitly:

client = SideSeat()
# ... your code ...
# Flush all pending spans before exit
client.shutdown()