Releases: open-telemetry/opentelemetry-python-genai
Releases · open-telemetry/opentelemetry-python-genai
Release list
opentelemetry-util-genai 1.2b0
Added
- Add
decode_base64andimage_from_urlhelpers for converting provider image payloads anddata:URLs intoBlob/Urimessage parts. (#296) - Add
conversation_idattribute toWorkflowInvocationto capturegen_ai.conversation.idon workflow spans. (#350) - Add a settable
conversation_idto inference and workflow invocations, emitted asgen_ai.conversation.id. (#474) - Add
GenAIInvocation.record_stream_chunk()so callback-based instrumentations can report streaming timing without wrapping the SDK's stream. (#482) - Add a
Roleenum mirroring the message roles the GenAI semantic conventions define, which the generated semconv package does not expose (#506) - Add
agent_namekwarg toTelemetryHandler.tool(); when set,gen_ai.agent.nameis written on theexecute_toolspan (#512) - Add
GenAIInvocation.should_capture_contentproperty. (#593) - Add SystemInstructionPart model, align GenericPart with semantic conventions by removing value, and update invocation types. (#612)
- Add
cache_write_input_tokensand modality token breakdown attributes (text_*,image_*,audio_*) to invocations. (#613) - Add
reasoning_level,previous_response_id,conversation_compacted, andprompt.*attributes to inference invocations. (#614) - Record
gen_ai.execute_tool.durationon tool invocations and aligngen_ai.invoke_workflow.durationattributes and bucket boundaries with semantic conventions. (#615) - Add
LocalAgentInvocationandRemoteAgentInvocationfor in-process and remote agent invocations. (#616) - Add instrumentation_scope_name and instrumentation_scope_version to TelemetryHandler so telemetry carries the instrumentation library's scope (#632)
- Add
suspend()andactivate()to GenAI invocations for handing context back to the caller while the invocation is still running,SyncToolStreamWrapper/AsyncToolStreamWrapperfor streaming tool executions, andRetrievalDocumentmodel. (#673) - Add
InferenceInvocation.set_input_tokens,set_output_tokensandset_cache_read_input_tokensfor recording per-modality token breakdowns, and addtexttoModality. (#674) - Add
contextproperty toGenAIInvocationand optionalcontextparameter toTelemetryHandler.tool. (#704) - Add
conversation_idandcontextarguments to the inference, agent and workflow factories onTelemetryHandler; nested invocations inherit the conversation id. (#726) - Add
bind_arguments,get_argument, andget_signatureutilities for signature-based parameter extraction. (#740) - Add optional
contextparameter to TelemetryHandler methods and invocation classes. (#758) - Add the shared RetrievalDocument model with optional id and score fields; retain legacy mapping support on retrieval invocations. (#775)
Changed
- Tool definitions are not emitted when content capture is disabled (#377)
- Align message-part class names with semconv (*Part suffix). Rename Text/Blob/File/Uri/Reasoning/ToolCallRequest/ToolCallResponse/ServerToolCall/ServerToolCallResponse to their *Part forms to match semantic-conventions-genai models. (#450)
- Remove
tool_call_idandtool_descriptionfromexecute_toolstart attributes and set them on the invocation instance instead. (#577) - Add optional name field to InputMessage and OutputMessage, and make finish_reason optional in OutputMessage. (#611)
- Record
top_kon retrieval spans as integergen_ai.retrieval.top_k. (#614) - Record
gen_ai.invoke_agent.durationon local agent invocations. (#616) - An invocation started with an explicit
contextnow uses it as the base of its own context, not only to parent the span, so entries the caller put on it stay visible to nested invocations. (#726) - Inline invocation span initialization into
GenAIInvocation.__init__. (#741) - Replace the Modality literal type alias with string enum constants while preserving raw-string support in message parts and token helpers. (#749)
Deprecated
- Deprecate the message part classes
Text,Reasoning,Blob,File,Uri,ToolCallRequest,ToolCallResponse,ServerToolCallandServerToolCallResponse; they remain available as aliases of their *Part replacements. (#450) - Deprecate passing
tool_call_idandtool_descriptionas keyword arguments tohandler.tool(). (#577) - Deprecate
should_capture_content_on_spans()andToolInvocation.should_capture_content_on_spanin favor ofGenAIInvocation.should_capture_content. (#593) - Deprecate
OutputMessage.finish_reason. Report finish reasons viagen_ai.response.finish_reasonsinstead. (#611) - Deprecate
cache_creation_input_tokensin favor ofcache_write_input_tokens. (#613) - Deprecate get_telemetry_handler, construct and cache a TelemetryHandler instead. (#632)
- Deprecate
should_emit_event(). Event emission is handled internally by telemetry handlers and invocations. (#746)
Removed
- Remove internal
InvocationMetricsRecorder,instruments.py, andmetrics.py. (#615) - Remove agent_id and agent_version start-time parameters from invoke_remote_agent; set them on the returned invocation instead. (#729)
Fixed
- Record
gen_ai.invoke_workflow.durationmetric on workflow invocations (WorkflowInvocation). (#350) - Record cancellation as a failure: the invocation context manager finalized any non-
ExceptionBaseException(asyncio.CancelledError,KeyboardInterrupt,SystemExit,GeneratorExit) through the success path, so cancelled operations were exported with an unset span status and noerror.type. (#520) - Finalize stream telemetry when stream iteration, close, or manager entry/exit is cancelled. (#656)
- Change
InferenceInvocation.top_ktype fromfloattoint. (#707) - Wrap programmatic completion hooks in safe wrapper to suppress exceptions. (#750)
opentelemetry-instrumentation-google-genai 1.2b0
Added
- Record modality token usage breakdown attributes (text, image, audio) for interactions. (#613)
- Record modality token usage breakdown attributes (text, image, audio) for generate_content. (#674)
- Record
gen_ai.client.operation.time_to_first_chunkandgen_ai.client.operation.time_per_output_chunkmetrics on streamed responses. (#711) - Capture generation configuration and output format attributes for synchronous, asynchronous, and streaming Interactions requests. (#752)
- Add
fetch_responsespans for Google GenAIinteractions.get, including streamed and resumed retrieval. (#755)
Changed
- Bump the minimum
opentelemetry-util-genaiversion to 1.2b0. (#365) - Tool definitions are not emitted when content capture is disabled (#377)
Fixed
- Record failed Google Interactions streaming requests instead of leaving their spans open. (#538)
- Emit telemetry under the
opentelemetry.instrumentation.google_genaiinstrumentation scope instead ofopentelemetry.util.genai.handler(#632) - Record failed Google GenAI interaction invocations when cancellation raises a
BaseException. (#656) - Capture provider-executed tool calls and results as server tool message parts. (#701)
- Do not record
gen_ai.embeddings.dimension.counton metrics. (#708)
opentelemetry-instrumentation-genai-smolagents 1.2b0
Added
- Add
invoke_agentspans for streaming and non-streamingMultiStepAgent.run()calls. (#403)
Changed
- Bump the minimum
opentelemetry-util-genaiversion to 1.2b0. (#365) - Tool definitions are not emitted when content capture is disabled (#377)
- Record metric
gen_ai.invoke_agent.durationinstead ofgen_ai.client.operation.duration. (#616)
Fixed
opentelemetry-instrumentation-genai-qwen-agent 1.2b0
opentelemetry-instrumentation-genai-portkey 1.2b0
Added
- Add Portkey AI instrumentation (#465)
- Add inference and streaming span instrumentation for Portkey (#466)
- Record cache-write, cache-read, reasoning, and explicit text, image, and audio token usage for chat and prompt completions, including streamed responses. (#751)
Changed
- Tool definitions are not emitted when content capture is disabled (#377)
- Bump the minimum
opentelemetry-util-genaiversion to 1.2b0. (#575)
Fixed
opentelemetry-instrumentation-genai-openai 1.2b0
Added
- Capture OpenAI multimodal image content (
image_urland Responses APIinput_image) asBlobPart,UriPart, orFilePartmessage parts. (#540) - Record
cache_write_input_tokensfrom response usage. (#613) - Capture cached prompt tokens -
gen_ai.usage.cache_read.input_tokenson chat completions (#662) - Capture reasoning tokens -
gen_ai.usage.reasoning.output_tokenson chat completions (#680)
Changed
- Bump the minimum
opentelemetry-util-genaiversion to 1.2b0. (#365) - Tool definitions are not emitted when content capture is disabled (#377)
- Populate name attribute on captured input messages when available. (#611)
Fixed
- Capture the remaining OpenAI content parts:
input_audioas an audio blob,file/input_fileas a document reference or blob, andrefusalas text; record a completion refusal ingen_ai.output.messages. (#358) - Stop consuming generator message
contentwhile capturing input messages, which left the wrapped request with no content at all. Capture afilepart's inline base64file_dataand take its media type fromfilename. (#522) - Record response telemetry for
with_streaming_responsecalls on the async client, whoseparse()returns a coroutine, and end the span for a parsed stream the caller abandons. (#610) - Record
gen_ai.tool.definitionson Responses APIcreateandstreamspans. (#625) - Record
gen_ai.conversation.idfrom the Responses APIconversationrequest parameter. (#631) - Emit telemetry under the
opentelemetry.instrumentation.genai.openaiinstrumentation scope instead ofopentelemetry.util.genai.handler(#632) - Record
function_call,custom_tool_calland their output items on Responses API spans, so a turn that follows a tool call keeps its tool-loop history ingen_ai.input.messages. (#650) - Record failed OpenAI invocations when cancellation raises a
BaseException. (#656) - Capture provider-executed Responses API tools in output messages. (#700)
- Do not record
gen_ai.embeddings.dimension.counton metrics. (#708) - Do not record
gen_ai.request.streamonfetch_responsespans. (#709) - Keep the
gen_ai.conversation.idinherited from an enclosing agent framework when a Responses request carries noconversationparameter (#726)
opentelemetry-instrumentation-genai-openai-agents 1.2b0
Changed
- Bump the minimum
opentelemetry-util-genaiversion to 1.1b0, whereError.typebecame theerror.typestring value. (#485) - Bump the minimum
opentelemetry-util-genaiversion to 1.2b0. (#593) - Record metrics
gen_ai.invoke_agent.durationandgen_ai.execute_tool.durationinstead ofgen_ai.client.operation.duration. (#616)
Fixed
- Mark tool and agent span errors recorded on the agents-library Span.error (#485)
- Record
gen_ai.tool.call.argumentsonexecute_toolspans. (#588) - Emit telemetry under the
opentelemetry.instrumentation.genai.openai_agentsinstrumentation scope instead ofopentelemetry.util.genai.handler(#632) - Do not record
gen_ai.provider.nameon tool execution metric attributes. (#710) - Record
gen_ai.conversation.idfromRunConfig.group_idoninvoke_workflowandinvoke_agentspans, and propagate it to thechatspan emitted by the model SDK instrumentation. (#726)
opentelemetry-instrumentation-genai-llama-index 1.2b0
Added
- Add skeleton and boilerplate for LlamaIndex instrumentation package (
opentelemetry-instrumentation-genai-llama-index). (#309) - Add agent invocation and tool execution spans for LlamaIndex agents. (#494)
- Add tracing for LlamaIndex AgentWorkflow runs and member agent executions. (#668)
- Add retrieval span instrumentation for LlamaIndex
BaseRetrieveroperations. (#698)
Changed
- Tool definitions are not emitted when content capture is disabled (#377)
- Record metrics
gen_ai.invoke_agent.durationandgen_ai.execute_tool.durationinstead ofgen_ai.client.operation.duration. (#616) - Simplify tool context propagation using invocation context. (#704)
- Use the shared RetrievalDocument model to capture only document IDs and scores, with null for unavailable scores, instead of node text. (#775)
Fixed
- Emit telemetry under the
opentelemetry.instrumentation.genai.llama_indexinstrumentation scope instead ofopentelemetry.util.genai.handler(#632) - Keep one invoke_agent span open across an AgentWorkflow member's tool loop, parent execute_tool spans to the requesting agent, and keep a handing-off agent's span open until every tool call of that turn ends. (#668)
- Exclude broken llama-index-workflows 2.24.0 and declare companion library bounds. (#739)
opentelemetry-instrumentation-genai-langchain 1.2b0
Added
- (OpenInference Migration: LangChain) - Capture multimodal image content (OpenAI
image_urland Responses APIinput_image, Anthropicimage, and LangChain standardimageblocks) asBlobPart/UriPart/FilePartmessage parts. (#296) - Capture document relevance score on retrieval spans per OpenTelemetry GenAI semantic conventions. (#670)
- Record
cache_write_input_tokensand modality token breakdown attributes (text,image,audio) from LangChain usage metadata onInferenceInvocation. (#671) - Capture request model from ls_model_name metadata on chat (#682)
- Capture top_k -
gen_ai.request.top_kand choice count -gen_ai.request.choice.counton chat (#684) - Record finish_reasons from chat generation metadata. (#705)
- Classify agent chains by name on on_chain_start (#766)
Changed
- Bump the minimum
opentelemetry-util-genaiversion to 1.2b0. (#365) - Tool definitions are not emitted when content capture is disabled (#377)
- Raised the opentelemetry-util-genai dependency floor to 1.2b0 for
GenAIInvocation.record_stream_chunk(#482) - Populate name attribute on captured input and output messages when available. (#611)
- Record metrics
gen_ai.invoke_agent.durationandgen_ai.execute_tool.durationinstead ofgen_ai.client.operation.duration, and stop setting span attributegen_ai.agent.idon internal agent spans. (#616) - Record modality token usage through the shared
InferenceInvocationsetters;extract_token_detailsno longer returns modality keys. (#674) - Use the shared RetrievalDocument model to capture only document IDs and scores, with null for unavailable fields, instead of document text. (#775)
Fixed
- Emit invoke_agent spans for LangChain create_agent graph roots, including nested agents, which get their own spans. (#391)
- Populate
gen_ai.conversation.idon model call and workflow spans, resolved from thethread_id,session_idorconversation_idmetadata keys and inherited by nested runs. (#474) - Mark streamed calls with
gen_ai.request.streamand recordgen_ai.response.time_to_first_chunkplus the streaming timing metrics, which were never emitted for LangChain. (#482) - Record gen_ai.response.model on streamed spans (#505)
- Resolve message roles by class so streaming chunk messages no longer report their class name (
AIMessageChunk) as the role (#506) - Record
gen_ai.tool.call.idon failedexecute_toolspans (#510) - Set
gen_ai.agent.nameon childexecute_toolspans when running under an enclosinginvoke_agent(#512) - Emit telemetry under the
opentelemetry.instrumentation.genai.langchaininstrumentation scope instead ofopentelemetry.util.genai.handler(#632) - Propagate parent context to nested agent, tool, retrieval, and workflow spans in async execution paths. (#758)
opentelemetry-instrumentation-genai-dspy 1.2b0
Added
- Add initial DSPy instrumentation package setup. (#439)
- Add instrumentation for DSPy Tool execution and ReAct agent invocations. (#529)
- Support copy and deepcopy on wrapped DSPy methods to ensure compatibility with DSPy compilation and optimizers. (#591)
- Instrument dspy.Retrieve to emit GenAI retrieval spans. (#594)
Changed
- Record metrics
gen_ai.invoke_agent.durationandgen_ai.execute_tool.durationinstead ofgen_ai.client.operation.duration. (#616) - Use the shared RetrievalDocument model for retrieval results, with null IDs and scores for text-only passages, instead of capturing passage text. (#775)
Fixed
- Emit telemetry under the
opentelemetry.instrumentation.genai.dspyinstrumentation scope instead ofopentelemetry.util.genai.handler(#632)