Tracing agent reasoning and protecting privacy
Enterprise observability requires balancing diagnostic telemetry with strict data privacy boundaries. Because tracking features involve ingestion and storage costs, Google Data Cloud separates operational telemetry from conversation content so admins and agent owners can govern each layer independently.
At the project or organization level, admins can enable Cloud Monitoring (aggregate metrics such as request volume, latency, and token usage) and Cloud Trace (step-by-step spans for each request) across their environment, using Cloud Trace observability scopes to consolidate telemetry across multiple agent projects. To protect sensitive data, these operational metrics and sanitized first-party trace spans exclude customer core content (such as user prompts, model responses, internal thoughts, and generated SQL).
When you need deeper transcript auditing, agent owners and editors can opt in to conversation logging on a per-agent basis:
-
Governed conversation logging in BigQuery: When enabled, a Google-managed service agent streams user prompts, responses, and turn-level telemetry into a customer-owned BigQuery table (
agent_events) via the BigQuery Storage Write API, inheriting your dataset’s IAM permissions, CMEK, and VPC Service Controls. Built-in privacy guardrails enforce a fail-closed check before each turn — skipping logging whenever a knowledge source uses row-level security, column-level policy tags, or dynamic data masking — while fail-open execution keeps your users’ chat sessions uninterrupted if a logging error occurs. -
Full trace trees for custom 3P agents: While 1P conversation logging intentionally strips low-level tool arguments and internal SQL, developers building custom agents on ADK or LangGraph can instrument their code with the open-source ADK plugin (
BigQueryAgentAnalyticsPlugin). With a single-line setup, the SDK streams full tool-invocation execution trees, time-series telemetry, and multimodal payloads straight into BigQuery. -
In-warehouse root cause and drift analysis: Because conversation logs land natively in your
agent_eventstable, you don’t need separate export pipelines to diagnose failures. You can run BigQuery AI functions (such asAI.GENERATEto summarize error patterns andAI.EMBEDwithVECTOR_SEARCHto cluster recurring issues) or use the open-sourcebigquery-agent-analyticsPython SDK and Colab starter notebook for post-hoc semantic drift clustering and LLM-as-a-judge sentiment analysis.
Controlling token costs with FinOps guardrails
As agent adoption grows, FinOps and platform teams need clear visibility into consumption alongside active controls to prevent runaway spend. With promotional trial pricing currently available for Conversational Analytics, now is a good time to establish baseline usage and cost guardrails:
-
Granular token and latency tracking: In BigQuery conversation logs, each turn records input, output, thought, cached, and total token counts alongside total turn latency, while Looker System Activity reports estimated input and output tokens across your business intelligence (BI) workloads.
-
Turnkey observability dashboards: You can track projected token usage and engagement in the BigQuery Studio Monitoring tab and native Looker System Activity dashboards, or query
agent_eventslog data via BigQuery SQL using the open-source seven-page Data Studio report template and self-hosted Streamlit app in the BigQuery Agent Analytics GitHub repository. -
Active query and token spend caps: To prevent unexpected charges before they happen, you can configure per-query BigQuery byte scan caps (
big_query_max_billed_bytes) on your agent, which use dry-run estimates to block oversized queries without incurring on-demand scan charges. For BigQuery and the Conversational Analytics API, you can also enforce daily input and output token quotas (in preview) per project, user, or agent in the Google Cloud console andgcloudCLI.
Evaluating and benchmarking your AI agents
Runtime observability works alongside systematic evaluation. While logs and traces tell you how an agent behaved in production, evaluation benchmarks verify whether updates to your prompts, models, or data schemas improve SQL accuracy and answer quality before users experience a regression:
-
Benchmarking with Prism: Our open-source evaluation tool, Prism, lets you test Conversational Analytics agents grounded in BigQuery tables or Looker Explores via the Conversational Analytics API using reusable test suites, regex assertions, and multi-region agent discovery (deployed behind an access layer such as Cloud IAP).
-
Unified evaluation and production analytics: Prism can stream completed evaluation runs directly into day-partitioned BigQuery tables in your project, placing your pre-deployment benchmark scores right alongside your production
agent_eventslogs for side-by-side analysis in BigQuery and Looker. -
Native BigQuery evaluations: First-party agent evaluations in BigQuery (built on the Gemini Enterprise Agent Platform evaluation service with bring-your-own-service-account support) are available in preview via API and a guided Colab notebook.
Getting started
Ready to bring visibility, governance, and cost control to your AI agents? Here is how to get started in three steps:
-
Enable first-party agent observability. Turn on Cloud Monitoring and Cloud Trace in your project and opt in to per-agent conversation logging using the BigQuery agent monitoring guide, and track BI token consumption with the Looker Conversational Analytics overview and Looker System Activity documentation.
-
Instrument custom agents and deploy analytics dashboards. Add the BigQuery Agent Analytics SDK to your ADK or LangGraph agents, launch the open-source Data Studio report template or Streamlit app, and explore in-warehouse log analysis with the Colab starter notebook.
-
Benchmark your agents and set cost guardrails. Run automated accuracy suites with Prism, and configure BigQuery byte scan caps and daily token quotas via Manage BigQuery costs for agents.
Source Credit: https://cloud.google.com/blog/products/data-analytics/enterprise-ai-agent-observability-with-bigquery-and-looker/
