Ratel telemetry conventions — the ratel.* overlay on OpenTelemetry gen_ai spans. init() helper and constants for the Ratel context engineering platform.
Project description
ratel-ai-telemetry (Python)
The ratel.* telemetry helper for Python: the constants that codify the Tier 2 overlay
of ../CONVENTIONS.md (attribute keys, span/event names, the
Origin/SearchTarget/AuthOutcome value enums, the pinned semconv version), plus
init() sugar over the standard OpenTelemetry Python SDK. init() wires an OTLP
http/protobuf exporter to RATEL_URL (or endpoint=/headers=) and returns the
provider as a shutdown handle; a caller already running the OTel SDK skips it and takes
only the constants. This package adds no custom transport, no native binding, no schema
(ADR-0015).
Usage
from opentelemetry import trace
from ratel_ai_telemetry import (
EXECUTE_TOOL,
GEN_AI_OPERATION_NAME,
GEN_AI_TOOL_NAME,
RATEL_ORIGIN,
Origin,
init,
)
# Wire the OTLP exporter to RATEL_URL once at startup (or pass endpoint=/headers=).
provider = init(api_key="sk-...")
# Emit a standard gen_ai `execute_tool` span enriched with the ratel.* overlay.
span = trace.get_tracer("my-agent").start_span(
EXECUTE_TOOL,
attributes={
GEN_AI_OPERATION_NAME: EXECUTE_TOOL,
GEN_AI_TOOL_NAME: "send_email",
RATEL_ORIGIN: Origin.AGENT.value,
},
)
span.end()
provider.shutdown() # flush the exporter on exit
Already running the OTel SDK? Skip init() and take only the constants. A complete,
offline-runnable version (console exporter + a ratel.search → execute_tool trace) is in
examples/telemetry-python.
Package shape
- Distribution name:
ratel-ai-telemetry; import name:ratel_ai_telemetry - Pure Python (hatchling build, no Rust extension); depends on the OpenTelemetry Python SDK for
init() - Targets Python >=3.9 (the OTel deps are pinned below 1.42, the last line supporting 3.9)
- Released under the
telemetry-py-v*tag prefix (ADR-0016) - MIT (ADR-0017)
Build & test
From this directory (needs uv):
uv venv --python 3.11 .venv
uv pip install --python .venv -e '.[dev]'
.venv/bin/ruff check . && .venv/bin/mypy ratel_ai_telemetry && .venv/bin/pytest
Unlike the Python SDK there is no maturin develop step — the package is pure Python,
installed editable. The tests cover the vocabulary (each constant asserted against the
pin), init()'s endpoint/auth resolution and the content-capture gate, and the shared
contract-against-the-pin conformance in ../conformance/
(spans built from these constants through the real SDK must emit the exact pinned keys).
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 ratel_ai_telemetry-0.1.0rc2.tar.gz.
File metadata
- Download URL: ratel_ai_telemetry-0.1.0rc2.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68a8aa2109f47ff068019eb9e973182747acd60be26dc04423534756d2341d6e
|
|
| MD5 |
4a2c759ba4b0b8f19b7b057af166e858
|
|
| BLAKE2b-256 |
328a6ebc9ff3483d8cfdb70399d71d8bb658edbf47d05af8472e45660d7e813a
|
Provenance
The following attestation bundles were made for ratel_ai_telemetry-0.1.0rc2.tar.gz:
Publisher:
release.yml on ratel-ai/ratel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ratel_ai_telemetry-0.1.0rc2.tar.gz -
Subject digest:
68a8aa2109f47ff068019eb9e973182747acd60be26dc04423534756d2341d6e - Sigstore transparency entry: 2082718857
- Sigstore integration time:
-
Permalink:
ratel-ai/ratel@62d09c392ad964275e892032b6efba1c46133609 -
Branch / Tag:
refs/tags/telemetry-py-v0.1.0-rc.2 - Owner: https://github.com/ratel-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@62d09c392ad964275e892032b6efba1c46133609 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ratel_ai_telemetry-0.1.0rc2-py3-none-any.whl.
File metadata
- Download URL: ratel_ai_telemetry-0.1.0rc2-py3-none-any.whl
- Upload date:
- Size: 8.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 |
ec0320f27b743cae973d966ca28eb38d420f282de7ea1747167728f0f36fc311
|
|
| MD5 |
a1ee0c8291116bbaad644cf232a8e705
|
|
| BLAKE2b-256 |
fefa06d03f933f58a022e2fbc96140eb4246557a193cecdeba5e905371b3885c
|
Provenance
The following attestation bundles were made for ratel_ai_telemetry-0.1.0rc2-py3-none-any.whl:
Publisher:
release.yml on ratel-ai/ratel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ratel_ai_telemetry-0.1.0rc2-py3-none-any.whl -
Subject digest:
ec0320f27b743cae973d966ca28eb38d420f282de7ea1747167728f0f36fc311 - Sigstore transparency entry: 2082718868
- Sigstore integration time:
-
Permalink:
ratel-ai/ratel@62d09c392ad964275e892032b6efba1c46133609 -
Branch / Tag:
refs/tags/telemetry-py-v0.1.0-rc.2 - Owner: https://github.com/ratel-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@62d09c392ad964275e892032b6efba1c46133609 -
Trigger Event:
push
-
Statement type: