Skip to content

Conversation

richhuth
Copy link

No description provided.

Copy link

google-cla bot commented Aug 27, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Collaborator

@koverholt koverholt left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! ❤️ We appreciate you showcasing how to use this ADK + LangWatch integration. I ran through the steps documented in this PR, and I left some comments about the sample code, model versions, and a couple of other usability notes.


Now that you have tracing setup, all Google ADK SDK requests will be streamed to LangWatch for observability and evaluation.

```python
Copy link
Collaborator

Choose a reason for hiding this comment

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

This Python code does not work for me, I get the following error (I'm running with ADK 1.15.1):

2025-10-02 15:04:44,311 - ERROR - adk_web_server.py:1284 - Error in event_generator: Fail to load 'langwatch-test' module. 'await' outside function (agent.py, line 55)
Traceback (most recent call last):
  File "/Users/koverholt/miniforge3/lib/python3.11/site-packages/google/adk/cli/adk_web_server.py", line 1264, in event_generator
    runner = await self.get_runner_async(req.app_name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/koverholt/miniforge3/lib/python3.11/site-packages/google/adk/cli/adk_web_server.py", line 444, in get_runner_async
    agent_or_app = self.agent_loader.load_agent(app_name)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/koverholt/miniforge3/lib/python3.11/site-packages/google/adk/cli/utils/agent_loader.py", line 234, in load_agent
    agent_or_app = self._perform_load(agent_name)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/koverholt/miniforge3/lib/python3.11/site-packages/google/adk/cli/utils/agent_loader.py", line 207, in _perform_load
    if root_agent := self._load_from_module_or_package(actual_agent_name):
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/koverholt/miniforge3/lib/python3.11/site-packages/google/adk/cli/utils/agent_loader.py", line 104, in _load_from_module_or_package
    raise e
  File "/Users/koverholt/miniforge3/lib/python3.11/site-packages/google/adk/cli/utils/agent_loader.py", line 70, in _load_from_module_or_package
    module_candidate = importlib.import_module(agent_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/koverholt/miniforge3/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/koverholt/Desktop/langwatch-test/__init__.py", line 1, in <module>
    from . import agent
  File "/Users/koverholt/Desktop/langwatch-test/agent.py", line 55
    await session_service.create_session(
    ^
SyntaxError: Fail to load 'langwatch-test' module. 'await' outside function

But I switched to using the sample agent in the ADK quickstart, and I did get traces sent to LangWatch.

Edit: I did try running the (different) sample code in the Automatic Tracing section of the LangWatch docs, which works great. So consider using that code here (or linking to it) instead.

)
```

That's it! All Google ADK agent activity will now be traced and sent to your LangWatch dashboard automatically.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note, I was able to send a test trace to LangWatch, but I kept seeing this message at the top of the Analytics page:

Setup pending
Your project is not set up yet so you won't be able to see any data on the dashboard, please go to the setup page to get started.

But I couldn't figure out what other actions I needed to do at this point to go deeper into the platform or to view details of the trace that was sent.

## Support and Resources

- [LangWatch Documentation](https://docs.langwatch.ai)
- [LangWatch Google ADK Integration Guide](https://docs.langwatch.ai/integration/python/integrations/google-ai)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note (not related to this PR): Would it make more sense to move the ADK Guide under Frameworks in the LangWatch docs rather than the Model Providers section?

# Create an agent with tools
agent = Agent(
name="weather_agent",
model="gemini-2.0-flash-exp",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggest changing to gemini-2.0-flash here and throughout, as the -exp variant is no longer available. Or even better, referencing the latest gemini-2.5-flash model throughout the code examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants