Python SDK for Sentro — error tracking and agent observability for AI agents
Project description
Sentro Python SDK
Error tracking and agent observability for AI agents. Zero dependencies.
Sentro is an open-source Sentry alternative built specifically for AI agents. This SDK gives you full observability into your agent runs — every step, tool call, LLM call, token count, and cost.
Install
pip install sentro-sdk
Quick Start
Error tracking
from sentro import Sentro
sentro = Sentro(dsn="http://token@localhost:3000/api/ingest/proj_1")
try:
do_something()
except Exception as e:
sentro.capture_exception(e)
Agent observability
from sentro import Sentro
sentro = Sentro(dsn="http://token@localhost:3000/api/ingest/proj_1")
with sentro.trace("order-processor", goal="Process refund #456") as run:
with run.trace("Looking up order") as step:
# Track tool calls
with step.trace_tool_call("db.query", input={"sql": "SELECT 1"}) as tool:
result = db.query("SELECT 1")
tool.set_result(result)
# Track LLM calls
llm = step.llm_call(model="claude-sonnet-4-6")
response = call_llm("Approve refund?")
llm.end(prompt_tokens=150, completion_tokens=20, cost=0.001)
# Auto-ends on exit, auto-errors on exception
Async support
async with sentro.trace("async-agent", goal="Async task") as run:
async with run.trace("Step 1") as step:
result = await some_async_work()
Features
- Zero dependencies — standard library only, works in any Python 3.10+ environment
- Context managers —
withblocks for automatic lifecycle management - Async support —
async withfor async frameworks - Auto error capture — exceptions automatically mark runs as failed
- Batched transport — events are batched and sent efficiently
- Run tracing — full agent execution timeline
- Step replay — ordered reasoning chain with tool and LLM call details
- Cost tracking — token counts and cost per LLM call
Configuration
sentro = Sentro(
dsn="http://token@localhost:3000/api/ingest/proj_1",
default_tags={"env": "production", "version": "1.0.0"},
)
Links
- GitHub: github.com/yzzztech/sentro
- Docs: Available at
/docswhen running Sentro - TypeScript SDK:
npm install @sentro/sdk
License
MIT
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 sentro_sdk-0.1.1.tar.gz.
File metadata
- Download URL: sentro_sdk-0.1.1.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7dfa60779f44c8087f65a83316eb91ba030621ea343a854d10149b33222f23e
|
|
| MD5 |
efa0032b4ed741fce87c2ba1f7f04870
|
|
| BLAKE2b-256 |
ce92ee7c7d704bdad0766ae67d7a87a04f05c82e3898e8bc8365ca780b6995c2
|
File details
Details for the file sentro_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: sentro_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0f66e4c137206c7a6b8a189329f7ef5ffbda5a79036db5e49b126ec4b03e7ab
|
|
| MD5 |
a6fc2f4c1bb0258a7df793a2dd251313
|
|
| BLAKE2b-256 |
54950038fbd9c69ed1d320ca7c15c5a68f12cfac1ffc121c5bd434b1127db887
|