agentic_otel 0.3.1
agentic_otel: ^0.3.1 copied to clipboard
OpenTelemetry export for the agentic framework: agent, model and tool spans sent over OTLP to any backend, with the GenAI semantic conventions.
Changelog #
0.3.1 #
- Updated package documentation for the published 0.3.x release line.
0.3.0 #
Initial release, at the framework's current version.
OtlpHttpSpanExportersends spans to any OTLP endpoint over HTTP with a JSON body — no protobuf dependency and no build step. A failed export is reported throughonErrorand dropped, never thrown into the code that produced the span: telemetry that breaks a run is worse than no telemetry.BatchSpanExporterbuffers spans so export costs one request rather than one per span, which on a phone is one TLS handshake rather than thirty. A full queue drops the oldest and counts them; a rejected batch is dropped rather than retried into a collector that is down.OtlpResourcedescribes what produced the spans. SettingserviceNameis the difference between a usable trace view and one where everything isunknown_service.GenAiAttributes,GenAiOperations, and thegenAiChatAttributes,genAiToolAttributesandgenAiAgentAttributeshelpers: the OpenTelemetry GenAI semantic conventions, which are what make a backend render an LLM span as an LLM span rather than as a generic one.encodeSpans,encodeSpanandencodeAttributesare public, so an application with its own transport can use the encoding without the client.
Prompts and completions are deliberately not exported. The attribute keys are here; attaching content is a line the application writes, after deciding what redaction applies.