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.
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.
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.