Skip to main content

tracebloc-telemetry

Contract-conformant telemetry for tracebloc services. Implements RFC-BACKEND-1872 D2; the normative rules are rfcs/specs/backend-1872-telemetry-contract.md.

from tracebloc_telemetry import configure, emit

configure(service="backend", component="web")            # once, at startup
emit("api.request.failed", error_type="upstream_timeout")     # per occurrence

That is the whole surface, and that is the point of the ticket: a service adopts telemetry by importing this and nothing else. No exporter construction, no resource assembly, no field-naming decisions at the call site — those are the three things every service currently does differently, and the difference is the defect the epic exists to close.

Why it raises

The spec marks a dozen rules mechanically checkable. They are checked here, at emission, and a violation raises. A malformed telemetry record is a programming error; a warning in a log nobody reads is precisely how the current state was reached — 28,413 error traces collapsing to 12,254 distinct messages, 4,300+ records with no environment, one service split in half by the case of a free-text field.

Enforced: the <domain>.<object>.<outcome> grammar with its closed vocabularies, the attribute-key namespace, retired field names, value types, and the error set a failure record must carry (including the stacktrace — 0.2% carry one today).

Why the exporter is optional

The OpenTelemetry SDK is an extra (pip install tracebloc-telemetry[otlp]). Without it, every contract rule is still enforced and records go to the standard library logger.

Two things follow. A service can adopt the contract and test against it before changing a single runtime dependency — which is what keeps this ticket independent of the four migrations it unblocks. And local and ci cannot export by accident, because they must never reach the hub (spec §3.2).

What this does NOT do: redaction

It applies none. Values are checked for type and bounded to 2,048 characters; nothing inspects their content, and a 2,048-character bound does nothing to a customer cell value, which is short.

This matters because §8.4 requires exception.message and exception.stacktrace together once either is present — the two fields likeliest to carry a raw value. backend#1879 found the live version of that (raw customer cell values reaching central App Insights from prod), and the policy line lives in data-ingestors/tracebloc_ingestor/utils/redaction.py: cell values never appear in errors or logs; column names, file names, counts, dtypes and row indices may.

Collector-side redaction is backend#1908. Until it lands, keeping customer data out of an exception message is the caller's guarantee, not this package's.

Where this lives, and where it is going

It lives in backend/ today and is developed and tested here. It carries its own pyproject.toml so that extraction is a move rather than a rewrite.

It is not yet consumable by the other three Python services, which are separate repositories — that needs a repo of its own and a PyPI publish path through the release train, and it needs org-admin action to create. Until then backend#1898 consumes it in-tree and #1899/#1900/#1901 wait. This is a stated limitation, not an oversight.

The one thing CI cannot check

The registry in _registry.py is a copy of the spec's tables, and the spec is in a different repository, so nothing in this repo's CI can prove the two still agree. Keeping them in step is a review rule.

Everything decidable from inside this repo is checked: the vocabularies are closed and internally consistent, every domain/outcome pair forms a legal event name, and — the one that matters — the environment classification is derived from the backend's own _KNOWN_ENVS dispatcher tuple rather than restated, so adding an environment there fails this package's tests until someone decides whether it exports. Vendoring the spec's tables as a generated data file is the fix for the rest, and is a follow-up.

Release files for tracebloc-telemetry 0.1.0

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

Source distribution (sdist)

Source distribution for tracebloc-telemetry 0.1.0
File Size Uploaded
tracebloc_telemetry-0.1.0.tar.gz 37.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tracebloc-telemetry 0.1.0
File Interpreter ABI Platform
tracebloc_telemetry-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 60.1 kB

Release files / tracebloc_telemetry-0.1.0.tar.gz

Download URL tracebloc_telemetry-0.1.0.tar.gz
Size 37.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a34d0295b04f7420621723d37cb8c069700d46dcd7e5abd32e82f1406e8f6ea2
BLAKE2b-256 checksum
How to use checksums
aa56804b24fb2c4c64a0f215dd3def8fa04ee94ce67b6e34237a990caab13620
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 15, 2026.

Transparency log

Release files / tracebloc_telemetry-0.1.0-py3-none-any.whl

Download URL tracebloc_telemetry-0.1.0-py3-none-any.whl
Size 23.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f03bee82bac2cf6e26c2b5001e0aeb63415c9421534601cb065c8bfa5e2d23c7
BLAKE2b-256 checksum
How to use checksums
6c1fca56c558231f3355567194c7be767e924a2d73a273452397025efa9bfee0
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 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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