Skip to main content

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 managerswith blocks for automatic lifecycle management
  • Async supportasync with for 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

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

sentro_sdk-0.1.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sentro_sdk-0.1.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sentro_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for sentro_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4aeb3a788d0f974fe911672c33e81ec72a8787d550a92e5e8094fba7e5195338
MD5 86375fd7d82e7cd081d82ed8efc67122
BLAKE2b-256 15e28a14890b011710324ba941e2ced79fec5905a6169213ab7af77fef5effd0

See more details on using hashes here.

File details

Details for the file sentro_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sentro_sdk-0.1.0-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

Hashes for sentro_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b5a118e3a0c2c75dcd2be760da299c10d902e411a20edb12f24e7f0d26dddcf
MD5 1879cdc0ed77fd0293c09bed1190748f
BLAKE2b-256 c30b2ff509fa10c9d0db208b11ea97d5f957b5a482c9b4ada52b38984985af79

See more details on using hashes here.

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