adk-python icon indicating copy to clipboard operation
adk-python copied to clipboard

Tracing non-Gemini models

Open anirudh-cogent opened this issue 1 year ago • 5 comments

Hi, What is the current recommended approach for tracing non-Gemini models. Is there a plan to support integrations with to W&B, MLFlow or Braintrust?

anirudh-cogent avatar May 14 '25 15:05 anirudh-cogent

likely would be more robust otel support

https://github.com/google/adk-python/pull/320 https://github.com/google/adk-python/pull/569 https://github.com/google/adk-python/issues/474

I dont think those PRs account for litellm instrumentation, but getting the foundation for more robust tracing and observability is definitely the first step.

BenMawnMahlauNBTC avatar May 14 '25 18:05 BenMawnMahlauNBTC

Just wanted to add some observations that I've encountered which relates to this, specifically when combining Google ADK with LiteLLM and MLflow's autologging feature (specifically, mlflow.litellm.autolog()).

My understanding is that the Google ADK Base Agent initializes an OpenTelemetry (OTEL) Tracing context. When MLflow's autologging for LiteLLM is then enabled, it also attempts to leverage an OTEL context. However, it seems MLflow detects the already-established context from ADK and tries to use it. This re-use of a context created by ADK appears to lead to an incompatibility that breaks MLflow's tracing, preventing it from accurately capturing the LLM interactions.

This prevents proper observability via MLflow when ADK is part of the stack. I'm curious if this is a known issue or if there are best practices for managing OTEL contexts in such a combined environment to avoid this interference!

Hope this helps.

Maddog-max avatar Jun 09 '25 21:06 Maddog-max

Hi @anirudh-cogent and thanks to everyone who participated in this thread.

We're currently doing some housekeeping on our issue tracker. Given the rapid pace of development and the number of updates since this was last active, there's a good chance this issue has been resolved in a newer version. To help us keep our backlog focused on current issues, we are closing this as stale.

If you're still facing this problem, could you please update to the very latest version of the library and confirm the issue still exists? If it does, please comment here, and we will be happy to reopen this issue and investigate further.

Thanks for your contribution and understanding!

surajksharma07 avatar Oct 07 '25 07:10 surajksharma07

I have tested this on latest version (1.16.0) and can confirm it is still an issue. The google-adk OTEL tracing is breaking the ability of mlflow to pick up and report litellm traces via the mlflow.litellm.autolog() feature.

Please reopen :)

pitta-bread avatar Oct 24 '25 15:10 pitta-bread

I confirm it is an issue. Is it possible to reopen it? Basically this page of the doc seems to work only for google models.

salvatore-cipolla avatar Dec 03 '25 20:12 salvatore-cipolla