NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #2541 most downloaded on PyPI
OpenTelemetry
Last release 10 days ago
24 Sep 2026
Ships fairly regularly
a new release about every 2 months
Unknown
no stable releases
1 version withdrawn
withdrawn after publishing
2 years old
14 releases · first in 2025
One column per month.
Deprecate the message part classes Text , Reasoning , Blob , File , Uri , ToolCallRequest , ToolCallResponse , ServerToolCall and ServerToolCallRespon…
decode_base64 and image_from_url helpers for converting provider image payloads and data: URLs into Blob/Uri message parts. (#296)conversation_id attribute to WorkflowInvocation to capture gen_ai.conversation.id on workflow spans. (#350)conversation_id to inference and workflow invocations, emitted as gen_ai.conversation.id. (#474)GenAIInvocation.record_stream_chunk() so callback-based instrumentations can report streaming timing without wrapping the SDK's stream. (#482)Role enum mirroring the message roles the GenAI semantic conventions define, which the generated semconv package does not expose (#506)agent_name kwarg to TelemetryHandler.tool(); when set, gen_ai.agent.name is written on the execute_tool span (#512)GenAIInvocation.should_capture_content property. (#593)cache_write_input_tokens and modality token breakdown attributes (text_*, image_*, audio_*) to invocations. (#613)reasoning_level, previous_response_id, conversation_compacted, and prompt.* attributes to inference invocations. (#614)gen_ai.execute_tool.duration on tool invocations and align gen_ai.invoke_workflow.duration attributes and bucket boundaries with semantic conventions. (#615)LocalAgentInvocation and RemoteAgentInvocation for in-process and remote agent invocations. (#616)suspend() and activate() to GenAI invocations for handing context back to the caller while the invocation is still running, SyncToolStreamWrapper/AsyncToolStreamWrapper for streaming tool executions, and RetrievalDocument model. (#673)InferenceInvocation.set_input_tokens, set_output_tokens and set_cache_read_input_tokens for recording per-modality token breakdowns, and add text to Modality. (#674)context property to GenAIInvocation and optional context parameter to TelemetryHandler.tool. (#704)conversation_id and context arguments to the inference, agent and workflow factories on TelemetryHandler; nested invocations inherit the conversation id. (#726)bind_arguments, get_argument, and get_signature utilities for signature-based parameter extraction. (#740)context parameter to TelemetryHandler methods and invocation classes. (#758)tool_call_id and tool_description from execute_tool start attributes and set them on the invocation instance instead. (#577)top_k on retrieval spans as integer gen_ai.retrieval.top_k. (#614)gen_ai.invoke_agent.duration on local agent invocations. (#616)context now 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)GenAIInvocation.__init__. (#741)Text, Reasoning, Blob, File, Uri, ToolCallRequest, ToolCallResponse, ServerToolCall and ServerToolCallResponse; they remain available as aliases of their *Part replacements. (#450)tool_call_id and tool_description as keyword arguments to handler.tool(). (#577)should_capture_content_on_spans() and ToolInvocation.should_capture_content_on_span in favor of GenAIInvocation.should_capture_content. (#593)OutputMessage.finish_reason. Report finish reasons via gen_ai.response.finish_reasons instead. (#611)cache_creation_input_tokens in favor of cache_write_input_tokens. (#613)should_emit_event(). Event emission is handled internally by telemetry handlers and invocations. (#746)InvocationMetricsRecorder, instruments.py, and metrics.py. (#615)gen_ai.invoke_workflow.duration metric on workflow invocations (WorkflowInvocation). (#350)Exception BaseException (asyncio.CancelledError, KeyboardInterrupt, SystemExit, GeneratorExit) through the success path, so cancelled operations were exported with an unset span status and no error.type. (#520)InferenceInvocation.top_k type from float to int. (#707)gen_ai.client.operation.time_to_first_chunk and gen_ai.client.operation.time_per_output_chunk metrics on streamed responses. (#711)fetch_response spans for Google GenAI interactions.get, including streamed and resumed retrieval. (#755)opentelemetry-util-genai version to 1.2b0. (#365)opentelemetry.instrumentation.google_genai instrumentation scope instead of opentelemetry.util.genai.handler (#632)BaseException. (#656)gen_ai.embeddings.dimension.count on metrics. (#708)invoke_agent spans for streaming and non-streaming MultiStepAgent.run() calls. (#403)opentelemetry-util-genai version to 1.2b0. (#365)gen_ai.invoke_agent.duration instead of gen_ai.client.operation.duration. (#616)opentelemetry-util-genai version to 1.2b0. (#365)gen_ai.invoke_agent.duration and gen_ai.execute_tool.duration instead of gen_ai.client.operation.duration. (#616)opentelemetry-util-genai version to 1.2b0. (#575)opentelemetry-util-genai version to 1.1b0, where Error.type became the error.type string value. (#485)opentelemetry-util-genai version to 1.2b0. (#593)gen_ai.invoke_agent.duration and gen_ai.execute_tool.duration instead of gen_ai.client.operation.duration. (#616)gen_ai.tool.call.arguments on execute_tool spans. (#588)opentelemetry.instrumentation.genai.openai_agents instrumentation scope instead of opentelemetry.util.genai.handler (#632)gen_ai.provider.name on tool execution metric attributes. (#710)gen_ai.conversation.id from RunConfig.group_id on invoke_workflow and invoke_agent spans, and propagate it to the chat span emitted by the model SDK instrumentation. (#726)image_url and Responses API input_image) as BlobPart, UriPart, or FilePart message parts. (#540)cache_write_input_tokens from response usage. (#613)gen_ai.usage.cache_read.input_tokens on chat completions (#662)gen_ai.usage.reasoning.output_tokens on chat completions (#680)opentelemetry-util-genai version to 1.2b0. (#365)input_audio as an audio blob, file/input_file as a document reference or blob, and refusal as text; record a completion refusal in gen_ai.output.messages. (#358)content while capturing input messages, which left the wrapped request with no content at all. Capture a file part's inline base64 file_data and take its media type from filename. (#522)with_streaming_response calls on the async client, whose parse() returns a coroutine, and end the span for a parsed stream the caller abandons. (#610)gen_ai.tool.definitions on Responses API create and stream spans. (#625)gen_ai.conversation.id from the Responses API conversation request parameter. (#631)opentelemetry.instrumentation.genai.openai instrumentation scope instead of opentelemetry.util.genai.handler (#632)function_call, custom_tool_call and their output items on Responses API spans, so a turn that follows a tool call keeps its tool-loop history in gen_ai.input.messages. (#650)BaseException. (#656)gen_ai.embeddings.dimension.count on metrics. (#708)gen_ai.request.stream on fetch_response spans. (#709)gen_ai.conversation.id inherited from an enclosing agent framework when a Responses request carries no conversation parameter (#726)opentelemetry-instrumentation-genai-llama-index). (#309)BaseRetriever operations. (#698)gen_ai.invoke_agent.duration and gen_ai.execute_tool.duration instead of gen_ai.client.operation.duration. (#616)opentelemetry.instrumentation.genai.llama_index instrumentation scope instead of opentelemetry.util.genai.handler (#632)image_url and Responses API input_image, Anthropic image, and LangChain standard image blocks) as BlobPart/UriPart/FilePart message parts. (#296)cache_write_input_tokens and modality token breakdown attributes (text, image, audio) from LangChain usage metadata on InferenceInvocation. (#671)gen_ai.request.top_k and choice count - gen_ai.request.choice.count on chat (#684)opentelemetry-util-genai version to 1.2b0. (#365)GenAIInvocation.record_stream_chunk (#482)gen_ai.invoke_agent.duration and gen_ai.execute_tool.duration instead of gen_ai.client.operation.duration, and stop setting span attribute gen_ai.agent.id on internal agent spans. (#616)InferenceInvocation setters; extract_token_details no longer returns modality keys. (#674)gen_ai.conversation.id on model call and workflow spans, resolved from the thread_id, session_id or conversation_id metadata keys and inherited by nested runs. (#474)gen_ai.request.stream and record gen_ai.response.time_to_first_chunk plus the streaming timing metrics, which were never emitted for LangChain. (#482)AIMessageChunk) as the role (#506)gen_ai.tool.call.id on failed execute_tool spans (#510)gen_ai.agent.name on child execute_tool spans when running under an enclosing invoke_agent (#512)opentelemetry.instrumentation.genai.langchain instrumentation scope instead of opentelemetry.util.genai.handler (#632)gen_ai.invoke_agent.duration and gen_ai.execute_tool.duration instead of gen_ai.client.operation.duration. (#616)opentelemetry.instrumentation.genai.dspy instrumentation scope instead of opentelemetry.util.genai.handler (#632)This is a patch release on the previous 1.1b0 release, fixing the issue(s) below.
This is a patch release on the previous 1.1b0 release, fixing the issue(s) below.
opentelemetry-util-genai dependency floor to 1.1b0. (#433)This is a patch release on the previous 1.1b0 release, fixing the issue(s) below.
httpx2 as its HTTP client. (#435)Add TelemetryHandler.fetch_response() and FetchResponseInvocation for the fetch_response operation, which fetches a previously generated response by i
TelemetryHandler.fetch_response() and FetchResponseInvocation for the fetch_response operation, which fetches a previously generated response by id without performing inference. (#184)gen_ai.client.operation.time_to_first_chunk, gen_ai.client.operation.time_per_output_chunk), the gen_ai.response.time_to_first_chunk span attribute, and the gen_ai.request.stream span attribute, set by the shared stream wrappers. (#269)CompactionPart message part type, mirroring the semconv model (type, id, content) for representing server-side context compaction events. (#289)error_type_resolver callback to TelemetryHandler.inference() and InferenceInvocation so instrumentors can derive the error.type attribute from the raw exception. (#304)SyncStreamManagerWrapper / AsyncStreamManagerWrapper bases and finalize_on_close / finalize_on_aclose helpers to opentelemetry.util.genai.stream (#390)Error.type is now the error.type attribute value (a string) instead of the exception class; the originating exception moved to the new Error.exception field. When derived from an exception, error.type is its canonical, fully qualified name. (#282)gen_ai.usage.output_tokens is now taken directly from invocation.output_tokens; thinking_tokens is no longer auto-added into it. Instrumentations must include reasoning/thinking tokens in output_tokens when their underlying library API does not do it. (#283)GenericPart.type is now a required free-form string carrying the provider's own type name instead of the fixed literal generic, Modality gains document, and FinishReason gains compaction. (#284)aclose instead of close (#390)wrapt to 1.14.0, the first release with the async ObjectProxy support the stream wrappers require. (#269)execute_tool spans with INTERNAL span kind instead of CLIENT. (#274)gen_ai.workflow.name span attribute on workflow invocations when the workflow name is known. (#275)stop() / fail() idempotent: finishing an invocation twice no longer re-records finish telemetry or ends the span a second time. (#278)429) as error.type on failed generate_content and interactions.create inference spans and metrics, instead of collapsing every google.genai error into ClientError / ServerError. (#304)gen_ai.usage.output_tokens on both the span and the token-usage metric (candidates_token_count excludes thoughts). (#283)generate_content_stream is closed before being drained, instead of recording it as an error (#390)OTEL_INSTRUMENTATION_GENAI_COMPLETION_HOOK by falling back to load_completion_hook() when no completion_hook is passed to instrument(). (#302)retrieve API (sync and async), reported as a fetch_response operation with no token usage. (#184)with_raw_response responses for chat completions and the Responses API, keep the caller's stream working unchanged when the raw response is parsed into a custom type (parse(to=...)), and finalize the span when a streaming raw response is drained off the underlying httpx response without calling parse() so the span no longer leaks open. (#278)error event code or the response's error code) instead of a generic RuntimeError, for both streaming and non-streaming calls. Responses that finish as incomplete (max_output_tokens/content_filter) are recorded as a finish reason rather than an error. (#282)server.address and server.port not recorded when using openai v3 (httpx2 URL type). (#393)function_call responses (additional_kwargs['function_call']) as tool-call requests in input and output messages, matching the modern tool_calls path. (#281)CompletionHook (OTEL_INSTRUMENTATION_GENAI_COMPLETION_HOOK or the instrument(completion_hook=...) argument) to the telemetry handler. (#302)("role", content) tuples, dicts, and strings) in input messages, so the prompt is recorded and duplicate invoke_agent spans are avoided. (#261)This is a patch release on the previous 1.0b0 release, fixing the issue(s) below.
This is a patch release on the previous 1.0b0 release, fixing the issue(s) below.
generate_content, interactions.create, and embed_content. (#232)opentelemetry-api to 1.43.0, opentelemetry-instrumentation/opentelemetry-semantic-conventions to 0.64b0, and wrapt to 1.17.0. (#254)Added missing gen_ai.response.id attribute to span and event.
gen_ai.response.id attribute to span and event. (#119)gen_ai.response.model) attribute on inference span. (#205)gen_ai.usage.cache_read.input_tokens attribute to capture cached tokens on spans/events when the experimental sem conv flag is set. (#4313)gen_ai.usage.reasoning.output_tokens attribute to capture thinking tokens on spans/events when the experimental sem conv flag is set. Add thinking tokens to output tokens. (#4313)opentelemetry-util-genai. This shared package is used by multiple GenAI instrumentations, and ensures sem convs are followed and up to date. This does result in some span attributes on the execute_tool span being removed (code.function.parameters.someparam.type, code.function.parameters.someparam.value etc.), and other sem conv compliant attributes being added to the span (specifically: gen_ai.tool.call.arguments, gen_ai.tool.call.result), it also correctly changes the SpanKind from INTERNAL to CLIENT. The generate_content span also is switched to SpanKind CLIENT, and the gen_ai.provider.name attribute which was missing has been added, its value is vertex_ai. The InstrumentationScope of the log and trace will also change, as the TelemetryHandler class in the utils package is now used to write the logs and traces. (#10)google-genai to allow v2 of that library to be used with the instrumentation library. (#21)1.0b0 to align with the OpenTelemetry GenAI packages. (#60)wrapt instead of functools.wraps to monkey patch the SDK. (#151)generate_content streaming method variants to return streaming wrapper classes to enable users to iterate over the stream of responses from the model. (#167)OTEL_SEMCONV_STABILITY_OPT_IN flag that was gating the new conventions. The newest conventions will be used by default. (#110)Nothing published for this version
Fix bug in how tokens are counted when using the streaming generateContent method. (#4152).
Enable the addition of custom attributes to the generate_content {model.name} span via the Context API. (#3961).
Ensure log event is written and completion hook is called even when model call results in exception. Put new log event ( gen_ai.client.inference.opera
gen_ai.client.inference.operation.details) behind the flag OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental.
Ensure same sem conv attributes are on the log and span. Fix an issue where the instrumentation would crash when a pydantic.BaseModel class was passed as the response schema (#3905).GEN_AI_OUTPUT_TYPE sem conv request attributes to events/spans generated in the stable instrumentation. This was added pre sem conv 1.36 so it should be in the stable instrumentation. Fix a bug in how system instructions were recorded in the gen_ai.system.message log event. It will now always be recorded as {"content" : "text of system instructions"}. See (#4011).Implement the new semantic convention changes made in https://github.com/open-telemetry/semantic-conventions/pull/2179. A single event (gen_ai.client.
gen_ai.client.inference.operation.details) is used to capture Chat History. This is opt-in,
an environment variable OTEL_SEMCONV_STABILITY_OPT_IN needs to be set to gen_ai_latest_experimental to see them (#3386)Add automatic instrumentation to tool call functions
Add more request configuration options to the span attributes
Add support for async and streaming.
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →