Skip to content

Releases: open-telemetry/opentelemetry-python-genai

opentelemetry-instrumentation-google-genai 1.0b1

Choose a tag to compare

@github-actions github-actions released this 13 Jul 19:01
d168d3e

This is a patch release on the previous 1.0b0 release, fixing the issue(s) below.

Added

  • Add Weaver conformance test scenarios for generate_content, interactions.create, and embed_content. (#232)

Changed

  • Bump dependencies: opentelemetry-api from ~= 1.40 to ~= 1.43, opentelemetry-instrumentation and opentelemetry-semantic-conventions from >= 0.61b0 to >= 0.64b0, and opentelemetry-util-genai from >= 0.4b0 to >= 1.0b0. (#244)
  • Bump minimum required version of opentelemetry-api to 1.43.0, opentelemetry-instrumentation/opentelemetry-semantic-conventions to 0.64b0, and wrapt to 1.17.0. (#254)

Fixed

  • Fix minimum version of opentelemetry-util-genai dependency. (#248)
  • Ensure __code__.co_filename on wrapped functions matches the instrumentation file path. (#260)

opentelemetry-util-genai 1.0b0

Choose a tag to compare

@github-actions github-actions released this 09 Jul 21:37
1e4aca5

Added

  • Add tool_result as a parameter to ToolInvocation, add tool_result and arguments as span attributes to the execute_tool span if ContentCapture flag is set. (#17)
  • Add RetrievalInvocation type with start_retrieval / retrieval span lifecycle, supporting gen_ai.operation.name=retrieval spans per the GenAI semantic conventions. (#36)
  • Add shared sync and async stream wrapper base classes for GenAI instrumentations. (#4500)

Changed

  • Bumped the version to 1.0b0 to align with the OpenTelemetry GenAI packages. (#60)
  • Use AttributeValue instead of Any for span and metric attribute types in GenAIInvocation and its subclasses. (#153)
  • Apply attribute for sampling on instantiation of all invocation types. (#4553)
  • Change InferenceInvocation init params to only accept base params
  • Minor code cleanup and changes in preparation of moving google's GenAI instrumentation library to use this util library (#4556)
  • Pass in attributes on invocation _start so samplers have access to attributes. (#4538)

Deprecated

  • Deprecate all start_ factories; update all invocation factories to return objects that can be used as context managers. (#17)

Removed

  • Remove remaining usages of and references to deprecated functions (#47)
  • Removes all code referencing the "OTEL_SEMCONV_STABILITY_OPT_IN" flag, as we are removing all code that sits behind the "default" value of that flag, and having the code that sits behind "experimental" be the default. (#117)
  • Removed the provider parameter from the internal agent invocation APIs and stopped emitting gen_ai.provider.name on internal agent spans and metrics. (#132)

opentelemetry-instrumentation-google-genai 1.0b0

Choose a tag to compare

@github-actions github-actions released this 09 Jul 21:37
1e4aca5

Added

  • Added missing gen_ai.response.id attribute to span and event. (#119)
  • Add instrumentation for InteractionsResource.create and AsyncInteractionsResource.create. (#165)
  • Add telemetry support for the Google GenAI SDK embedding API (embed_content and embed_content_async). (#176)
  • Record response model (gen_ai.response.model) attribute on inference span. (#205)
  • Add gen_ai.usage.cache_read.input_tokens attribute to capture cached tokens on spans/events when the experimental sem conv flag is set. (#4313)
  • Add 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)

Changed

  • Refactor code to make use of the shared GenAi Utils package 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)
  • Relax version constraint of google-genai to allow v2 of that library to be used with the instrumentation library. (#21)
  • Bumped the version to 1.0b0 to align with the OpenTelemetry GenAI packages. (#60)
  • Use wrapt instead of functools.wraps to monkey patch the SDK. (#151)
  • Update the generate_content streaming method variants to return streaming wrapper classes to enable users to iterate over the stream of responses from the model. (#167)

Removed

  • Remove the code supporting the old semantic conventions, and the OTEL_SEMCONV_STABILITY_OPT_IN flag that was gating the new conventions. The newest conventions will be used by default. (#110)

Fixed

  • Fix VCR cassette lookup for Google GenAI upload hook tests under newer pytest versions. (#133)

opentelemetry-instrumentation-genai-openai 1.0b0

Choose a tag to compare

@github-actions github-actions released this 09 Jul 21:36
1e4aca5

Added

  • Add instrumentation for chat.completions.parse() structured outputs (#18)
  • Add instrumentation for OpenAI Responses API async create (#99)
  • Add OpenAI Responses API stream instrumentation for sync and async clients. (#131)
  • Pass tool definitions from tools kwarg to InferenceInvocation.tool_definitions so gen_ai.tool.definitions span attribute is populated on chat completion spans (#4554)

Changed

  • Renamed package from opentelemetry-instrumentation-openai-v2 to opentelemetry-instrumentation-genai-openai (imports opentelemetry.instrumentation.genai.openai); the version line restarts at 1.0b0. (#60)
  • Use shared GenAI stream wrappers for Responses API streams. (#92)
  • Switch OpenAI instrumentation and tests to the latest GenAI semantic convention mode. (#108)
  • Migrate OpenAI embeddings instrumentation to the shared util-genai EmbeddingInvocation lifecycle and drop the legacy embeddings-specific span/metrics plumbing. (#127)
  • Refactor chat completion stream wrappers to use shared GenAI stream lifecycle helpers. (#4500)

Removed

  • Remove unused legacy event helpers that emitted the deprecated gen_ai.system attribute and gen_ai.{role}.message / gen_ai.choice events. (#161)

Fixed

  • Migrate OpenAI choice_count to use InferenceInvocation.request_choice_count field for consistency with other instrumentations. (#192)

opentelemetry-instrumentation-genai-openai-agents 1.0b0

Choose a tag to compare

@github-actions github-actions released this 09 Jul 21:37
1e4aca5

Added

  • Document official package metadata and README for the OpenAI Agents instrumentation. (#3859)
  • Populate instructions and tool definitions from Response obj. (#4196)

Changed

  • Renamed package from opentelemetry-instrumentation-openai-agents-v2 to opentelemetry-instrumentation-genai-openai-agents (imports opentelemetry.instrumentation.genai.openai_agents); the version line restarts at 1.0b0. (#60)
  • Switch instrumentation to use util-genai instead of hand-rolled signals. Stop capturing chat, embeddings, speech, and transcription spans — those are covered by the OpenAI instrumentation. Remove handoff and guardrail spans (not yet defined in semantic convention and not implemented by genai-util). (#90)
  • Align AgentSpanData test stubs and span processor with real OpenAI Agents SDK; remove non-existent operation, description, agent_id, and model fields. (#4229)

opentelemetry-instrumentation-genai-langchain 1.0b0

Choose a tag to compare

@github-actions github-actions released this 09 Jul 21:37
1e4aca5

Added

  • Add LangChain workflow and agent span support (#25)
  • Added tool spans and captured tool definitions on inference spans. (#37)
  • Added log and metrics provider to langchain genai utils handler (#4214)
  • Added span support for GenAI LangChain LLM invocation. (#3665)
  • Added support to call genai utils handler for langchain LLM invocations. (#3889)

Changed

  • Renamed package to opentelemetry-instrumentation-genai-langchain (imports opentelemetry.instrumentation.genai.langchain). (#60)
  • Update langchain instrumentation to use latest semantic conventions (#129)

Removed

  • Stopped setting gen_ai.provider.name on internal agent spans. (#132)
  • Removed the unused span_manager.py from the langchain instrumentation (#190)

Fixed

  • Fix compatibility with wrapt 2.x by using positional arguments in wrap_function_wrapper() calls (#4445)

opentelemetry-instrumentation-genai-anthropic 1.0b0

Choose a tag to compare

@github-actions github-actions released this 09 Jul 21:36
1e4aca5

Added

  • instrument async Anthropic messages.create calls (#96)
  • Add Anthropic instrumentation for Messages.parse, AsyncMessages.parse, and AsyncMessages.stream. (#191)
  • Add async Anthropic message stream wrappers and manager wrappers, with wrapper tests (#4346) - AsyncMessagesStreamWrapper for async message stream telemetry - AsyncMessagesStreamManagerWrapper for async Messages.stream() telemetry
  • Add instrumentation for Anthropic Messages.stream() helper method (#4499)
  • Add sync streaming support for Messages.create(stream=True) and Messages.stream() (#4155) - StreamWrapper for handling Messages.create(stream=True) telemetry - MessageStreamManagerWrapper for handling Messages.stream() telemetry - MessageWrapper for non-streaming response telemetry extraction
  • Implement sync Messages.create instrumentation with GenAI semantic convention attributes (#4034) - Captures request attributes: gen_ai.request.model, gen_ai.request.max_tokens, gen_ai.request.temperature, gen_ai.request.top_p, gen_ai.request.top_k, gen_ai.request.stop_sequences - Captures response attributes: gen_ai.response.id, gen_ai.response.model, gen_ai.response.finish_reasons, gen_ai.usage.input_tokens, gen_ai.usage.output_tokens - Error handling with error.type attribute - Minimum supported anthropic version is 0.16.0 (SDK uses modern anthropic.resources.messages module structure introduced in this version)
  • Initial implementation of Anthropic instrumentation (#3978)

Changed

  • Renamed package to opentelemetry-instrumentation-genai-anthropic (imports opentelemetry.instrumentation.genai.anthropic). (#60)
  • Use shared GenAI stream wrappers for Messages API streams. (#92)
  • Update opentelemetry-util-genai dependency range to >= 0.4b0.dev, <0.5b0 (#4520)

Fixed

  • Emit gen_ai.provider.name instead of deprecated gen_ai.system for Anthropic spans (#111)
  • Fix compatibility with wrapt 2.x by using positional arguments in wrap_function_wrapper() calls (#4445)