Skip to content

feat: google-adk instrumentation. #1578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

daavoo
Copy link
Contributor

@daavoo daavoo commented Apr 30, 2025

Closes #1506

From examples/tools.py:

  • LLM (with function call output)

Screenshot 2025-04-30 151426

  • TOOL

Screenshot 2025-04-30 151435

  • LLM (with text output)

Screenshot 2025-04-30 151445

@daavoo daavoo requested a review from a team as a code owner April 30, 2025 13:40
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Apr 30, 2025
@caroger caroger removed this from Instrumentation May 1, 2025
@caroger caroger requested a review from mikeldking May 1, 2025 16:53
@mikeldking
Copy link
Contributor

Thanks so much for contributing @daavoo ! If it's okay as I review I might push some fixes into your branch if it's low hanging fruit just to get a few more things over the line. I see some missing attributes like token-counts and just want to ship good first version for you!

@daavoo
Copy link
Contributor Author

daavoo commented May 1, 2025

Thanks so much for contributing @daavoo ! If it's okay as I review I might push some fixes into your branch if it's low hanging fruit just to get a few more things over the line. I see some missing attributes like token-counts and just want to ship good first version for you!

No problemo, go ahead.
I wanted to open the PR to check with you if the implementation (wrapping the callback properties) makes sense but I was not sure if I was filling the fields correctly (or if some important ones are missing)

@RogerHYang
Copy link
Contributor

Thanks for this PR @daavoo. I think the current monkey-patching approach might run into problems when users create their own callbacks (as they're encouraged to do by the docs here). The main issue is that instance-level callbacks would override the instrumentor callbacks we added at the class level. For instance, if a user sets their callbacks to None during instantiation, the instrumentor would stop working. I'm looking into another solution that should fix these issues.

@daavoo
Copy link
Contributor Author

daavoo commented May 7, 2025

Thanks for this PR @daavoo. I think the current monkey-patching approach might run into problems when users create their own callbacks (as they're encouraged to do by the docs here). The main issue is that instance-level callbacks would override the instrumentor callbacks we added at the class level. For instance, if a user sets their callbacks to None during instantiation, the instrumentor would stop working.

Yeah 😅 , I noticed that, I just put together something that worked in our context (any-agent) because we can choose to always call instrument manually after agent instantiation.
But I agree is not optimal for general use cases🙏

I'm looking into another solution that should fix these issues.

In case it helps, I also looked into:

@daavoo
Copy link
Contributor Author

daavoo commented May 14, 2025

Closing this, as commented the callback patch is not the right approach for openinference use case

@daavoo daavoo closed this May 14, 2025
@RogerHYang
Copy link
Contributor

@daavoo if you don't mind, i think we can keep this PR open as we update the approach here given what we have so far

@RogerHYang RogerHYang reopened this May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request] Support Google Agent Development Kit (ADK)
3 participants