Skip to main content

Module attr

Module attr 

Source
Expand description

OpenTelemetry GenAI semantic-convention attribute keys.

Constants§

AGENT_ID
AGENT_NAME
CACHE_CREATION_INPUT_TOKENS
Input tokens written to a provider-managed cache.
CACHE_READ_INPUT_TOKENS
Input tokens served from a provider-managed cache.
CONVERSATION_ID
ERROR_TYPE
FINISH_REASONS
INPUT_MESSAGES
INPUT_TOKENS
OPERATION
OTEL_NAME
The human-readable span name override consumed by OTel bridges.
OTEL_STATUS_CODE
tracing-opentelemetry special field: sets the OTel span status code ("ERROR" or "OK") when a bridge is attached.
OTEL_STATUS_MESSAGE
tracing-opentelemetry special field: sets the OTel span status description. Used here to carry the exception message, mirroring Python’s capture_exception (observability.py:1407-1411, which calls set_status(description=repr(exception))).
OUTPUT_MESSAGES
OUTPUT_TOKENS
PROMPT_NAME
Low-cardinality prompt name (e.g. for a named/templated prompt).
PROVIDER_NAME
Current semantic-convention replacement for SYSTEM; both are set from the same value so older and newer consumers each find what they expect on the span.
REASONING_OUTPUT_TOKENS
Output tokens spent on reasoning.
REQUEST_FREQUENCY_PENALTY
REQUEST_MAX_TOKENS
REQUEST_MODEL
REQUEST_PRESENCE_PENALTY
REQUEST_SEED
REQUEST_STOP_SEQUENCES
REQUEST_TEMPERATURE
REQUEST_TOP_P
RESPONSE_ID
RESPONSE_MODEL
SYSTEM
The provider/system tag, e.g. "openai". Supplied by the client.
SYSTEM_INSTRUCTIONS
Content-capture-gated: the system/instructions prompt, JSON-encoded as [{"type":"text","content":...}] (mirrors observability.py:1444-1448).
TOOL_CALL_ARGUMENTS
Content-capture-gated tool-call arguments (JSON-encoded).
TOOL_CALL_ID
TOOL_CALL_RESULT
Content-capture-gated tool-call result (JSON-encoded).
TOOL_DEFINITIONS
Content-capture-gated: the request’s tool list, JSON-encoded (mirrors _tools_to_dict, observability.py:1388-1391).
TOOL_DESCRIPTION
TOOL_NAME
TOOL_TYPE