ai-python-telemetry
Installation
SKILL.md
ai-python-telemetry
ai.experimental_telemetryis experimental: it may change or be removed.
Enable telemetry
- Nothing is reported until an adapter is registered or a sink is routed;
with telemetry off, spans are no-ops (
id="", no clock reads,push()does nothing). Check withis_enabled(). - OpenTelemetry export: perform the standard OpenTelemetry ceremony (tracer
provider + OTLP exporter), then
ai.experimental_telemetry.register(otel.OtelAdapter()). Requires theai[otel]extra. - Message content capture is opt-in:
otel.OtelAdapter(capture_content=True)orOTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true. - Call
OtelAdapter.flush()before a checkpoint andOtelAdapter.shutdown()at process exit; the exporter buffers.