Changelog
Release history of ratel-ai-telemetry.
ratel-ai-telemetry release history · PyPI · source
Synced verbatim from the package's
CHANGELOG.mdatratel-ai/ratel@3be0ecb— do not edit by hand. Regenerate withpnpm sync:apiinapps/docs.
All notable changes to ratel-ai-telemetry (the Python telemetry helper) are documented here.
The format follows Keep a Changelog and this package adheres to Semantic Versioning.
[0.1.2] - 2026-07-11
Added
API_KEY_ENV(RATEL_API_KEY) and API-key environment fallback. Explicitapi_key=remains authoritative; the env fallback applies only when neitherapi_key=nor an explicitAuthorizationheader is given, so ambientRATEL_API_KEYnever clobbers a caller-supplied auth header.- On first setup,
init(enabled=False)returns an OTel-free no-op handle without endpoint configuration or the[otlp]extra; once Ratel owns the provider, repeated calls return it.ratel_span_processor(enabled=False)always returns a no-op processor. init(span_filter=...)filters the turnkey provider, and repeated/module-reloaded calls return the exact Ratel-owned handle while foreign providers still raise. If anotherinit()wins the registration race, the loser now returns that Ratel-owned handle instead of raising.- Public
TelemetryHandleprotocol describinginit()'s return (shutdown()/force_flush()).
Changed
init()is now typed to return aTelemetryHandle(shutdown handle), not aTracerProvider— the disabled/no-op path no longer masquerades as a full provider. Emit spans through the global OTel API (opentelemetry.trace.get_tracer(...)).init()shutdown is terminal: OTel's global provider is set once per process, so after the handle'sshutdown()a laterinit()raises instead of returning a provider whose exporter is dead. A shared handle'sshutdown()stops export for all callers.
[0.1.1] - 2026-07-10
Added
set_content_capture(mode): programmatic override of the content-capture gate. While set,content_capture_mode()returns the given mode regardless ofOTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT— code-level config wins over the environment, matching how OpenTelemetry treats env vars as the fallback for programmatic configuration. The mode is validated exactly like the env var (case-insensitive, trimmed, legacytrue/false/1/0forms accepted) and raises aValueErrornaming the valid values on anything unrecognized — failing loud at config time instead of storing a value that would both disable capture and mask the env var. PassNoneto clear unconditionally. Returns a generation token identifying the call as the current owner of the override.clear_content_capture(generation): clears the override only whengeneration(the token returned byset_content_capture) still identifies the most recent set. A stale token no-ops, so an old telemetry handle shutting down late cannot clobber an override a newer caller installed and silently flip capture back to the env value.
[0.1.0] - 2026-07-06
Added
- The telemetry helper (ADR-0015): the full
ratel.*vocabulary as constants (attribute keys, span/event names,gen_ai.*interop keys, and theOrigin/SearchTarget/AuthOutcomevalue enums) pinned to OpenTelemetry semconvgen_aiv1.42.0. init()sugar over the OpenTelemetry Python SDK: wires an OTLPhttp/protobufexporter toRATEL_URL(orendpoint=/headers=) with aservice.nameresource and batch processor, and returns the provider as a shutdown handle.content_capture_mode()reads theOTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENTgate (default off). OTel deps pinned below 1.42 to keep Python 3.9 support.- Shared contract-against-the-pin conformance suite (
../conformance/fixtures.json): spans built from the constants through the real SDK must emit the exact pinned keys. - Usage example in the README (runnable end-to-end in
examples/telemetry-python). ratel_span_processor()/ratel_span_exporter()+ the defaultratel_signal_filter: a composable OTLP span-processor for multi-provider coexistence. OpenTelemetry's model is one provider with many span-processors, so a partner already running one (e.g. Langfuse + the Vercel AI SDK) callsprovider.add_span_processor(ratel_span_processor(...))to dual-export to Ratel — forwarding only thegen_ai.*/ratel.*signal (overridable viaspan_filter), so the framework'sai.*wrapper noise stays out of Ratel. Resolvable top-level via the lazy accessor (a plainimport ratel_ai_telemetrystill pulls no OTel).- A regression guard that a plain
import ratel_ai_telemetrypulls no OpenTelemetry SDK.
Changed
- The OpenTelemetry SDK is an optional
[otlp]extra: importingratel_ai_telemetrypulls no OTel SDK (ADR-0015), so the SDK (emit), the server (read), and edge/serverless emitters take theratel.*vocabulary weight-free.init()lives in theratel_ai_telemetry.otlpsubmodule (behind the extra) and raises a clear "installratel-ai-telemetry[otlp]" error when it is absent; a lazy top-level accessor keepsfrom ratel_ai_telemetry import initworking. init()refactored ontoratel_span_processor(still exports every span — it owns the provider) and now raises, pointing atratel_span_processor, when aTracerProvideris already registered globally, instead of silently no-op'ing.- Released as an independent PyPI unit under the
telemetry-py-v*tag prefix.