Skip to content

GenAI Utils | Add metrics to ToolInvocations#4443

Open
keith-decker wants to merge 10 commits intoopen-telemetry:mainfrom
keith-decker:tool-invocation-metrics
Open

GenAI Utils | Add metrics to ToolInvocations#4443
keith-decker wants to merge 10 commits intoopen-telemetry:mainfrom
keith-decker:tool-invocation-metrics

Conversation

@keith-decker
Copy link
Copy Markdown
Contributor

@keith-decker keith-decker commented Apr 16, 2026

Description

Adds duration metrics to ToolInvocations

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Checks duration metric with associated properties

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@keith-decker keith-decker marked this pull request as ready for review April 16, 2026 15:02
@keith-decker keith-decker requested a review from a team as a code owner April 16, 2026 15:02
Copy link
Copy Markdown
Member

@lmolkova lmolkova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, the only concern is provider, service attributes - we won't have them in semconv on tool calls and we won't really be able to populate them either in instrumentations

Comment thread util/opentelemetry-util-genai/src/opentelemetry/util/genai/_tool_invocation.py Outdated
Copy link
Copy Markdown

@JWinermaSplunk JWinermaSplunk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as well, though I agree with @lmolkova's comment

Copy link
Copy Markdown
Contributor

@eternalcuriouslearner eternalcuriouslearner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!! Sorry for being pedantic but left a nit to see we can remove the pylint.

Comment thread util/opentelemetry-util-genai/src/opentelemetry/util/genai/_tool_invocation.py Outdated
Copy link
Copy Markdown
Member

@MikeGoldsmith MikeGoldsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

6 participants