You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhance BigQuery Agent Analytics with new options (#1942)
* Enhance BigQuery Agent Analytics with new options
Added options for OpenTelemetry correlation, custom metadata capture, and payload column projection in BigQuery Agent Analytics configuration.
* Fix formatting of Interactive Demo Notebook link
fix format
* docs(bigquery-agent-analytics): replace version callouts with language support tags
Address review feedback (koverholt) on PR #1942: the page used ad-hoc,
non-conventional version callouts (per-row table tags, footnotes, version
suffixes in headers, "post-vX.Y.Z" notes) that are unmaintainable and, in
places, stale.
- Drop the "(v2.4.0+)" / "(1.27.0+)" suffixes from config-table rows and
section headers; convey minimum versions with the repo-standard
language-support-tag blocks on the relevant sections instead
(Trace correlation → Python v2.4.0, Automatically Created Views →
Python v1.27.0, ADK 2.0 workflow events → Python v2.3.0).
- Remove the "‡ Added in v2.4.0" and "† ... not in v2.2.0" view-table
footnotes; the ADK 2.0 views/columns now point to the ADK 2.0 section.
- Remove the stale top "Version Requirement" note (v2.2.0 is no longer the
latest release; ADK 2.0 workflow support shipped in v2.3.0) and the stale
ADK 2.0 section note; de-version the intro prose.
- Remove the "Structured tool declarations (post-v2.4.0)" note: that shape is
not in any tagged release (v2.4.0 emits tools as a list of names); it will
be re-added under a language-support-tag once it ships.
- Trim the Trace-correlation section so it no longer restates the option table,
keeping only the cross-option constraints and the combined example.
| `view_prefix` | `str` | `"v"` | Avoid view-name collisions when multiple plugins share a dataset (e.g., `"v_staging"`) |
557
+
| `enable_otel_correlation` | `bool` | `False` | Capture the ambient OpenTelemetry span context into `attributes.otel.{span_id, trace_id}` as a best-effort Cloud Trace join key |
558
+
| `custom_metadata_allowlist` | `Optional[List[str]]` | `None` | Capture selected `event.custom_metadata` keys into `attributes.custom_metadata.*` — exact keys or `"prefix*"` patterns |
559
+
| `payload_column_denylist` | `Optional[List[str]]` | `None` | Project payload columns (`content`, `content_parts`, `attributes`, `latency_ms`) out of the table at write time |
572
560
573
561
574
562
The following code sample shows how to define a configuration for the BigQuery
@@ -621,6 +609,41 @@ account) under which the agent is running needs these Google Cloud roles:
621
609
)
622
610
```
623
611
612
+
### Trace correlation, metadata capture, and column projection
613
+
614
+
<div class="language-support-tag">
615
+
<span class="lst-supported">Supported in ADK</span><span class="lst-python">Python v2.4.0</span>
616
+
</div>
617
+
618
+
Three options control what extra context lands in `attributes` — and whether
619
+
payload columns are written at all. Each is listed in the
620
+
`BigQueryLoggerConfig` options table above; the notes below add the
621
+
cross-option rules the flat table can't express:
622
+
623
+
- **`enable_otel_correlation`** — the captured span context is a best-effort
624
+
Cloud Trace correlation key, not a foreign key; when disabled (the
625
+
default) no `attributes.otel` is written.
626
+
- **`custom_metadata_allowlist`** — leaving it unset preserves the previous
627
+
behavior, where only the built-in `a2a:*` capture runs. Captured values
628
+
pass the same safety pipeline as all other logged content (truncation,
0 commit comments