Skip to main content

uptimes-agents (Python)

OpenTelemetry-based observability SDK for AI agents — three-line install, ships to the local uptimes-monitor daemon or direct to api.uptimes.ai.

Install

pip install uptimes-agents
# Add provider extras for auto-instrumentation:
pip install 'uptimes-agents[anthropic]'    # or [openai], or [all]

Quick start

import uptimes_agents
import anthropic

uptimes_agents.init(service_name="rca-agent")

client = anthropic.Anthropic()
client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=256,
    messages=[{"role": "user", "content": "hi"}],
)
# → one chat span lands in your Uptimes dashboard within ~5s.

Custom spans

For non-LLM work — init() activates auto-instrumentation for known provider SDKs; for everything else, wrap your code in a span:

with uptimes_agents.span("execute_plan", hypothesis="db_slow"):
    ...
    uptimes_agents.current_span().set_attribute("steps_taken", 4)

Configuration

Arg / env var Default Notes
service_name (kwarg) required Becomes agent_name in Uptimes
endpoint / UPTIMES_OTLP_ENDPOINT http://localhost:4318 OTLP/HTTP target
api_key / UPTIMES_API_KEY none Required only on direct-to-cloud
resource_attributes {} Extra OTel resource attrs
auto_instrument_providers True Set False to manage your own instrumentations

Standard OTel env vars (OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_TRACES_ENDPOINT) are honored — drop-in for existing OTel-instrumented apps.

Routing modes

Default is via the local monitor: spans go to http://localhost:4318 on the host. uptimes-monitor enriches them with host context, batches, and forwards over a single TLS connection to api.uptimes.ai. No API key needed in your app — the monitor's token stamps org_id.

For containerised environments without a host daemon, point straight at the cloud:

uptimes_agents.init(
    service_name="my-agent",
    endpoint="https://api.uptimes.ai/api/v1/telemetry",
    api_key="<your-org-token>",
)

The SDK appends telemetry-service's ingest path, so spans are POSTed to https://api.uptimes.ai/api/v1/telemetry/v1/traces/otlp. Don't put /v1/traces/otlp directly on the host: api.uptimes.ai is the API gateway, which serves telemetry-service only under /api/v1/telemetry. If an existing config uses a bare https://api.uptimes.ai or https://api.uptimes.ai/v1/traces/otlp, the SDK routes it through /api/v1/telemetry for you. The website domains uptimes.ai and www.uptimes.ai don't accept spans, so an endpoint on either is rewritten to https://api.uptimes.ai/api/v1/telemetry.

Only uptimes.ai / *.uptimes.ai hosts, or an endpoint whose path is telemetry-service's /v1/traces/otlp, count as direct-to-cloud (API key required, sent as X-API-Key). Any other endpoint — the monitor on localhost, a node IP, the in-cluster uptimes-monitor Service, or your own OTel collector — is treated as a plain OTLP/HTTP receiver: no key is needed or sent, and spans go to <endpoint>/v1/traces.

What gets captured

Auto-instrumentation produces OTel-GenAI spans for every Anthropic / OpenAI LLM call:

  • Provider, model, token usage, cost
  • Latency, time-to-first-chunk, stop reason
  • Tool calls (when the provider returns tool_use content)
  • Input / output content (governable via OTel content-capture toggles)

Custom span(...) blocks produce regular OTel spans you can group by name in the dashboard.

Versioning

V0.1 — Anthropic + OpenAI auto-instrumentation. Bedrock / Vertex / Gemini land in V0.2.

Metadata

Release files for uptimes-agents 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uptimes-agents 0.1.4
File Size Uploaded Provenance
uptimes_agents-0.1.4.tar.gz 23.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for uptimes-agents 0.1.4
File Interpreter ABI Platform
uptimes_agents-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 40.3 kB

Release files / uptimes_agents-0.1.4.tar.gz

Download URL uptimes_agents-0.1.4.tar.gz
Size 23.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9e4d9fa2730df8d9b2f4bcc61ad296fcc36fea6c74c204a0a04982644a07b45b
BLAKE2b-256 checksum
How to use checksums
5a8748d9b76a956abfb73a863be845fea36cfd280f1062d988c14c2e58cd9a01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / uptimes_agents-0.1.4-py3-none-any.whl

Download URL uptimes_agents-0.1.4-py3-none-any.whl
Size 16.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4112aaaf541f2598ccf935060bf9dfee7274a40f84c41369932e0323bcfc619d
BLAKE2b-256 checksum
How to use checksums
e8eddc2500de44dfa640531b47a22eedafe0c08dace4327d357e0953fda99493
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.15

Security for uptimes-agents 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page