GenAI Utils | Adding Embedding metrics #4377
Merged
Merged
Conversation
lmolkova
reviewed
Mar 31, 2026
lmolkova
reviewed
Apr 2, 2026
e6216e4 to
68d328f
Compare
--- updated-dependencies: - dependency-name: aiohttp dependency-version: 3.13.4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…try#4326)" (open-telemetry#4413) This reverts commit 22879d6. Now that we have just one job to check we don't need to build the list anymore.
* Drop Python 3.9 support Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com> * generate-workflows Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com> * fixes Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com> * remove extra reference to pypy310 Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com> * changelog Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com> * fix flask tests Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com> * fix google-genai tests Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com> * fix google-genai tests Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com> * fix Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com> * remove unused _ensure_gzip_single_response Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com> --------- Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com> Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
* Add CLAUDE.md with project structure and commands
* Add AGENTS.md symlink to CLAUDE.md
* Move guidance to AGENTS.md and address review feedback
- Move main content from CLAUDE.md to AGENTS.md so all AI agents
(not only Claude) pick up the guidance; CLAUDE.md now just references
it via `@AGENTS.md`.
- Add general rules, PR scoping, and `Assisted-by:` commit trailer
guidance (inspired by the Collector's AGENTS.md).
- Clarify that only instrumentation packages live under
`src/opentelemetry/instrumentation/{name}/`; other package types use
their own namespace.
---------
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
It's buggy and unused.
* Bump pylint to 4.0.5 to fix Python 3.14 concurrent.futures false positives * Fix too-many-positional-arguments pylint failures - Add max-positional-arguments=10, Add pylint: disable=too-many-positional-arguments to functions that legitimately exceed the limit * Bump max-positional-arguments to 12 and remove unnecessary disable comments * Address review comments: fix CHANGELOG, remove stale pylintrc comment, add openai-agents disable * Fix formatting: restore blank line in CHANGELOG and remove extra blank line in .pylintrc * Update processor.py * Update test_botocore_bedrock.py --------- Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
open-telemetry#4391) * Refactor public API on GenAI utils * more lint * review feedback * update tests to use named params * address some of the comments * up * fix failing checks and clean up imports * lint * lint * fix lint * replace @deprecated with docstring info to avoid warnings for users * up * common code for context manager
MikeGoldsmith
approved these changes
Apr 16, 2026
MikeGoldsmith
left a comment
Member
There was a problem hiding this comment.
Looks good to me - thanks @shuningc
lmolkova
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds metrics and events telemetry for [EmbeddingInvocation], aligning with OpenTelemetry semantic conventions. Previously, embedding invocations only emitted spans - now they also emit duration metrics.
Type of change
How Has This Been Tested?
Added 3 new tests for embedding metrics:
[test_stop_embedding_records_duration_and_tokens] - verifies duration is recorded but token metrics are NOT
[test_stop_embedding_records_duration_with_additional_attributes] - verifies server address, port, custom attributes, and response model are included
[test_fail_embedding_records_error_and_duration] - verifies error path records
error.type and duration
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.