Skip to content
Discussion options

You must be logged in to vote

How to Enrich BigQuery Agent Analytics Events

The recommended way to attach custom fields (like user_email, tenant_id) to your BigQuery events is to leverage the attributes JSON column rather than extending the BigQuery table schema.

This approach is flexible, avoids schema migration headaches, and is fully queryable in BigQuery.

1. Recommended Approach: Subclassing the Plugin

You can subclass BigQueryAgentAnalyticsPlugin and override the internal _log_event method. This method acts as a central hook for all events (tool calls, user messages, model responses, etc.), allowing you to inject custom data from the session state into the event attributes.

Implementation Example

from typing import 

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by haiyuan-eng-google
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants