agentic-otel
Normalization layer for OpenTelemetry GenAI agent traces. Parse once, analyze anywhere.
pip install agentic-otel
Why this exists
Every tool that analyzes AI agent traces re-implements the same parsing: span extraction, root finding, attribute parsing, timestamp handling, span classification. And every agent framework emits slightly different OTEL: camelCase vs. snake_case keys, KV-list vs. dict attributes, content in span attributes vs. span events, different operation names.
agentic-otel does that parsing once, correctly, with zero runtime dependencies — so trace-analysis tools can start from a consistent representation instead of raw JSON.
What it does
from agentic_otel import (
extract_spans, # OTLP resourceSpans or flat {"spans": [...]} -> list of span dicts
find_root, # locate the root span (parent-less, or earliest fallback)
parse_attrs, # KV-list or dict attributes -> flat dict
parse_timestamp, # unix nanos (int or str) -> datetime
DEFAULT_REGISTRY, # span classification rules
)
spans = extract_spans(raw_trace_json)
root = find_root(spans)
for span in spans:
result = DEFAULT_REGISTRY.classify(span)
print(span.get("name"), "->", result.span_type, f"(confidence: {result.confidence})")
# execute_tool lookup_formulary -> SpanType.TOOL_CALL (confidence: high)
Span classification
Spans are classified against the OTEL GenAI semantic conventions (gen_ai.operation.name, gen_ai.tool.name, gen_ai.request.model, ...) into: TOOL_CALL, MODEL_CALL, RETRIEVAL, AGENT_INVOCATION, EVENT_LOOP, HUMAN_REVIEW, or CUSTOM — each with a confidence score and the reason for the classification.
Framework detection
Traces are fingerprinted to the framework that produced them — Strands Agents, LangChain/LangGraph, PydanticAI, Claude Agent SDK — so downstream tools can handle framework-specific quirks (e.g., where message content lives) without their own detection logic.
Extensibility
Classification rules live in a SemanticConventionRegistry. New frameworks, operation names, or attribute conventions are added as registry entries, not code changes:
from agentic_otel import SemanticConventionRegistry
registry = SemanticConventionRegistry()
registry.register_tool_op("my_framework.tool_exec")
result = registry.classify(span)
framework = registry.detect_framework(raw_trace_json)
Normalized trace model
For tools that want a fully structured representation, OTELNormalizer produces a NormalizedTrace — typed NormalizedSpan entries with token usage, data source references, resolved parent/child relationships, and extracted input/output text — from a single parsing pass:
from agentic_otel import OTELNormalizer
trace = OTELNormalizer().normalize(raw_trace_json)
Format tolerance
Handles, without configuration:
- OTLP
resourceSpansexports and flat{"spans": [...]}dumps - Attribute lists (
[{"key": ..., "value": {"stringValue": ...}}]) and flat dicts camelCaseandsnake_casespan field names (traceId/trace_id)- Message content in span attributes or span events
- Nanosecond timestamps as integers or strings
Support and stability
This is a community open source project, not an AWS service or product.
- Support: community only, via GitHub issues. It is not covered by AWS Support plans, and there is no SLA.
- Stability: pre-1.0 and published with the
Development Status :: 4 - Betaclassifier. The API may change between minor versions; pin a version if you depend on it. - Warranty: provided "AS IS", without warranties or conditions of any kind, as stated in the Apache License 2.0 (Sections 7 and 8).
You are responsible for evaluating whether it fits your own compliance and operational requirements before relying on it.
License
Apache-2.0
Metadata
Release files for agentic-otel 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| agentic_otel-0.1.0.tar.gz | 42.5 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentic_otel-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 58.4 kB
Release files / agentic_otel-0.1.0.tar.gz
| Download URL | agentic_otel-0.1.0.tar.gz |
|---|---|
| Size | 42.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a4b85b437f7c2a0ccda5bd228e5c267cbf6bc30818e777d5bdc218c3531a231f
|
|
BLAKE2b-256 checksum How to use checksums |
6f961c22bd4fcded8a550fb354c90d527bc1865b741ccc42a3d584daee4e93ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency logRelease files / agentic_otel-0.1.0-py3-none-any.whl
| Download URL | agentic_otel-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1b1243c7eda3ea7afe2f5e44e42fcf67d72fad1f9ace27640c2687e72099ff1a
|
|
BLAKE2b-256 checksum How to use checksums |
47c46f504133aabba8d675c0ce90d073ba3a32391c74228c4ae905fe7b962198
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency logSecurity for agentic-otel 0.1.0
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for agentic_otel-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency logA 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.