feat(otel): add --otel_to_cloud experimental support

Cloud Trace, Cloud Monitoring and Cloud Logging integrations are set up via OTel if otel_to_cloud CLI param/fast_api arg is provided.

This is similar to current Cloud Trace integration via trace_to_cloud, just extended to Monitoring and Logging as well.

PiperOrigin-RevId: 807230668
This commit is contained in:
Kacper Jawoszek
2025-09-15 07:22:19 -07:00
committed by Copybara-Service
parent b9735b2193
commit 7870480c63
15 changed files with 430 additions and 30 deletions
@@ -17,10 +17,10 @@ from typing import Dict
from typing import Optional
from unittest import mock
from google.adk import telemetry
from google.adk.agents.llm_agent import Agent
from google.adk.events.event import Event
from google.adk.flows.llm_flows.functions import handle_function_calls_async
from google.adk.telemetry import tracing
from google.adk.tools.function_tool import FunctionTool
from google.genai import types
@@ -65,7 +65,7 @@ async def test_simple_function_with_mocked_tracer(monkeypatch):
mock_start_as_current_span_func.return_value = returned_context_manager_mock
monkeypatch.setattr(
telemetry.tracer, 'start_as_current_span', mock_start_as_current_span_func
tracing.tracer, 'start_as_current_span', mock_start_as_current_span_func
)
mock_adk_trace_tool_call = mock.Mock()