- Manual setup
- Terraform
- Share the BigQuery dataset with the Costory service account:
costory-<org-slug>@costory-production.iam.gserviceaccount.com- Grant BigQuery Data Viewer and BigQuery Metadata Viewer on the dataset. These are the same roles used for GCP billing export.
- In Costory, go to Metrics > Import new metrics datasource > BigQuery.
- Enter the GCP project ID where you shared the dataset.
- Select the tables Costory discovers in that project.
- Configure each metric: table, date column, value column, aggregation, gap filling, and optional group-by.
This connector imports usage metrics from your BigQuery tables. To import GCP billing data, use GCP Billing Setup. To export Costory dashboard data to your own BigQuery project, see BigQuery Data Exports.
Example table schema
Your table needs a date column and at least one numeric metric column. Optional string columns work as group-by dimensions.- Product analytics: daily or monthly active users, sessions, sign-ups
- Business KPIs: revenue, orders, customers, emails sent
- Application usage: API calls, background jobs, feature usage counts
- Data platform activity: query counts, bytes processed, or slot hours per team or project
Table requirements
Metric configuration
Configure metrics from a dashboard widget or in Explorer. In the metric selector, choose your BigQuery integration, then set:Save a metric for Virtual Dimensions
To use a BigQuery metric in a or shared cost allocation rule, save it as a named metric first:- Go to Metrics > Create Metric.
- Name the metric.
- Select the BigQuery table, date column, numeric column, aggregation, gap filling, and group-by.
- Save the metric, then reference it when you configure the virtual dimension rule.
Troubleshooting
Related pages
Unit Economics
Combine BigQuery metrics with cloud cost in Explorer formulas.
Shared Cost Allocation
Split shared infrastructure costs using BigQuery usage metrics.
Usage Metrics
Browse all supported usage metric sources.
BigQuery and dbt visibility
Attribute BigQuery spend by dbt model, package, or team.
