Query BigQuery tables live as external metrics in Costory Advanced Explorer. Grant dataset access, validate the project, then pick a table.
Query BigQuery tables live as external metrics in Advanced Explorer. Grant dataset-level access to the Costory service account, validate the project, then pick a table, date field, and value column. Costory does not copy table data.On Add integration, the GCP tile lists Any BigQuery table, Cloud Monitoring metrics, and BigQuery jobs. This page is BigQuery Metric: live queries against a table. For per-query dimensions on the GCP bill, see BigQuery jobs. For live GCP infrastructure metrics, see GCP Cloud Monitoring.
See BigQuery integration and cost allocation in action
Connect GCP BigQuery: grant dataset access on the left, Connection details on the right
Manual setup
Terraform
1
Open the GCP tile
Go to Integrations, click + Add integration, then under External metric choose GCP. The connect URL is /integration/new/gcp/bigquery.
2
Grant dataset access
Copy the Costory service account from the connect screen. Open the BigQuery dataset you want Costory to read, share it with that account, and grant BigQuery Data Viewer and BigQuery Metadata Viewer on the whole dataset, not on individual tables. Project-level access is not required.These are the same roles used for GCP billing export.
3
Enter connection details
Set Connection name and GCP project ID. Click Validate, then Save connection.
This connector queries 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.
An EU organization can use a US dataset if it has an EU replica. Analytics Hub linked datasets in the project are included. Share the linked dataset, not the publisher dataset.
Tables must be in the same region as your Costory workspace. Costory uses EU by default and US for US-based organizations. Multi-region locations (EU, US) work. Single-region datasets are not supported because BigQuery can only query tables in the exact same location. Replicate data to EU or US with BigQuery data replication if needed. An EU organization can use a US dataset if it has an EU replica.
Numeric column
At least one numeric column, such as FLOAT64, NUMERIC, or BIGNUMERIC.
Date column
At least one date or timestamp column: DATE, DATETIME, or TIMESTAMP.
Queries run live. Costory does not copy table data.
1
Open Advanced Explorer
Click Explore your data, then switch Classic to Advanced. Classic greys out non-cost metrics.
2
Add the BigQuery metric
Click + Add Metric. Use the integrations chip, then pick BigQuery. Helper text describes it as a live external usage metric.
Metric picker chips: cost, usage, metric, budget, and integrations
3
Choose a table and columns
Pick a table from the picker, then set Date field, Value column, Aggregate (SUM), Gap fill (FORWARD FILL, ZERO, or LINEAR), and optional Group by.
BigQuery table picker after you select the BigQuery integration
4
Fix an empty chart
If the chart is empty, pick a different table and change Period. Options include Custom dates, Trailing 7 / 30 / 45 / 90 Days, MTD, QTD, YTD, Last Week, Last Month, Last 3 / 6 / 12 months, and Last Invoice Month.
Period dropdown with Trailing 45 Days selected
In the demo workspace, demo_raw.artifact_* tables stayed empty at every range. demo_raw.raw_v2 with Trailing 90 Days rendered using date billing_period_end, value billed_cost, SUM, and FORWARD FILL.
External metric chart for demo_raw.raw_v2 with billed_cost SUM and FORWARD FILL
5
Add cost or a formula
Optionally click + Add Metric for Cost, then + Add Formula such as b / a.
Confirm the dataset is shared with the Costory service account on the whole dataset, the table has both a date and numeric column, and the dataset region matches your Costory workspace (or has an EU replica for an EU org). For Analytics Hub, share the linked dataset, not the publisher dataset.
Chart is empty
Pick a different table and change Period. In the demo workspace, demo_raw.artifact_* stayed empty. demo_raw.raw_v2 with Trailing 90 Days rendered.
Wrong date or value column selected
Open the metric configuration and pick the correct columns.
Combine BigQuery metrics with cloud cost in Explorer formulas.
Shared Cost Allocation
Split shared infrastructure costs using BigQuery usage metrics.
Metrics Correlation
Browse all supported external metric sources.
BigQuery and dbt visibility
Attribute BigQuery spend by dbt model, package, or team.
BigQuery jobs (beta)
Reallocate slots to the user who ran the query. One view of on-demand and reservations.
Last modified on October 21, 2026
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Costory Documentation","colors":{"primary":"#1D3C93","light":"#305DD9","dark":"#1D3C93"},"logo":{"light":"https://mintcdn.com/costory/jdghijjvsrOsYiTC/logo/light.png?fit=max\u0026auto=format\u0026n=jdghijjvsrOsYiTC\u0026q=85\u0026s=dee63acdba91bf952855557cc5c5ec16","dark":"https://mintcdn.com/costory/jdghijjvsrOsYiTC/logo/light.png?fit=max\u0026auto=format\u0026n=jdghijjvsrOsYiTC\u0026q=85\u0026s=dee63acdba91bf952855557cc5c5ec16","href":"https://costory.io"},"favicon":"https://mintcdn.com/costory/stODLWETeKeyz7ed/favicon-new.svg?fit=max\u0026auto=format\u0026n=stODLWETeKeyz7ed\u0026q=85\u0026s=334ff5307103e4ffc0473bb6e1b9b56c","appearance":{"default":"light","strict":true},"navbar":{"links":[{"href":"https://costory.io","label":"Website"}],"primary":{"type":"button","label":"Start a free trial","href":"https://app.costory.io/welcome-demo?utm_source=get-started"}},"integrations":{"posthog":{"apiKey":"phc_jgU0iQbU4Arfu5ouKpn9YhzkTWv3P5VfW2n7sJsKR0P","apiHost":"https://user.costory.io","sessionRecording":true}},"contextual":{"options":["copy","view","chatgpt","claude","aistudio"],"display":"header"},"metadata":{"timestamp":true},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"costory","hasAudioNarration":false,"actualSubdomain":"costory","customDomains":["docs.costory.io"],"gitSource":{"type":"github","owner":"costory-io","repo":"mintlify-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6af2033088844f4e905da51d","clientVersion":"0.0.4111","searchFilterCounts":[{"language":"default","tag":"API Reference","count":124},{"language":"default","tag":"Documentation","count":70},{"language":"default","tag":"Setup","count":44},{"language":"default","tag":"Alerts V2","count":26},{"language":"default","tag":"Dashboards","count":23},{"language":"default","tag":"Billing Data","count":22},{"language":"default","tag":"Use Cases","count":17},{"language":"default","tag":"Reports","count":16},{"language":"default","tag":"Metrics Correlation","count":13},{"language":"default","tag":"Events","count":11}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"setup/usage-metrics/bigquery","slug":"/setup/usage-metrics/bigquery","pageMetadata":{"title":"BigQuery","description":"Query BigQuery tables live as external metrics in Costory Advanced Explorer. Grant dataset access, validate the project, then pick a table.","href":"/setup/usage-metrics/bigquery"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Query BigQuery tables live as external metrics in Costory Advanced Explorer. Grant dataset access, validate the project, then pick a table.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,Frame,Heading,Note,OptimizedFrame,OptimizedImage,Step,Steps,Tab,Table,Tabs,Tip,Tooltip}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!OptimizedFrame)_missingMdxReference(`OptimizedFrame`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Tooltip)_missingMdxReference(`Tooltip`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Query BigQuery tables live as external metrics in `,_jsx(_components.a,{href:`/setup/usage-metrics#query-after-you-connect`,children:`Advanced Explorer`}),`. Grant dataset-level access to the Costory service account, validate the project, then pick a table, date field, and value column. Costory does not copy table data.`]}),`\n`,_jsxs(_components.p,{children:[`On `,_jsx(_components.strong,{children:`Add integration`}),`, the `,_jsx(_components.strong,{children:`GCP`}),` tile lists `,_jsx(_components.strong,{children:`Any BigQuery table`}),`, `,_jsx(_components.strong,{children:`Cloud Monitoring metrics`}),`, and `,_jsx(_components.strong,{children:`BigQuery jobs`}),`. This page is `,_jsx(_components.strong,{children:`BigQuery Metric`}),`: live queries against a table. For per-query dimensions on the GCP bill, see `,_jsx(_components.a,{href:`/setup/usage-metrics/bigquery-jobs`,children:`BigQuery jobs`}),`. For live GCP infrastructure metrics, see `,_jsx(_components.a,{href:`/setup/usage-metrics/gcp-cloud-monitoring`,children:`GCP Cloud Monitoring`}),`.`]}),`\n`,_jsx(Frame,{caption:`See BigQuery integration and cost allocation in action`,children:_jsx(OptimizedFrame,{className:`mint-w-full mint-aspect-video mint-rounded-xl`,src:`https://www.youtube.com/embed/feK5VErY4UQ`,title:`BigQuery external metrics and Costory integration demo`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:true})}),`\n`,_jsx(Frame,{caption:`Connect GCP BigQuery: grant dataset access on the left, Connection details on the right`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/connect-bigquery.png?fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=3bee554a9c8b79fa681c3fe6cc81cf9f`,alt:`Connect GCP BigQuery page with dataset access steps and project ID field`,\"data-og-width\":`6720`,width:`6720`,\"data-og-height\":`4200`,height:`4200`,\"data-path\":`images/external-metrics/connect-bigquery.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/connect-bigquery.png?w=280\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=081511082e29bedcfd95e6350d328564 280w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/connect-bigquery.png?w=560\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=66cb5b27721499ec82756c8c8a6c2dee 560w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/connect-bigquery.png?w=840\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=b54f2575fb7e5f62b0485056ec33358b 840w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/connect-bigquery.png?w=1100\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=edf133844a960a29fb4cbdf6d971bd4c 1100w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/connect-bigquery.png?w=1650\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=24735d709a7160e1a5f021869aa4d67a 1650w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/connect-bigquery.png?w=2500\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=b08c13bb956fcb2e9d93d969d9bb4e15 2500w`})}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Manual setup`,id:`manual-setup`,\"data-child-heading-ids\":`[\"example-table-schema\",\"table-requirements\",\"query-after-you-connect\",\"metric-configuration\",\"troubleshooting\"]`,children:[_jsxs(Steps,{children:[_jsx(Step,{title:`Open the GCP tile`,children:_jsxs(_components.p,{children:[`Go to `,_jsx(_components.a,{href:`https://app.costory.io/integration`,children:`Integrations`}),`, click `,_jsx(_components.strong,{children:`+ Add integration`}),`, then under `,_jsx(_components.strong,{children:`External metric`}),` choose `,_jsx(_components.strong,{children:`GCP`}),`. The connect URL is `,_jsx(_components.code,{children:`/integration/new/gcp/bigquery`}),`. `]})}),_jsxs(Step,{title:`Grant dataset access`,children:[_jsxs(_components.p,{children:[`Copy the Costory service account from the connect screen. Open the BigQuery dataset you want Costory to read, share it with that account, and grant `,_jsx(_components.strong,{children:`BigQuery Data Viewer`}),` and `,_jsx(_components.strong,{children:`BigQuery Metadata Viewer`}),` on the whole dataset, not on individual tables. Project-level access is not required.`]}),_jsxs(_components.p,{children:[`These are the same roles used for `,_jsx(_components.a,{href:`/setup/billing/gcp`,children:`GCP billing export`}),`.`]})]}),_jsx(Step,{title:`Enter connection details`,children:_jsxs(_components.p,{children:[`Set `,_jsx(_components.strong,{children:`Connection name`}),` and `,_jsx(_components.strong,{children:`GCP project ID`}),`. Click `,_jsx(_components.strong,{children:`Validate`}),`, then `,_jsx(_components.strong,{children:`Save connection`}),`.`]})})]}),_jsx(Note,{children:_jsxs(_components.p,{children:[`This connector queries usage metrics from your BigQuery tables. To import GCP billing data, use `,_jsx(_components.a,{href:`/setup/billing/gcp`,children:`GCP Billing Setup`}),`. To export Costory dashboard data to your own BigQuery project, see `,_jsx(_components.a,{href:`/setup/destinations/bigquery`,children:`BigQuery Data Exports`}),`.`]})}),_jsx(Tip,{children:_jsx(_components.p,{children:`An EU organization can use a US dataset if it has an EU replica. Analytics Hub linked datasets in the project are included. Share the linked dataset, not the publisher dataset.`})}),_jsx(Heading,{level:`2`,id:`example-table-schema`,children:`Example table schema`}),_jsx(_components.p,{children:`Your table needs a date column and at least one numeric metric column. Optional string columns work as group-by dimensions.`}),_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`CREATE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` TABLE`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `my-project.analytics.daily_active_users`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` usage_date `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`DATE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` product STRING,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` active_users INT64`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`]})})}),_jsx(_components.p,{children:`Common metrics to query:`}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Product analytics: daily or monthly active users, sessions, sign-ups`}),`\n`,_jsx(_components.li,{children:`Business KPIs: revenue, orders, customers, emails sent`}),`\n`,_jsx(_components.li,{children:`Application usage: API calls, background jobs, feature usage counts`}),`\n`,_jsx(_components.li,{children:`Data platform activity: query counts, bytes processed, or slot hours per team or project`}),`\n`]}),_jsx(Heading,{level:`2`,id:`table-requirements`,children:`Table requirements`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Requirement`}),_jsx(_components.th,{children:`Details`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Region`})}),_jsxs(_components.td,{children:[`Tables must be in the same region as your Costory workspace. Costory uses `,_jsx(_components.strong,{children:`EU`}),` by default and `,_jsx(_components.strong,{children:`US`}),` for US-based organizations. Multi-region locations (`,_jsx(_components.code,{children:`EU`}),`, `,_jsx(_components.code,{children:`US`}),`) work. Single-region datasets are not supported because BigQuery can only query tables in the exact same location. Replicate data to `,_jsx(_components.code,{children:`EU`}),` or `,_jsx(_components.code,{children:`US`}),` with `,_jsx(_components.a,{href:`https://cloud.google.com/bigquery/docs/data-replication`,children:`BigQuery data replication`}),` if needed. An EU organization can use a US dataset if it has an EU replica.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Numeric column`})}),_jsxs(_components.td,{children:[`At least one numeric column, such as `,_jsx(_components.code,{children:`FLOAT64`}),`, `,_jsx(_components.code,{children:`NUMERIC`}),`, or `,_jsx(_components.code,{children:`BIGNUMERIC`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Date column`})}),_jsxs(_components.td,{children:[`At least one date or timestamp column: `,_jsx(_components.code,{children:`DATE`}),`, `,_jsx(_components.code,{children:`DATETIME`}),`, or `,_jsx(_components.code,{children:`TIMESTAMP`}),`.`]})]})]})]}),_jsx(Heading,{level:`2`,id:`query-after-you-connect`,children:`Query after you connect`}),_jsx(_components.p,{children:`Queries run live. Costory does not copy table data.`}),_jsxs(Steps,{children:[_jsx(Step,{title:`Open Advanced Explorer`,children:_jsxs(_components.p,{children:[`Click `,_jsx(_components.strong,{children:`Explore your data`}),`, then switch `,_jsx(_components.strong,{children:`Classic`}),` to `,_jsx(_components.strong,{children:`Advanced`}),`. Classic greys out non-cost metrics.`]})}),_jsxs(Step,{title:`Add the BigQuery metric`,children:[_jsxs(_components.p,{children:[`Click `,_jsx(_components.strong,{children:`+ Add Metric`}),`. Use the `,_jsx(_components.strong,{children:`integrations`}),` chip, then pick `,_jsx(_components.strong,{children:`BigQuery`}),`. Helper text describes it as a live external usage metric.`]}),_jsx(Frame,{caption:`Metric picker chips: cost, usage, metric, budget, and integrations`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-metric-picker.png?fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=83a364e7392e46a8df87ec385843e3f9`,alt:`Advanced Explorer metric picker open on Cost, with integrations listing Tsuga and BigQuery`,\"data-og-width\":`6720`,width:`6720`,\"data-og-height\":`4200`,height:`4200`,\"data-path\":`images/external-metrics/explorer-metric-picker.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-metric-picker.png?w=280\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=a205f10e6ba65f35073438e597bac90e 280w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-metric-picker.png?w=560\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=18386b2207596c9372a42b9d3c47ec2e 560w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-metric-picker.png?w=840\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=7a6a7ea748326254f29b73de9a4105ae 840w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-metric-picker.png?w=1100\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=bf47c1c1c752eb1eb56c1165051fab4d 1100w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-metric-picker.png?w=1650\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=938267c18c78fc06205a1a83a325d010 1650w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-metric-picker.png?w=2500\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=65328e4eae4535153aa973b3a3f82990 2500w`})})]}),_jsxs(Step,{title:`Choose a table and columns`,children:[_jsxs(_components.p,{children:[`Pick a `,_jsx(_components.strong,{children:`table`}),` from the picker, then set `,_jsx(_components.strong,{children:`Date field`}),`, `,_jsx(_components.strong,{children:`Value column`}),`, `,_jsx(_components.strong,{children:`Aggregate`}),` (`,_jsx(_components.strong,{children:`SUM`}),`), `,_jsx(_components.strong,{children:`Gap fill`}),` (`,_jsx(_components.strong,{children:`FORWARD FILL`}),`, `,_jsx(_components.strong,{children:`ZERO`}),`, or `,_jsx(_components.strong,{children:`LINEAR`}),`), and optional `,_jsx(_components.strong,{children:`Group by`}),`.`]}),_jsx(Frame,{caption:`BigQuery table picker after you select the BigQuery integration`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-table-picker.png?fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=72f9ac21292f4f27c3ab6d0382e60619`,alt:`Select metric dropdown listing BigQuery tables such as demo_raw.artifact_registry and demo_raw.aws_ec2`,\"data-og-width\":`6720`,width:`6720`,\"data-og-height\":`4200`,height:`4200`,\"data-path\":`images/external-metrics/explorer-table-picker.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-table-picker.png?w=280\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=7bf2ff9f19fba05fdce6f41859821abb 280w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-table-picker.png?w=560\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=bd6e8e67fa49184b449a702e188adfbf 560w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-table-picker.png?w=840\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=880ef074ce0385305dd49b0b242e2f16 840w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-table-picker.png?w=1100\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=757ced7dd1c37af8b31988791cbef76c 1100w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-table-picker.png?w=1650\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=f6327de75351b4d2c18697df15ceef87 1650w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-table-picker.png?w=2500\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=1e68d1d4c1e33d6e7e66a37f9143a293 2500w`})})]}),_jsxs(Step,{title:`Fix an empty chart`,children:[_jsxs(_components.p,{children:[`If the chart is empty, pick a different table and change `,_jsx(_components.strong,{children:`Period`}),`. Options include Custom dates, Trailing 7 / 30 / 45 / 90 Days, MTD, QTD, YTD, Last Week, Last Month, Last 3 / 6 / 12 months, and Last Invoice Month.`]}),_jsx(Frame,{caption:`Period dropdown with Trailing 45 Days selected`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-period-dropdown.png?fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=7c5f901ae6651511c71163f3bb3254c2`,alt:`Advanced Explorer Period menu listing Custom dates, trailing ranges, MTD, QTD, YTD, and Last Invoice Month`,\"data-og-width\":`6720`,width:`6720`,\"data-og-height\":`4200`,height:`4200`,\"data-path\":`images/external-metrics/explorer-period-dropdown.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-period-dropdown.png?w=280\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=ee14efa3f408d953aba340450a9e3ab5 280w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-period-dropdown.png?w=560\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=3e9ac224946e77e56bd12d2c08c27a78 560w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-period-dropdown.png?w=840\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=7f74d24c86afa265a964a7e2b07439d9 840w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-period-dropdown.png?w=1100\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=cb5ffbfb0a8375052fd8708eda138728 1100w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-period-dropdown.png?w=1650\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=0b4326d91e05ea2a5584200d694ee7cf 1650w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-period-dropdown.png?w=2500\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=ca3052679ecf66c1fd3115a29e037187 2500w`})}),_jsxs(_components.p,{children:[`In the demo workspace, `,_jsx(_components.code,{children:`demo_raw.artifact_*`}),` tables stayed empty at every range. `,_jsx(_components.code,{children:`demo_raw.raw_v2`}),` with `,_jsx(_components.strong,{children:`Trailing 90 Days`}),` rendered using date `,_jsx(_components.code,{children:`billing_period_end`}),`, value `,_jsx(_components.code,{children:`billed_cost`}),`, `,_jsx(_components.strong,{children:`SUM`}),`, and `,_jsx(_components.strong,{children:`FORWARD FILL`}),`.`]}),_jsx(Frame,{caption:`External metric chart for demo_raw.raw_v2 with billed_cost SUM and FORWARD FILL`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-chart-raw-v2.png?fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=ee158e91580b31d7e8b0ddf9a5685f1c`,alt:`Advanced Explorer bar chart of Externalmetric from BigQuery demo_raw.raw_v2 over Trailing 90 Days`,\"data-og-width\":`6720`,width:`6720`,\"data-og-height\":`4200`,height:`4200`,\"data-path\":`images/external-metrics/explorer-chart-raw-v2.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-chart-raw-v2.png?w=280\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=85eaf7c56b5b150aff0a1d3936a5f6dd 280w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-chart-raw-v2.png?w=560\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=f804f1ae9167cd950631cc53d523d75d 560w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-chart-raw-v2.png?w=840\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=9ec09b0119d6c74dadcb5275d4caab7a 840w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-chart-raw-v2.png?w=1100\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=7e530c36a3dd1e768035580984876b03 1100w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-chart-raw-v2.png?w=1650\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=6b5a25b04df7fe26537bfaa09bb152f4 1650w, https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-chart-raw-v2.png?w=2500\u0026fit=max\u0026auto=format\u0026n=7N_qRRx_7ACcj7QT\u0026q=85\u0026s=b0c3e5f2d650fa42adb0b9e5670f8caf 2500w`})})]}),_jsx(Step,{title:`Add cost or a formula`,children:_jsxs(_components.p,{children:[`Optionally click `,_jsx(_components.strong,{children:`+ Add Metric`}),` for `,_jsx(_components.strong,{children:`Cost`}),`, then `,_jsx(_components.strong,{children:`+ Add Formula`}),` such as `,_jsx(_components.code,{children:`b / a`}),`.`]})})]}),_jsx(Heading,{level:`2`,id:`metric-configuration`,children:`Metric configuration`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Table`})}),_jsx(_components.td,{children:`The BigQuery table to read.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Date field`})}),_jsx(_components.td,{children:`Column used for the time series.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Value column`})}),_jsx(_components.td,{children:`Column with the metric value.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Aggregate`})}),_jsxs(_components.td,{children:[`How values are rolled up. Use `,_jsx(_components.strong,{children:`SUM`}),` unless you have a reason to pick another aggregate.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Gap fill`})}),_jsxs(_components.td,{children:[`How missing dates are filled: `,_jsx(_components.strong,{children:`FORWARD FILL`}),`, `,_jsx(_components.strong,{children:`ZERO`}),`, or `,_jsx(_components.strong,{children:`LINEAR`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Group by`})}),_jsx(_components.td,{children:`Optional dimension column to split the metric (for example team, product, or environment).`})]})]})]}),_jsxs(_components.p,{children:[`Use the series in a `,_jsx(_components.a,{href:`/features/tagging/dimensions#virtual-dimensions`,children:_jsx(Tooltip,{tip:`Rule-based dimensions that map cloud resources to business groupings like teams, products, or environments.`,cta:`See Glossary`,href:`/docs/glossary#virtual-dimensions`,children:`virtual dimension`})}),` or `,_jsx(_components.a,{href:`/features/tagging/shared-cost-allocation`,children:`shared cost allocation`}),` rule after you can query it in Explorer.`]}),_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/features/unit-economics`,children:`Unit Economics`}),` for formula examples, or `,_jsx(_components.a,{href:`/use-cases/dbt_bigquery_visibility/increase_visibility`,children:`BigQuery cost visibility with dbt`}),` for attributing warehouse spend by model or team.`]}),_jsx(Heading,{level:`2`,id:`troubleshooting`,children:`Troubleshooting`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Issue`}),_jsx(_components.th,{children:`What to check`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Table does not appear`})}),_jsx(_components.td,{children:`Confirm the dataset is shared with the Costory service account on the whole dataset, the table has both a date and numeric column, and the dataset region matches your Costory workspace (or has an EU replica for an EU org). For Analytics Hub, share the linked dataset, not the publisher dataset.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Chart is empty`})}),_jsxs(_components.td,{children:[`Pick a different table and change `,_jsx(_components.strong,{children:`Period`}),`. In the demo workspace, `,_jsx(_components.code,{children:`demo_raw.artifact_*`}),` stayed empty. `,_jsx(_components.code,{children:`demo_raw.raw_v2`}),` with `,_jsx(_components.strong,{children:`Trailing 90 Days`}),` rendered.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Wrong date or value column selected`})}),_jsx(_components.td,{children:`Open the metric configuration and pick the correct columns.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Dataset is in a single region`})}),_jsxs(_components.td,{children:[`Replicate the dataset to `,_jsx(_components.code,{children:`EU`}),` or `,_jsx(_components.code,{children:`US`}),` with `,_jsx(_components.a,{href:`https://cloud.google.com/bigquery/docs/data-replication`,children:`BigQuery data replication`}),`.`]})]})]})]})]}),_jsx(Tab,{title:`Terraform`,id:`terraform`,children:_jsx(_components.p,{children:`Not supported.`})})]}),`\n`,_jsx(Heading,{level:`2`,id:`related-pages`,children:`Related pages`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`GCP Cloud Monitoring`,icon:`chart-line`,href:`/setup/usage-metrics/gcp-cloud-monitoring`,children:_jsx(_components.p,{children:`Query live GCP metrics on the same GCP tile.`})}),_jsx(Card,{title:`Unit Economics`,icon:`chart-line`,href:`/features/unit-economics`,children:_jsx(_components.p,{children:`Combine BigQuery metrics with cloud cost in Explorer formulas.`})}),_jsx(Card,{title:`Shared Cost Allocation`,icon:`chart-pie`,href:`/features/tagging/shared-cost-allocation`,children:_jsx(_components.p,{children:`Split shared infrastructure costs using BigQuery usage metrics.`})}),_jsx(Card,{title:`Metrics Correlation`,icon:`database`,href:`/setup/usage-metrics`,children:_jsx(_components.p,{children:`Browse all supported external metric sources.`})}),_jsx(Card,{title:`BigQuery and dbt visibility`,icon:`magnifying-glass-chart`,href:`/use-cases/dbt_bigquery_visibility/increase_visibility`,children:_jsx(_components.p,{children:`Attribute BigQuery spend by dbt model, package, or team.`})}),_jsx(Card,{title:`BigQuery jobs (beta)`,icon:`code`,href:`/setup/usage-metrics/bigquery-jobs`,children:_jsx(_components.p,{children:`Reallocate slots to the user who ran the query. One view of on-demand and reservations.`})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"BigQuery","description":"Query BigQuery tables live as external metrics in Costory Advanced Explorer. Grant dataset access, validate the project, then pick a table.","href":"/setup/usage-metrics/bigquery"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Example table schema","slug":"example-table-schema","depth":2,"children":[],"tabId":"manual-setup"},{"title":"Table requirements","slug":"table-requirements","depth":2,"children":[],"tabId":"manual-setup"},{"title":"Query after you connect","slug":"query-after-you-connect","depth":2,"children":[],"tabId":"manual-setup"},{"title":"Metric configuration","slug":"metric-configuration","depth":2,"children":[],"tabId":"manual-setup"},{"title":"Troubleshooting","slug":"troubleshooting","depth":2,"children":[],"tabId":"manual-setup"},{"title":"Related pages","slug":"related-pages","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"dynamicCss":".mint-aspect-video {\n aspect-ratio: 16 / 9\n}\n.mint-w-full {\n width: 100%\n}\n.mint-rounded-xl {\n border-radius: 0.75rem\n}","subdomain":"costory","siteName":"Costory Documentation","title":"BigQuery - Costory Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-21T11:57:00.101Z","gitLastModified":"2026-10-21T11:56:14.000Z","originalFileLocation":"setup/usage-metrics/bigquery.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"light\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Query BigQuery tables live as external metrics in Costory Advanced Explorer. Grant dataset access, validate the project, then pick a table.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Costory Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/svg+xml\" sizes=\"180x180\" href=\"https://mintcdn.com/costory/stODLWETeKeyz7ed/favicon-new.svg?fit=max\u0026amp;auto=format\u0026amp;n=stODLWETeKeyz7ed\u0026amp;q=85\u0026amp;s=334ff5307103e4ffc0473bb6e1b9b56c\">\u003clink data-mint-head rel=\"icon\" type=\"image/svg+xml\" sizes=\"32x32\" href=\"https://mintcdn.com/costory/stODLWETeKeyz7ed/favicon-new.svg?fit=max\u0026amp;auto=format\u0026amp;n=stODLWETeKeyz7ed\u0026amp;q=85\u0026amp;s=334ff5307103e4ffc0473bb6e1b9b56c\">\u003clink data-mint-head rel=\"icon\" type=\"image/svg+xml\" sizes=\"16x16\" href=\"https://mintcdn.com/costory/stODLWETeKeyz7ed/favicon-new.svg?fit=max\u0026amp;auto=format\u0026amp;n=stODLWETeKeyz7ed\u0026amp;q=85\u0026amp;s=334ff5307103e4ffc0473bb6e1b9b56c\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/svg+xml\" href=\"https://mintcdn.com/costory/stODLWETeKeyz7ed/favicon-new.svg?fit=max\u0026amp;auto=format\u0026amp;n=stODLWETeKeyz7ed\u0026amp;q=85\u0026amp;s=334ff5307103e4ffc0473bb6e1b9b56c\">\u003cmeta data-mint-head property=\"og:title\" content=\"BigQuery - Costory Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Query BigQuery tables live as external metrics in Costory Advanced Explorer. Grant dataset access, validate the project, then pick a table.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Costory Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.costory.io/setup/usage-metrics/bigquery\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://costory.mintlify.site/_mintlify/api/og/v2?division=Metrics+Correlation\u0026amp;title=BigQuery\u0026amp;description=Query+BigQuery+tables+live+as+external+metrics+in+Costory+Advanced+Explorer.+Grant+dataset+access%2C+validate+the+project%2C+then+pick+a+table.\u0026amp;theme=1281d3dcbd6f73a9ab3b217e\u0026amp;signature=46e6cd052720c42b817856ddecb639f2f002bd3ebfa6cb98b100ed7bbb13ed11\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"BigQuery - Costory Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Query BigQuery tables live as external metrics in Costory Advanced Explorer. Grant dataset access, validate the project, then pick a table.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://costory.mintlify.site/_mintlify/api/og/v2?division=Metrics+Correlation\u0026amp;title=BigQuery\u0026amp;description=Query+BigQuery+tables+live+as+external+metrics+in+Costory+Advanced+Explorer.+Grant+dataset+access%2C+validate+the+project%2C+then+pick+a+table.\u0026amp;theme=1281d3dcbd6f73a9ab3b217e\u0026amp;signature=46e6cd052720c42b817856ddecb639f2f002bd3ebfa6cb98b100ed7bbb13ed11\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"https://mintlify.s3.us-west-1.amazonaws.com/costory/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Costory Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1D3C93\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.costory.io/setup/usage-metrics/bigquery\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/setup/usage-metrics/bigquery.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.costory.io/#organization\",\"name\":\"Costory Documentation\",\"url\":\"https://docs.costory.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/costory/jdghijjvsrOsYiTC/logo/light.png?fit=max\u0026auto=format\u0026n=jdghijjvsrOsYiTC\u0026q=85\u0026s=dee63acdba91bf952855557cc5c5ec16\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.costory.io#website\",\"name\":\"Costory Documentation\",\"url\":\"https://docs.costory.io\",\"publisher\":{\"@id\":\"https://docs.costory.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.costory.io/setup/usage-metrics/bigquery#webpage\",\"url\":\"https://docs.costory.io/setup/usage-metrics/bigquery\",\"name\":\"BigQuery\",\"description\":\"Query BigQuery tables live as external metrics in Costory Advanced Explorer. Grant dataset access, validate the project, then pick a table.\",\"dateModified\":\"2026-10-21T11:56:14.000Z\",\"isPartOf\":{\"@id\":\"https://docs.costory.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.costory.io/setup/usage-metrics/bigquery#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.costory.io/setup/usage-metrics/bigquery#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Setup\",\"item\":\"https://docs.costory.io/setup/billing/aiven\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Metrics Correlation\",\"item\":\"https://docs.costory.io/setup/usage-metrics\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"BigQuery\",\"item\":\"https://docs.costory.io/setup/usage-metrics/bigquery\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.costory.io/setup/usage-metrics/bigquery#article\",\"headline\":\"BigQuery\",\"name\":\"BigQuery\",\"description\":\"Query BigQuery tables live as external metrics in Costory Advanced Explorer. Grant dataset access, validate the project, then pick a table.\",\"url\":\"https://docs.costory.io/setup/usage-metrics/bigquery\",\"mainEntityOfPage\":{\"@id\":\"https://docs.costory.io/setup/usage-metrics/bigquery#webpage\"},\"dateModified\":\"2026-10-21T11:56:14.000Z\",\"publisher\":{\"@id\":\"https://docs.costory.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.costory.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Costory Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Costory Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/setup/usage-metrics/bigquery.md","siteName":"Costory Documentation","nav":{"global":null,"tabs":[{"tab":"Documentation","icon":"book","groups":[{"group":"Get Started","pages":[{"title":"Welcome to Costory","href":"/get-started/welcome"},{"title":"Quickstart: How to set up automated cloud cost reporting in 30 minutes","sidebarTitle":"Quickstart: Automate your cloud cost reporting","href":"/get-started/quickstart"},{"title":"Plans and fair use","icon":"tags","href":"/get-started/plans"}]},{"group":"Setup","pages":[{"group":"Billing Data","root":{"title":"Billing Data","href":"/setup/billing"},"pages":[{"title":"Aiven Billing Setup","href":"/setup/billing/aiven"},{"title":"Anthropic Billing Setup","href":"/setup/billing/anthropic"},{"title":"AWS Billing Setup","href":"/setup/billing/aws"},{"title":"Azure Billing Setup","href":"/setup/billing/azure"},{"title":"BytePlus Billing Setup","sidebarTitle":"BytePlus","href":"/setup/billing/byteplus"},{"title":"ClickHouse Billing Setup","href":"/setup/billing/clickhouse"},{"title":"Cloudflare Billing Setup","href":"/setup/billing/cloudflare"},{"title":"Confluent Billing Setup","href":"/setup/billing/confluent"},{"title":"Cursor Billing Setup","href":"/setup/billing/cursor"},{"title":"Databricks Billing Setup","sidebarTitle":"Databricks","href":"/setup/billing/databricks"},{"title":"Custom Billing Format (FOCUS) in BigQuery","href":"/setup/billing/focus"},{"title":"Datadog Billing Setup","href":"/setup/billing/datadog"},{"title":"Elastic Cloud Billing Setup","href":"/setup/billing/elastic-cloud"},{"title":"ElevenLabs Billing Setup","sidebarTitle":"ElevenLabs","href":"/setup/billing/elevenlabs"},{"title":"GCP Billing Setup","href":"/setup/billing/gcp"},{"title":"GCP CUD Metadata","href":"/setup/billing/gcp-cud-metadata"},{"title":"Kling AI Billing Setup","sidebarTitle":"Kling AI","href":"/setup/billing/kling-ai"},{"title":"OpenAI Billing Setup","href":"/setup/billing/openai"},{"title":"OpenRouter Billing Setup","sidebarTitle":"OpenRouter","href":"/setup/billing/openrouter"},{"title":"Oracle Cloud Infrastructure Billing Setup","sidebarTitle":"Oracle Cloud","href":"/setup/billing/oci"},{"title":"Scaleway Billing Setup","href":"/setup/billing/scaleway"},{"title":"Snowflake Billing Setup","href":"/setup/billing/snowflake"}]},{"group":"Metrics Correlation","root":{"title":"Correlate your costs with technical or business metrics","sidebarTitle":"Metrics Correlation","href":"/setup/usage-metrics"},"pages":[{"title":"Amplitude","href":"/setup/usage-metrics/amplitude"},{"title":"AWS CloudWatch","description":"Connect AWS CloudWatch as an external metric in Costory. Attach a CloudWatch read policy and trust policy, then query metrics in Advanced Explorer.","href":"/setup/usage-metrics/aws-cloudwatch"},{"title":"BigQuery","href":"/setup/usage-metrics/bigquery"},{"title":"BigQuery jobs","description":"Beta: attach BigQuery job metadata to GCP cost, reallocate slots to the user who ran each query, and see on-demand and reservation spend in one view.","sidebarTitle":"BigQuery jobs (beta)","href":"/setup/usage-metrics/bigquery-jobs"},{"title":"GCP Cloud Monitoring","sidebarTitle":"Cloud Monitoring","href":"/setup/usage-metrics/gcp-cloud-monitoring"},{"title":"Custom Metrics Push","sidebarTitle":"Custom metrics","href":"/setup/usage-metrics/custom-metrics-push"},{"title":"Datadog","href":"/setup/usage-metrics/datadog"},{"title":"Datadog CI Visibility","href":"/setup/usage-metrics/datadog-ci"},{"title":"GCS Inventory (Parquet)","href":"/setup/usage-metrics/gcs-inventory"},{"title":"Google Sheets","href":"/setup/usage-metrics/google-sheet"},{"title":"S3 metrics","href":"/setup/usage-metrics/s3-parquet"},{"title":"Snowflake Metrics","href":"/setup/usage-metrics/snowflake"},{"title":"Tsuga","href":"/setup/usage-metrics/tsuga"}]},{"group":"Data Exports","pages":[{"title":"BigQuery Data Exports","sidebarTitle":"BigQuery exports","href":"/setup/destinations/bigquery"}]},{"group":"Events","root":{"title":"Connect Engineering Events to Costory (GitHub, CI/CD, Custom API)","sidebarTitle":"Events","href":"/setup/events"},"pages":[{"title":"Connect GitHub Events","href":"/setup/events/github"},{"title":"Send Events from CI/CD Pipelines","href":"/setup/events/ci-cd"},{"title":"Send Custom Events via API","href":"/setup/events/custom-api"},{"title":"Provider Events","href":"/setup/events/provider"}]},{"group":"Collaboration","pages":[{"title":"Slack","href":"/setup/collaboration/slack"},{"title":"Microsoft Teams","href":"/setup/collaboration/teams"},{"title":"Email","href":"/setup/collaboration/email"}]},{"title":"FinOps MCP: Cloud Cost Automation for AI Assistants and Slack","href":"/features/mcp"}]},{"group":"Understand","pages":[{"title":"Explorer","sidebarTitle":"Explorer","href":"/features/cost-explorer"},{"group":"Dashboards","root":{"title":"Cloud Cost Dashboards","sidebarTitle":"Dashboards","href":"/features/dashboards"},"pages":[{"title":"Create and Organize Dashboards","sidebarTitle":"Create dashboards","href":"/features/dashboards/create-dashboard"},{"title":"Dashboard Templates","sidebarTitle":"Templates","href":"/features/dashboards/templates"},{"title":"Dashboard Widgets and Chart Types","sidebarTitle":"Widgets and charts","href":"/features/dashboards/widgets"}]},{"title":"Events","sidebarTitle":"Events","href":"/features/events"},{"title":"Unit Economics","sidebarTitle":"Unit Economics","href":"/features/unit-economics"}]},{"group":"Tag \u0026 Allocate","expanded":true,"pages":[{"title":"Tag \u0026 Allocate Cloud Costs","sidebarTitle":"Overview","href":"/features/tagging"},{"title":"Dimensions","sidebarTitle":"Dimensions","href":"/features/tagging/dimensions"},{"title":"Split Shared Infrastructure Costs Across Teams","sidebarTitle":"Shared Cost Allocation","href":"/features/tagging/shared-cost-allocation"},{"title":"Enrichments","sidebarTitle":"Enrichments","href":"/features/tagging/enrichments"}]},{"group":"Share","pages":[{"title":"Share cost views","sidebarTitle":"Sharing","href":"/features/sharing"},{"title":"Cost Reports","sidebarTitle":"Cost Reports","href":"/v2/Automate/reports"},{"title":"Cost Digest: automate your FinOps reporting","sidebarTitle":"Digest","href":"/features/digest"},{"title":"Alerts","sidebarTitle":"Alerts","href":"/features/alerts"}]},{"group":"Teams","pages":[{"title":"Teams","sidebarTitle":"Teams","href":"/features/teams"},{"title":"Cloud Cost Budgets and Budget Alerts","sidebarTitle":"Budgets","href":"/features/budgets"}]},{"group":"Technical Documentation","pages":[{"group":"Cost Metrics","root":{"title":"Cost Metrics","href":"/docs/cost-metrics"},"pages":[{"title":"Contracted Cost vs Billed Cost: Savings Plan discount sharing issues","sidebarTitle":"Savings Plan discount sharing issues","href":"/docs/savings-plan-cost-fluctuation"},{"title":"Cloud Cost Currency Conversion","href":"/docs/currency-conversion"}]},{"title":"Standard Columns","href":"/docs/standard-columns"},{"title":"Billing Data Refresh Schedule and Cloud Cost Data Freshness","href":"/docs/data-refresh"},{"title":"Settings","sidebarTitle":"Settings","href":"/get-started/settings"},{"group":"Security","root":{"title":"Security","href":"/docs/security"},"pages":[{"title":"Identity and Access","href":"/docs/sso-access-control"},{"title":"Subprocessors","href":"/docs/subprocessors"}]}]},{"group":"Glossary","pages":[{"title":"Glossary","href":"/docs/glossary"}]}]},{"tab":"Use Cases","icon":"lightbulb","pages":[{"title":"Use Cases","href":"/use-cases/overview"}]},{"tab":"API Reference","icon":"code","pages":[{"title":"API Reference","href":"/api-reference/overview"}]},{"tab":"Changelog","icon":"clock-rotate-left","pages":[{"title":"Changelog","href":"/changelog"}]},{"tab":"FinOps Memes","icon":"face-laugh-squint","pages":[{"title":"FinOps Memes","href":"/docs/finops-memes"}]}]},"basePath":"","title":"BigQuery - Costory Documentation","buildId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","deploymentId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","dynamics":["07c022d89b","a74be98ba7","a9bb46feb3"],"chunks":["Frame-u3J1-UOn.js","DynamicMarkdown-B-f2cqXQ.js","zoom-image-lightbox-DTFzvaXJ.js","lightbox-handle-r17bVUz3.js","Markdown-D13FWkIM.js","clsx-D3Isdib3.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-C-XZBk9h.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink--qIqmmVG.js"]}