Framework-agnostic agent behavior analytics — CIM-based telemetry for AI agents
Project description
observra
Framework-agnostic agent behavior analytics.
Capture every meaningful agent action (token usage, tool calls, cost, errors) with structured context based on the Common Information Model (CIM).
Zero custom instrumentation per-agent. Answer "what happened, how much did it cost, and was it normal?" for any agent on any framework.
Install
pip install observra
With framework extras:
pip install observra[adk] # Google ADK
pip install observra[claude] # Claude Agent SDK
pip install observra[openai-agents] # OpenAI Agents SDK
pip install observra[langchain] # LangChain / LangGraph
pip install observra[pydantic-ai] # Pydantic AI
With backend extras:
pip install observra[otel] # OTel span + log export
Install everything:
pip install observra[all]
Quick Start
import observra
from observra import log
observra.initialize(backend="jsonl", path="telemetry.jsonl")
log.session_start(agent_name="my-agent")
log.model_response("gpt-4o", input_tokens=500, output_tokens=200)
log.session_end(agent_name="my-agent")
Sample output (one line per event in telemetry.jsonl):
{"ts": "2025-01-15T10:23:45Z", "event_type": "model_response", "framework": "generic", "data": {"model": "gpt-4o", "in": 500, "out": 200, "cost_usd": 0.0035}}
Supported Frameworks
| Framework | Install | Status | Captured Events |
|---|---|---|---|
| Google ADK | [adk] |
Stable | LLM calls, tool calls, delegation depth, cost |
| Claude SDK | [claude] |
Stable | Tool calls, model responses, session cost |
| OpenAI Agents SDK | [openai-agents] |
Stable | Spans, tool calls, agent handoffs, cost |
| LangChain / LangGraph | [langchain] |
Stable | Chain runs, tool calls, LLM calls, cost |
| Pydantic AI | [pydantic-ai] |
Stable | Agent runs, tool calls, model calls |
Backends
| Backend | Install | Description |
|---|---|---|
| JSONL | (included) | Local JSON Lines file (default) |
| Webhook | (included) | Generic HTTP webhook POST delivery |
| Multi | (included) | Fan-out to multiple backends simultaneously |
| OTel Spans | [otel] |
Export events as OTel spans via OTLP HTTP |
| OTel Logs | [otel] |
Export events as OTel log records via OTLP HTTP |
OTel Export (Dynatrace, Grafana, etc.)
from observra.backends.otel import OTelExportBackend
from observra.backends.otel_log import OTelLogBackend
from observra.backends.multi import MultiBackend
# Spans only
span_backend = OTelExportBackend(
endpoint="https://your-collector/v1/traces",
headers={"Authorization": "Api-Token ..."},
service_name="my-agent-svc",
)
# Logs only
log_backend = OTelLogBackend(
endpoint="https://your-collector/v1/logs",
headers={"Authorization": "Api-Token ..."},
service_name="my-agent-svc",
)
# Both spans and logs
backend = MultiBackend([span_backend, log_backend])
Key Features
- Cost tracking — per-session cost with model-specific pricing catalog and threshold alerts
- PII redaction — automatic secret/PII masking with configurable patterns
- Non-blocking — drop-oldest queue guarantees zero latency impact on the host agent
- CIM-normalized — structured events compatible with SIEM/analytics pipelines
- Safe regex — ReDoS-proof pattern matching via RE2 (optional:
[safe-regex]) - Encryption at rest — AES field-level encryption for sensitive telemetry (optional:
[encryption]) - Prompt injection detection — built-in heuristics for injection attempt classification
- Observability —
get_metrics()/get_stats()for pipeline health introspection - Deduplication — automatic event dedup across backends
- Session context — trace/span/session ID propagation with scoped contexts
All Extras
| Extra | Dependencies |
|---|---|
[adk] |
google-adk>=1.0.0 |
[claude] |
claude-agent-sdk>=0.1.37, tiktoken>=0.7.0 |
[openai-agents] |
openai-agents>=0.9.0 |
[langchain] |
langchain-core>=1.0.0, langgraph>=0.2.0 |
[pydantic-ai] |
pydantic-ai<2.0.0, opentelemetry-sdk>=1.0.0 |
[otel] |
opentelemetry-sdk>=1.0.0, opentelemetry-exporter-otlp-proto-http>=1.0.0 |
[exabeam] |
requests>=2.32.0 |
[safe-regex] |
google-re2>=1.1 |
[encryption] |
cryptography>=41.0 |
[all] |
All of the above |
Documentation
- Getting Started — per-framework setup guides
- API Reference — public callables, config options, event examples
- Event Schema — CIM event contract
- Architecture — system design overview
- Compatibility — supported versions
Project sponsor
observra is sponsored by Exabeam. Exabeam contributed the initial code and continues to provide ongoing support and contributions to the project as part of its commitment to security in an increasingly agentic world.
License
Apache 2.0 — see LICENSE
Project details
Release history Release notifications | RSS feed
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 observra-1.0.3.tar.gz.
File metadata
- Download URL: observra-1.0.3.tar.gz
- Upload date:
- Size: 140.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03d5bd35c52f7fb209496184af7d52ad2b8f12b81adad150b014b912f08930cd
|
|
| MD5 |
2a3afb9bd6724c0a0929a2c1014bc4c1
|
|
| BLAKE2b-256 |
14812bbf4aad32be136e506796c240b38414cdbf53b92b2d9dd2e5b91a2a995a
|
Provenance
The following attestation bundles were made for observra-1.0.3.tar.gz:
Publisher:
publish.yaml on open-agent-ai-security/observra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
observra-1.0.3.tar.gz -
Subject digest:
03d5bd35c52f7fb209496184af7d52ad2b8f12b81adad150b014b912f08930cd - Sigstore transparency entry: 1929937616
- Sigstore integration time:
-
Permalink:
open-agent-ai-security/observra@ab3aa31b8c603472ab84d6a2613066f25bba2b05 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/open-agent-ai-security
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@ab3aa31b8c603472ab84d6a2613066f25bba2b05 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file observra-1.0.3-py3-none-any.whl.
File metadata
- Download URL: observra-1.0.3-py3-none-any.whl
- Upload date:
- Size: 173.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f059740b2c71b3cbe4c898c40c5da4ffcf6fc2ee312659d19f48a664424f630
|
|
| MD5 |
557535c771ba54d8a8837a1ffca31f4d
|
|
| BLAKE2b-256 |
17924fcf43a1fbaa680a9c07e69e86aa057a0b6003165847f74e936a57efa478
|
Provenance
The following attestation bundles were made for observra-1.0.3-py3-none-any.whl:
Publisher:
publish.yaml on open-agent-ai-security/observra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
observra-1.0.3-py3-none-any.whl -
Subject digest:
2f059740b2c71b3cbe4c898c40c5da4ffcf6fc2ee312659d19f48a664424f630 - Sigstore transparency entry: 1929937742
- Sigstore integration time:
-
Permalink:
open-agent-ai-security/observra@ab3aa31b8c603472ab84d6a2613066f25bba2b05 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/open-agent-ai-security
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@ab3aa31b8c603472ab84d6a2613066f25bba2b05 -
Trigger Event:
workflow_dispatch
-
Statement type: