Export to BigQuery

This document describes some attributes of the BigQuery dataset that is created when a sink exports traces from Cloud Trace to BigQuery.

Schema

The schema for your table that stores trace data is determined by the Trace V2 API definition of Span.

Trace keeps track of your table columns and patches the table when a new span contains fields that can't be stored in the existing table. A patch operation is required when an arriving span contains entries not previously seen. For example, if an arriving span contains a new Attribute, the table is patched.

Data retention

You configure the data retention policies of your BigQuery tables. For information about managing tables and table data, see Working with tables.

Table type

If you configure a sink to export traces to BigQuery, Trace configures an ingestion-time partitioned table. For detailed information on partitioned tables, including how to create, managed, query, and delete these tables, see Working with partitioned tables.

Sample queries

In the following queries, DATASET is the name of the BigQuery dataset, and MY_TABLE is the name of a table in that dataset.

  • To display all columns in the table for the date of November 20, 2019 while limiting the result to 10 rows, run the query: