Skip to main content

Module otel_content

Module otel_content 

Source
Expand description

Full-content OpenTelemetry export to the tenant collector.

TenantContentSink turns every journaled step into an OpenTelemetry span that follows the GenAI semantic conventions (https://github.com/open-telemetry/semantic-conventions-genai):

  • a chat call (request record plus terminal response record, joined by their response-attempt id) becomes one chat {model} span of kind CLIENT with gen_ai.input.messages, gen_ai.output.messages, token usage, finish reasons, and gen_ai.conversation.id (the session);
  • a tool authorization becomes an execute_tool {tool} span with the tool name, call id, and arguments, plus the gateway’s verdict;
  • a tool completion becomes an execute_tool.result span carrying gen_ai.tool.call.result;
  • every other audit event becomes an agentvisor.{class} span carrying the redacted event.

Every content field passes through the redaction engine (the built-in patterns plus the configured redaction_patterns and redaction_paths) before it becomes an attribute, even when journal redaction is off. The sink exports through its own tracer provider, whose only exporter is the tenant endpoint, so the operator’s collector never receives content.

Structs§

TenantContentSink
Content sink exporting GenAI spans to the tenant collector.

Constants§

MAX_ATTRIBUTE_BYTES
Longest content attribute exported; longer values are truncated with a marker that states how many bytes were cut.

Functions§

bounded
Truncate at a character boundary so no attribute exceeds the limit.
now_ms
Wall-clock milliseconds, for records built outside the worker.