Replies: 2 comments 1 reply
-
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: The ADK API server requires explicit configuration to enable distributed tracing with Google Cloud Trace. This is not enabled by default, but you can activate it by setting Hi @markns, That's an excellent question, and your diagnosis is spot on. You are correct that by default, the ADK API server doesn't automatically propagate the trace context from the ADK uses the OpenTelemetry standard for all its tracing and instrumentation. [1, 2] For the distributed trace context to be recognized and continued, an OpenTelemetry Since you are already working with Here is an example of how you can modify your server startup script: # In your server startup script (e.g., a modified adk_web_server.py)
from google.adk.cli.fast_api import get_fast_api_app
import os
# The tracer needs to know your Google Cloud project ID.
# Make sure this environment variable is set.
os.environ.setdefault("GOOGLE_CLOUD_PROJECT", "your-gcp-project-id")
# Initialize the FastAPI app with cloud tracing enabled
app = get_fast_api_app(
# Make sure to provide the correct path to your agents directory
agents_dir="./agents",
web=True,
trace_to_cloud=True, # This parameter enables trace propagation
)
# Then, you would run this app with uvicorn, for example:
# uvicorn.run(app, host="0.0.0.0", port=8000)By setting For reference, if you were deploying your application using Let us know if you have any other questions! [1] ADK Docs: W&B Weave Integration |
Beta Was this translation helpful? Give feedback.
-
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: The ADK API server does support the The ADK framework uses OpenTelemetry for generating traces. When properly configured, it should automatically propagate the trace context from incoming requests that include the From your description, it seems like the Please refer to the ADK documentation on Cloud Trace integration for details on how to set up distributed tracing: [1]. [1] https://google.github.io/adk-docs/integrations/cloud-trace/ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm trying to get distributed tracing working between the ADK api server and a client application of the api server.
The client application is sending the
traceparentheader, and it is being received in therun_sseendpoint of the api server. I know this is working, because I have modified theadk_web_server.pycode to print the fastapi headers and I see the traceparent header.The traces from both the client application and the adk api server are being received in Google Cloud Tracing, but unfortunately the Trace IDs are different between the client and server services, so the waterfall charts are not complete.
Does ADK api server not respect the
traceparentheader? Or am I missing some configuration to make this work?Beta Was this translation helpful? Give feedback.
All reactions