BigQueryLoggerConfig

data class BigQueryLoggerConfig @JvmOverloads constructor(val projectId: String, val datasetId: String, val enabled: Boolean = true, val location: String = "US", val tableName: String = "agent_events", val credentials: Credentials? = null, val eventAllowlist: Set<String> = emptySet(), val eventDenylist: Set<String> = emptySet(), val maxContentLength: Int = 500 * 1024, val clusteringFields: List<String> = BigQuerySchema.getDefaultClusteringFields(), val logMultiModalContent: Boolean = true, val logSessionMetadata: Boolean = true, val customTags: Map<String, Any?> = emptyMap(), val autoSchemaUpgrade: Boolean = true, val createViews: Boolean = false, val viewPrefix: String = "v", val contentFormatter: (Any, String) -> Any?? = null, val retryConfig: RetryConfig = RetryConfig(), val batchSize: Int = 1, val batchFlushInterval: Duration = Duration.ofSeconds(1), val shutdownTimeout: Duration = Duration.ofSeconds(10), val queueMaxSize: Int, val flushOnRunEnd: Boolean = true, val gcsBucketName: String? = null, val connectionId: String? = null)

Configuration for the BigQueryAgentAnalyticsPlugin.

Constructors

Link copied to clipboard
constructor(projectId: String, datasetId: String, enabled: Boolean = true, location: String = "US", tableName: String = "agent_events", credentials: Credentials? = null, eventAllowlist: Set<String> = emptySet(), eventDenylist: Set<String> = emptySet(), maxContentLength: Int = 500 * 1024, clusteringFields: List<String> = BigQuerySchema.getDefaultClusteringFields(), logMultiModalContent: Boolean = true, logSessionMetadata: Boolean = true, customTags: Map<String, Any?> = emptyMap(), autoSchemaUpgrade: Boolean = true, createViews: Boolean = false, viewPrefix: String = "v", contentFormatter: (Any, String) -> Any?? = null, retryConfig: RetryConfig = RetryConfig(), batchSize: Int = 1, batchFlushInterval: Duration = Duration.ofSeconds(1), shutdownTimeout: Duration = Duration.ofSeconds(10), queueMaxSize: Int, flushOnRunEnd: Boolean = true, gcsBucketName: String? = null, connectionId: String? = null)

Types

Link copied to clipboard
class Builder

Fluent builder for BigQueryLoggerConfig, provided primarily for Java callers. Any property left unset falls back to the same default as the constructor.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Whether to add missing columns to an existing table, which needs the bigquery.tables.update permission; rows are dropped until the upgrade succeeds. When off, the table must already have every column.

Link copied to clipboard

Longest the background writer waits for a batch to fill once it has a row; must be positive.

Link copied to clipboard

Maximum rows per write request; at least 1.

Link copied to clipboard

Clustering columns for a newly created table.

Link copied to clipboard

BigQuery connection, such as us.my-connection, recorded as the authorizer of each uploaded part's object_ref.

Link copied to clipboard

Called with each event's content and type; its result is logged in place of the content. If it throws, [FORMATTER_FAILED] is logged instead.

Link copied to clipboard

Whether to create or replace one view per event type when the first event is logged.

Link copied to clipboard

Credentials of the BigQuery client the plugin creates if no client is passed in; null uses Application Default Credentials.

Link copied to clipboard

Tags logged with every event under attributes.custom_tags.

Link copied to clipboard

BigQuery dataset that holds the events table.

Link copied to clipboard

Whether the plugin logs anything.

Link copied to clipboard

Event types to log, such as LLM_REQUEST; empty logs every type.

Link copied to clipboard

Event types never to log, even when allowlisted.

Link copied to clipboard

Whether a run waits, before it completes, for every row logged so far by any run to be written or dropped. As in Python ADK, the wait has no time limit.

Link copied to clipboard

Cloud Storage bucket that binary parts, and text parts over 32 KiB or maxContentLength, are uploaded to with the BigQuery client's credentials, so that content_parts references them. Needs logMultiModalContent; when null, binary parts are logged as a placeholder and long text is truncated.

Link copied to clipboard

BigQuery location of the dataset, such as US.

Link copied to clipboard

Whether to fill the content_parts column.

Link copied to clipboard

Whether to log the session ids and state under attributes.session_metadata.

Link copied to clipboard

Budget for each logged string in UTF-8 bytes, including the ...[TRUNCATED] marker; -1 is unlimited.

Link copied to clipboard

Google Cloud project that holds the dataset.

Link copied to clipboard

Maximum rows queued in memory, at least 1; rows logged while it is full are dropped. About 1% of the slots, at least 2 but never all of them, are kept for INVOCATION_COMPLETED and INVOCATION_ERROR rows.

Link copied to clipboard

How a batch of rows that fails to write is retried.

Link copied to clipboard

How long BigQueryAgentAnalyticsPlugin.close waits for queued rows to be written; must be positive. Rows still queued after it are dropped.

Link copied to clipboard

Events table, created on first use if it does not exist.

Link copied to clipboard

Prefix of the view names, so v gives v_llm_request. Views are skipped if this prefix or the table's project, dataset or name has characters other than letters, digits, _ and -.

Functions

Link copied to clipboard

Returns a Builder initialized with this instance's properties, primarily for Java callers. Prefer it over copy from Java: copy takes every property positionally, so its signature changes whenever a property is added.