Query Snowflake tables as live external metrics in Costory. Reuse the billing integration, grant one database, then pick tables in Advanced Explorer.
Active users, sessions, or warehouse activity often already live in Snowflake, while cloud spend lives in Costory. Grant the existing billing role a metrics database, then query those tables live in Advanced Explorer.Reuse the Costory Snowflake user and warehouse. Pick a table, date field, and value column. Costory queries through the Snowflake SQL API and does not copy table data.Use this when the signal already lives in Snowflake:
Business metrics such as active users, sessions, or devices
Technical metrics for shared cost allocation, such as query counts or bytes scanned by team
The Snowflake billing connection stays on the SNOWFLAKE database. Metrics are a second grant on databases you choose.
Advanced Explorer querying MY_BUSINESS_DB.ANALYTICS.MONTHLY_BUSINESS_METRICS as a Snowflake metric
Manual setup
Terraform
1
Connect Snowflake billing first
You need an existing Snowflake integration (user, role, and warehouse). If none exists, follow Snowflake billing setup, then come back here. Costory does not create a second user or warehouse for metrics. If you create a new one set the warehouse to AUTO_SUSPEND = 30 and AUTO_RESUME = TRUE so it suspends shortly after Costory queries.
2
Open Snowflake Metrics
Go to Integrations, click + Add integration, choose Snowflake, then Metrics. The connect URL is /integration/new/snowflake/metrics.
3
Select the existing integration
Under Existing integration, pick the Snowflake connection already used for billing. Already visible lists databases you granted earlier.
4
Grant database access
Enter the Database name Costory should catalog (for example ANALYTICS). Run the grant SQL Costory shows as ACCOUNTADMIN. The default role is COSTORY unless your integration uses another role.
GRANT USAGE ON DATABASE ANALYTICS TO ROLE COSTORY;GRANT USAGE ON ALL SCHEMAS IN DATABASE ANALYTICS TO ROLE COSTORY;GRANT SELECT ON ALL TABLES IN DATABASE ANALYTICS TO ROLE COSTORY;GRANT SELECT ON ALL VIEWS IN DATABASE ANALYTICS TO ROLE COSTORY;GRANT SELECT ON FUTURE TABLES IN DATABASE ANALYTICS TO ROLE COSTORY;GRANT SELECT ON FUTURE VIEWS IN DATABASE ANALYTICS TO ROLE COSTORY;
Replace ANALYTICS and COSTORY with the identifiers on the connect screen if they differ.
5
Validate, then save
Click Validate. Costory checks that it can list tables in that database. Save stays disabled until validation succeeds. Tables in the database then appear as external metrics.
Save stays disabled until validation succeeds. You can add more databases later on the same integration. Each grant is additive.
Example table schema
Your table needs a date or timestamp 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: orders, customers, revenue snapshots already in Snowflake
Warehouse activity: query counts or bytes scanned by warehouse, team, or query tag
Table requirements
Requirement
Details
Catalog
Tables must live in a database listed under Already visible on the Snowflake metrics connection.
Numeric column
At least one numeric type, such as NUMBER, DECIMAL, FLOAT, or INTEGER.
Date column
At least one date or timestamp type: DATE, DATETIME, or TIMESTAMP (including TIMESTAMP_NTZ).
Identifier
Metric ids in Explorer are DATABASE.SCHEMA.TABLE.
Query after you connect
Queries run live through the Snowflake SQL API.
1
Open Advanced Explorer
Click Explore your data, then switch Classic to Advanced. Classic greys out non-cost metrics.
2
Add the Snowflake metric
Click + Add Metric. Use the integrations chip, then pick the Snowflake source. Helper text describes it as a live external usage metric.
3
Choose a table and columns
Pick a table, then set Date field, Value column, Aggregate (SUM, AVG, MAX, or MIN), Gap fill (FORWARD FILL, ZERO, or LINEAR), and optional Group by.In this example, MY_BUSINESS_DB.ANALYTICS.MONTHLY_BUSINESS_METRICS uses date METRIC_DATE, value ACTIVE_CUSTOMERS, SUM, FORWARD FILL, and Last 3 months. The metric column picker lists every numeric column on the table (ARR_EUR, NEW_CUSTOMERS, and so on).
Snowflake metric in Advanced Explorer: table, METRIC_DATE, ACTIVE_CUSTOMERS, SUM, FORWARD FILL
4
Add cost or a formula
Optionally click + Add Metric for Cost, then + Add Formula such as b / a. See Unit Economics.
How missing dates are filled: FORWARD FILL, ZERO, or LINEAR.
Group by
Optional string column to split the metric (for example product, team, or warehouse).
Troubleshooting
Issue
What to check
No existing integration
Connect Snowflake for billing first, then open Metrics on the same tile.
Validate fails
Run the grant SQL as ACCOUNTADMIN. Confirm the database name matches Snowflake (quoted names are case-sensitive).
Table does not appear
Confirm the table is in a visible database, has both a date and a numeric column, and is not in INFORMATION_SCHEMA.
Chart is empty
Pick a different table and change Period. Confirm the date column has rows in that range.
Not supported.
Related pages
Snowflake billing
Create the key-pair integration this connector reuses.
Unit Economics
Combine Snowflake metrics with cloud cost in Explorer formulas.
Shared Cost Allocation
Split shared infrastructure using a Snowflake usage metric.
Metrics Correlation
Browse all supported external metric sources.
Last modified on September 27, 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 30-day free trial","href":"https://app.costory.io/welcome-demo?utm_source=docs\u0026utm_content=nav\u0026cta=docs-nav"}},"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":"6afff8e33f79c4b4eebb368b","clientVersion":"0.0.4271","searchFilterCounts":[{"language":"default","tag":"API Reference","count":124},{"language":"default","tag":"Documentation","count":77},{"language":"default","tag":"Setup","count":47},{"language":"default","tag":"Alerts V2","count":26},{"language":"default","tag":"Dashboards","count":23},{"language":"default","tag":"Billing Data","count":23},{"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":"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":"site-roles","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},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"setup/usage-metrics/snowflake","slug":"/setup/usage-metrics/snowflake","pageMetadata":{"title":"Snowflake Metrics","description":"Query Snowflake tables as live external metrics in Costory. Reuse the billing integration, grant one database, then pick tables in Advanced Explorer.","href":"/setup/usage-metrics/snowflake"},"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 Snowflake tables as live external metrics in Costory. Reuse the billing integration, grant one database, then pick tables in Advanced Explorer.\"\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,OptimizedImage,Step,Steps,Tab,Table,Tabs,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(!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(!Tooltip)_missingMdxReference(`Tooltip`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Active users, sessions, or warehouse activity often already live in Snowflake, while cloud spend lives in Costory. Grant the existing billing role a metrics database, then query those tables live in `,_jsx(_components.a,{href:`/setup/usage-metrics#query-after-you-connect`,children:`Advanced Explorer`}),`.`]}),`\n`,_jsx(_components.p,{children:`Reuse the Costory Snowflake user and warehouse. Pick a table, date field, and value column. Costory queries through the Snowflake SQL API and does not copy table data.`}),`\n`,_jsx(_components.p,{children:`Use this when the signal already lives in Snowflake:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Business metrics such as active users, sessions, or devices`}),`\n`,_jsxs(_components.li,{children:[`Technical metrics for `,_jsx(_components.a,{href:`/features/tagging/shared-cost-allocation`,children:`shared cost allocation`}),`, such as query counts or bytes scanned by team`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/setup/billing/snowflake`,children:`Snowflake billing`}),` connection stays on the `,_jsx(_components.code,{children:`SNOWFLAKE`}),` database. Metrics are a second grant on databases you choose.`]}),`\n`,_jsx(Frame,{caption:`Advanced Explorer querying MY_BUSINESS_DB.ANALYTICS.MONTHLY_BUSINESS_METRICS as a Snowflake metric`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/costory/3SYdh4Ukhpv-OdqB/images/external-metrics/explorer-snowflake-metric.png?fit=max\u0026auto=format\u0026n=3SYdh4Ukhpv-OdqB\u0026q=85\u0026s=ee66497ca99744eb5993b36de6d99392`,alt:`Advanced Explorer bar chart of ACTIVE_CUSTOMERS from Snowflake table MY_BUSINESS_DB.ANALYTICS.MONTHLY_BUSINESS_METRICS, with METRIC_DATE, SUM, and FORWARD FILL`,\"data-og-width\":`1906`,width:`1906`,\"data-og-height\":`986`,height:`986`,\"data-path\":`images/external-metrics/explorer-snowflake-metric.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/costory/3SYdh4Ukhpv-OdqB/images/external-metrics/explorer-snowflake-metric.png?w=280\u0026fit=max\u0026auto=format\u0026n=3SYdh4Ukhpv-OdqB\u0026q=85\u0026s=6ec3e5a6b004a8cbcbc7f74adc7903b5 280w, https://mintcdn.com/costory/3SYdh4Ukhpv-OdqB/images/external-metrics/explorer-snowflake-metric.png?w=560\u0026fit=max\u0026auto=format\u0026n=3SYdh4Ukhpv-OdqB\u0026q=85\u0026s=a3699617c6c35c248d7fd853cd55a895 560w, https://mintcdn.com/costory/3SYdh4Ukhpv-OdqB/images/external-metrics/explorer-snowflake-metric.png?w=840\u0026fit=max\u0026auto=format\u0026n=3SYdh4Ukhpv-OdqB\u0026q=85\u0026s=f6e2b5e3352d5426216afb2109ec3c5c 840w, https://mintcdn.com/costory/3SYdh4Ukhpv-OdqB/images/external-metrics/explorer-snowflake-metric.png?w=1100\u0026fit=max\u0026auto=format\u0026n=3SYdh4Ukhpv-OdqB\u0026q=85\u0026s=13e882d0d0d9da77eb62f6723a5c1bae 1100w, https://mintcdn.com/costory/3SYdh4Ukhpv-OdqB/images/external-metrics/explorer-snowflake-metric.png?w=1650\u0026fit=max\u0026auto=format\u0026n=3SYdh4Ukhpv-OdqB\u0026q=85\u0026s=91d0f385bc559005d8515e022bfc6447 1650w, https://mintcdn.com/costory/3SYdh4Ukhpv-OdqB/images/external-metrics/explorer-snowflake-metric.png?w=2500\u0026fit=max\u0026auto=format\u0026n=3SYdh4Ukhpv-OdqB\u0026q=85\u0026s=ffe88725c78b1d6c1af9750d16e100f4 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:`Connect Snowflake billing first`,children:_jsxs(_components.p,{children:[`You need an existing Snowflake integration (user, role, and warehouse). If none exists, follow `,_jsx(_components.a,{href:`/setup/billing/snowflake`,children:`Snowflake billing setup`}),`, then come back here. Costory does not create a second user or warehouse for metrics. If you create a new one set the warehouse to `,_jsx(_components.code,{children:`AUTO_SUSPEND = 30`}),` and `,_jsx(_components.code,{children:`AUTO_RESUME = TRUE`}),` so it suspends shortly after Costory queries.`]})}),_jsx(Step,{title:`Open Snowflake Metrics`,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`}),`, choose `,_jsx(_components.strong,{children:`Snowflake`}),`, then `,_jsx(_components.strong,{children:`Metrics`}),`. The connect URL is `,_jsx(_components.code,{children:`/integration/new/snowflake/metrics`}),`. `]})}),_jsx(Step,{title:`Select the existing integration`,children:_jsxs(_components.p,{children:[`Under `,_jsx(_components.strong,{children:`Existing integration`}),`, pick the Snowflake connection already used for billing. `,_jsx(_components.strong,{children:`Already visible`}),` lists databases you granted earlier.`]})}),_jsxs(Step,{title:`Grant database access`,children:[_jsxs(_components.p,{children:[`Enter the `,_jsx(_components.strong,{children:`Database`}),` name Costory should catalog (for example `,_jsx(_components.code,{children:`ANALYTICS`}),`). Run the grant SQL Costory shows as `,_jsx(_components.strong,{children:`ACCOUNTADMIN`}),`. The default role is `,_jsx(_components.strong,{children:`COSTORY`}),` unless your integration uses another role.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`6`,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:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GRANT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` USAGE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`ON`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` DATABASE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ANALYTICS `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`TO`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` ROLE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` COSTORY;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GRANT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` USAGE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`ON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ALL SCHEMAS `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`IN`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` DATABASE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ANALYTICS `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`TO`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` ROLE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` COSTORY;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GRANT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` SELECT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` ON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ALL TABLES `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`IN`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` DATABASE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ANALYTICS `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`TO`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` ROLE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` COSTORY;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GRANT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` SELECT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` ON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ALL VIEWS `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`IN`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` DATABASE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ANALYTICS `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`TO`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` ROLE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` COSTORY;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GRANT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` SELECT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` ON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` FUTURE TABLES `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`IN`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` DATABASE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ANALYTICS `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`TO`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` ROLE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` COSTORY;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`GRANT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` SELECT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` ON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` FUTURE VIEWS `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`IN`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` DATABASE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ANALYTICS `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`TO`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` ROLE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` COSTORY;`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`Replace `,_jsx(_components.code,{children:`ANALYTICS`}),` and `,_jsx(_components.code,{children:`COSTORY`}),` with the identifiers on the connect screen if they differ.`]})]}),_jsx(Step,{title:`Validate, then save`,children:_jsxs(_components.p,{children:[`Click `,_jsx(_components.strong,{children:`Validate`}),`. Costory checks that it can list tables in that database. `,_jsx(_components.strong,{children:`Save`}),` stays disabled until validation succeeds. Tables in the database then appear as external metrics.`]})})]}),_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Save`}),` stays disabled until validation succeeds. You can add more databases later on the same integration. Each grant is additive.`]})}),_jsx(Heading,{level:`2`,id:`example-table-schema`,children:`Example table schema`}),_jsx(_components.p,{children:`Your table needs a date or timestamp column and at least one numeric metric column. Optional string columns work as group-by dimensions.`}),_jsx(CodeBlock,{filename:``,numberOfLines:`6`,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:`6`,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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` MY_BUSINESS_DB`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`ANALYTICS`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`MONTHLY_BUSINESS_METRICS`}),_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:` METRIC_DATE `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`DATE`}),_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:` ACTIVE_CUSTOMERS `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`NUMBER`}),_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:` NEW_CUSTOMERS `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`NUMBER`}),_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:` ARR_EUR `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`NUMBER`})]}),`\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: orders, customers, revenue snapshots already in Snowflake`}),`\n`,_jsx(_components.li,{children:`Warehouse activity: query counts or bytes scanned by warehouse, team, or query tag`}),`\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:`Catalog`})}),_jsxs(_components.td,{children:[`Tables must live in a database listed under `,_jsx(_components.strong,{children:`Already visible`}),` on the Snowflake metrics connection.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Numeric column`})}),_jsxs(_components.td,{children:[`At least one numeric type, such as `,_jsx(_components.code,{children:`NUMBER`}),`, `,_jsx(_components.code,{children:`DECIMAL`}),`, `,_jsx(_components.code,{children:`FLOAT`}),`, or `,_jsx(_components.code,{children:`INTEGER`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Date column`})}),_jsxs(_components.td,{children:[`At least one date or timestamp type: `,_jsx(_components.code,{children:`DATE`}),`, `,_jsx(_components.code,{children:`DATETIME`}),`, or `,_jsx(_components.code,{children:`TIMESTAMP`}),` (including `,_jsx(_components.code,{children:`TIMESTAMP_NTZ`}),`).`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Identifier`})}),_jsxs(_components.td,{children:[`Metric ids in Explorer are `,_jsx(_components.code,{children:`DATABASE.SCHEMA.TABLE`}),`.`]})]})]})]}),_jsx(Heading,{level:`2`,id:`query-after-you-connect`,children:`Query after you connect`}),_jsx(_components.p,{children:`Queries run live through the Snowflake SQL API.`}),_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.`]})}),_jsx(Step,{title:`Add the Snowflake metric`,children:_jsxs(_components.p,{children:[`Click `,_jsx(_components.strong,{children:`+ Add Metric`}),`. Use the `,_jsx(_components.strong,{children:`integrations`}),` chip, then pick the Snowflake source. Helper text describes it as a live external usage metric.`]})}),_jsxs(Step,{title:`Choose a table and columns`,children:[_jsxs(_components.p,{children:[`Pick a `,_jsx(_components.strong,{children:`table`}),`, then set `,_jsx(_components.strong,{children:`Date field`}),`, `,_jsx(_components.strong,{children:`Value column`}),`, `,_jsx(_components.strong,{children:`Aggregate`}),` (`,_jsx(_components.code,{children:`SUM`}),`, `,_jsx(_components.code,{children:`AVG`}),`, `,_jsx(_components.code,{children:`MAX`}),`, or `,_jsx(_components.code,{children:`MIN`}),`), `,_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`}),`.`]}),_jsxs(_components.p,{children:[`In this example, `,_jsx(_components.code,{children:`MY_BUSINESS_DB.ANALYTICS.MONTHLY_BUSINESS_METRICS`}),` uses date `,_jsx(_components.code,{children:`METRIC_DATE`}),`, value `,_jsx(_components.code,{children:`ACTIVE_CUSTOMERS`}),`, `,_jsx(_components.strong,{children:`SUM`}),`, `,_jsx(_components.strong,{children:`FORWARD FILL`}),`, and `,_jsx(_components.strong,{children:`Last 3 months`}),`. The metric column picker lists every numeric column on the table (`,_jsx(_components.code,{children:`ARR_EUR`}),`, `,_jsx(_components.code,{children:`NEW_CUSTOMERS`}),`, and so on).`]}),_jsx(Frame,{caption:`Snowflake metric in Advanced Explorer: table, METRIC_DATE, ACTIVE_CUSTOMERS, SUM, FORWARD FILL`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/costory/3SYdh4Ukhpv-OdqB/images/external-metrics/explorer-snowflake-metric.png?fit=max\u0026auto=format\u0026n=3SYdh4Ukhpv-OdqB\u0026q=85\u0026s=ee66497ca99744eb5993b36de6d99392`,alt:`Advanced Explorer with Snowflake metric MY_BUSINESS_DB.ANALYTICS.MONTHLY_BUSINESS_METRICS, date METRIC_DATE, value ACTIVE_CUSTOMERS, and the metric column dropdown open`,\"data-og-width\":`1906`,width:`1906`,\"data-og-height\":`986`,height:`986`,\"data-path\":`images/external-metrics/explorer-snowflake-metric.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/costory/3SYdh4Ukhpv-OdqB/images/external-metrics/explorer-snowflake-metric.png?w=280\u0026fit=max\u0026auto=format\u0026n=3SYdh4Ukhpv-OdqB\u0026q=85\u0026s=6ec3e5a6b004a8cbcbc7f74adc7903b5 280w, https://mintcdn.com/costory/3SYdh4Ukhpv-OdqB/images/external-metrics/explorer-snowflake-metric.png?w=560\u0026fit=max\u0026auto=format\u0026n=3SYdh4Ukhpv-OdqB\u0026q=85\u0026s=a3699617c6c35c248d7fd853cd55a895 560w, https://mintcdn.com/costory/3SYdh4Ukhpv-OdqB/images/external-metrics/explorer-snowflake-metric.png?w=840\u0026fit=max\u0026auto=format\u0026n=3SYdh4Ukhpv-OdqB\u0026q=85\u0026s=f6e2b5e3352d5426216afb2109ec3c5c 840w, https://mintcdn.com/costory/3SYdh4Ukhpv-OdqB/images/external-metrics/explorer-snowflake-metric.png?w=1100\u0026fit=max\u0026auto=format\u0026n=3SYdh4Ukhpv-OdqB\u0026q=85\u0026s=13e882d0d0d9da77eb62f6723a5c1bae 1100w, https://mintcdn.com/costory/3SYdh4Ukhpv-OdqB/images/external-metrics/explorer-snowflake-metric.png?w=1650\u0026fit=max\u0026auto=format\u0026n=3SYdh4Ukhpv-OdqB\u0026q=85\u0026s=91d0f385bc559005d8515e022bfc6447 1650w, https://mintcdn.com/costory/3SYdh4Ukhpv-OdqB/images/external-metrics/explorer-snowflake-metric.png?w=2500\u0026fit=max\u0026auto=format\u0026n=3SYdh4Ukhpv-OdqB\u0026q=85\u0026s=ffe88725c78b1d6c1af9750d16e100f4 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`}),`. See `,_jsx(_components.a,{href:`/features/unit-economics`,children:`Unit Economics`}),`.`]})})]}),_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.`]}),_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`})}),_jsxs(_components.td,{children:[`Fully qualified Snowflake table (`,_jsx(_components.code,{children:`DATABASE.SCHEMA.TABLE`}),`).`]})]}),_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: `,_jsx(_components.strong,{children:`SUM`}),`, `,_jsx(_components.strong,{children:`AVG`}),`, `,_jsx(_components.strong,{children:`MAX`}),`, or `,_jsx(_components.strong,{children:`MIN`}),`.`]})]}),_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 string column to split the metric (for example product, team, or warehouse).`})]})]})]}),_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:`No existing integration`})}),_jsxs(_components.td,{children:[`Connect Snowflake for billing first, then open `,_jsx(_components.strong,{children:`Metrics`}),` on the same tile.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Validate fails`})}),_jsxs(_components.td,{children:[`Run the grant SQL as `,_jsx(_components.strong,{children:`ACCOUNTADMIN`}),`. Confirm the database name matches Snowflake (quoted names are case-sensitive).`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Table does not appear`})}),_jsxs(_components.td,{children:[`Confirm the table is in a visible database, has both a date and a numeric column, and is not in `,_jsx(_components.code,{children:`INFORMATION_SCHEMA`}),`.`]})]}),_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`}),`. Confirm the date column has rows in that range.`]})]})]})]})]}),_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:`Snowflake billing`,icon:`database`,href:`/setup/billing/snowflake`,children:_jsx(_components.p,{children:`Create the key-pair integration this connector reuses.`})}),_jsx(Card,{title:`Unit Economics`,icon:`calculator`,href:`/features/unit-economics`,children:_jsx(_components.p,{children:`Combine Snowflake 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 using a Snowflake usage metric.`})}),_jsx(Card,{title:`Metrics Correlation`,icon:`database`,href:`/setup/usage-metrics`,children:_jsx(_components.p,{children:`Browse all supported external metric sources.`})})]})]})}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":"Snowflake Metrics","description":"Query Snowflake tables as live external metrics in Costory. Reuse the billing integration, grant one database, then pick tables in Advanced Explorer.","href":"/setup/usage-metrics/snowflake"}}},"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":[],"subdomain":"costory","siteName":"Costory Documentation","title":"Snowflake Metrics - Costory Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-27T12:47:13.568Z","gitLastModified":"2026-09-27T12:46:58.000Z","originalFileLocation":"setup/usage-metrics/snowflake.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 Snowflake tables as live external metrics in Costory. Reuse the billing integration, grant one database, then pick tables in Advanced Explorer.\">\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=\"Snowflake Metrics - Costory Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Query Snowflake tables as live external metrics in Costory. Reuse the billing integration, grant one database, then pick tables in Advanced Explorer.\">\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/snowflake\">\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=Snowflake+Metrics\u0026amp;description=Query+Snowflake+tables+as+live+external+metrics+in+Costory.+Reuse+the+billing+integration%2C+grant+one+database%2C+then+pick+tables+in+Advanced+Explorer.\u0026amp;theme=1281d3dcbd6f73a9ab3b217e\u0026amp;signature=40bb4b7c06a938179e8c73841edd707f81d065857ed01fb699eccf4968ca8b82\">\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=\"Snowflake Metrics - Costory Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Query Snowflake tables as live external metrics in Costory. Reuse the billing integration, grant one database, then pick tables in Advanced Explorer.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://costory.mintlify.site/_mintlify/api/og/v2?division=Metrics+Correlation\u0026amp;title=Snowflake+Metrics\u0026amp;description=Query+Snowflake+tables+as+live+external+metrics+in+Costory.+Reuse+the+billing+integration%2C+grant+one+database%2C+then+pick+tables+in+Advanced+Explorer.\u0026amp;theme=1281d3dcbd6f73a9ab3b217e\u0026amp;signature=40bb4b7c06a938179e8c73841edd707f81d065857ed01fb699eccf4968ca8b82\">\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/snowflake\">\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/snowflake.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/snowflake#webpage\",\"url\":\"https://docs.costory.io/setup/usage-metrics/snowflake\",\"name\":\"Snowflake Metrics\",\"description\":\"Query Snowflake tables as live external metrics in Costory. Reuse the billing integration, grant one database, then pick tables in Advanced Explorer.\",\"dateModified\":\"2026-09-27T12:46:58.000Z\",\"isPartOf\":{\"@id\":\"https://docs.costory.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.costory.io/setup/usage-metrics/snowflake#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.costory.io/setup/usage-metrics/snowflake#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\":\"Snowflake Metrics\",\"item\":\"https://docs.costory.io/setup/usage-metrics/snowflake\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.costory.io/setup/usage-metrics/snowflake#article\",\"headline\":\"Snowflake Metrics\",\"name\":\"Snowflake Metrics\",\"description\":\"Query Snowflake tables as live external metrics in Costory. Reuse the billing integration, grant one database, then pick tables in Advanced Explorer.\",\"url\":\"https://docs.costory.io/setup/usage-metrics/snowflake\",\"mainEntityOfPage\":{\"@id\":\"https://docs.costory.io/setup/usage-metrics/snowflake#webpage\"},\"dateModified\":\"2026-09-27T12:46:58.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/snowflake.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":"Concepts","href":"/get-started/concepts"},{"title":"Quickstart: connect your first bill 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","sidebarTitle":"Aiven","href":"/setup/billing/aiven"},{"title":"Anthropic Billing Setup","sidebarTitle":"Anthropic","href":"/setup/billing/anthropic"},{"title":"AWS Billing Setup","sidebarTitle":"AWS","href":"/setup/billing/aws"},{"title":"Azure Billing Setup","sidebarTitle":"Azure","href":"/setup/billing/azure"},{"title":"BytePlus Billing Setup","sidebarTitle":"BytePlus","href":"/setup/billing/byteplus"},{"title":"ClickHouse Billing Setup","sidebarTitle":"ClickHouse","href":"/setup/billing/clickhouse"},{"title":"Cloudflare Billing Setup","sidebarTitle":"Cloudflare","href":"/setup/billing/cloudflare"},{"title":"Confluent Billing Setup","sidebarTitle":"Confluent","href":"/setup/billing/confluent"},{"title":"Cursor Billing Setup","sidebarTitle":"Cursor","href":"/setup/billing/cursor"},{"title":"Databricks Billing Setup","sidebarTitle":"Databricks","href":"/setup/billing/databricks"},{"title":"Custom Billing Format (FOCUS) in BigQuery","sidebarTitle":"Custom FOCUS (BigQuery)","href":"/setup/billing/focus"},{"title":"Datadog Billing Setup","sidebarTitle":"Datadog","href":"/setup/billing/datadog"},{"title":"Elastic Cloud Billing Setup","sidebarTitle":"Elastic Cloud","href":"/setup/billing/elastic-cloud"},{"title":"ElevenLabs Billing Setup","sidebarTitle":"ElevenLabs","href":"/setup/billing/elevenlabs"},{"title":"GCP Billing Setup","sidebarTitle":"GCP","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":"Nebius Billing Setup","sidebarTitle":"Nebius","href":"/setup/billing/nebius"},{"title":"OpenAI Billing Setup","sidebarTitle":"OpenAI","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","sidebarTitle":"Scaleway","href":"/setup/billing/scaleway"},{"title":"Snowflake Billing Setup","sidebarTitle":"Snowflake","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","href":"/setup/usage-metrics/aws-cloudwatch"},{"title":"BigQuery","href":"/setup/usage-metrics/bigquery"},{"title":"BigQuery jobs","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","description":"Connect Parquet files from AWS S3 as external metrics in Costory. Scan a bucket prefix, then query discovered metrics in Advanced Explorer.","href":"/setup/usage-metrics/s3-parquet"},{"title":"Snowflake Metrics","href":"/setup/usage-metrics/snowflake"},{"title":"Tsuga","description":"Connect Tsuga live cluster metrics to Costory with an Operation API key, then query them in Advanced Explorer.","href":"/setup/usage-metrics/tsuga"}]},{"group":"Data Exports","pages":[{"title":"Data exports","sidebarTitle":"Data 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":"Costory FinOps MCP: setup for Claude, Claude Code, Cursor and Copilot","href":"/features/mcp"},{"title":"Costory skills for AI assistants","sidebarTitle":"Skills","href":"/features/skills"},{"title":"Terraform provider for Costory","sidebarTitle":"Terraform","href":"/setup/terraform"}]},{"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":"Scouts","sidebarTitle":"Scouts","href":"/features/scouts"},{"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":"Kubernetes Cost Allocation","sidebarTitle":"Kubernetes Cost Allocation","href":"/features/tagging/kubernetes-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":"/features/slack-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"}]},{"group":"Resources","pages":[{"title":" ","sidebarTitle":"FinOps Memes","href":"/docs/finops-memes"}]}]},{"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"}]}]},"basePath":"","title":"Snowflake Metrics - Costory Documentation","deploymentId":"dpl_Em2U4NQQ2N2DE3HPbPUJVZLnAtvc","buildId":"dpl_Em2U4NQQ2N2DE3HPbPUJVZLnAtvc","dynamics":["07c022d89b","a74be98ba7","a9bb46feb3"],"chunks":["Frame-DMn5ZJp6.js","DynamicMarkdown-5yMTCLas.js","zoom-image-lightbox-BUkqX3JF.js","lightbox-handle-r17bVUz3.js","Markdown-Dy9a8hT8.js","AssistantPageLink-87tSPwGm.js","dist-CXMB3QQU.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}