Save your warehouse metering into Snowflake
Yuki publishes your warehouse-metering data to your own Snowflake account as a private listing. You query it directly in Snowflake.
Run the steps below in a Snowflake worksheet (Snowsight) or via SnowSQL/snow.
Prerequisites
- A role with
CREATE DATABASEandIMPORT SHARE(e.g.ACCOUNTADMIN) - A running warehouse
- The listing name Yuki gave you (referred to below as
<LISTING_NAME>)
1. Create a database from the listing
USE ROLE ACCOUNTADMIN;
USE WAREHOUSE <YOUR_WAREHOUSE>;
CREATE DATABASE yuki_metering FROM LISTING '<LISTING_NAME>';
You can name the database anything; yuki_metering is just a suggestion.
2. Query your data
SELECT *
FROM yuki_metering.share.fact_warehouse_metering_share
LIMIT 100;
Columns:
| Column | Meaning |
|---|---|
warehouse_name | Warehouse name |
start_date | Day (date) of the metering record |
is_yuki_wh | Whether it ran on a Yuki-managed warehouse |
credits_used_compute | Compute credits that day |
credits_cloud_services | Cloud-services credits that day |
credits_attributed_compute_queries | Compute credits attributed to queries |
One row per warehouse per day. Example, daily credits for the last 30 days:
SELECT start_date, SUM(credits_used_compute) AS credits_used_compute
FROM yuki_metering.share.fact_warehouse_metering_share
WHERE start_date >= DATEADD(day, -30, CURRENT_DATE)
GROUP BY start_date
ORDER BY start_date;
tip
The data refreshes automatically, you don't need to re-import, just re-query.
Troubleshooting
| Symptom | What to do |
|---|---|
... is not fulfilled to your current region on CREATE DATABASE | Contact Yuki; we will enable your region and tell you when to re-run step 1. |
CREATE DATABASE fails on privileges | Use ACCOUNTADMIN, or grant your role CREATE DATABASE + IMPORT SHARE. |
No active warehouse selected in the current session | Run USE WAREHOUSE <YOUR_WAREHOUSE>; first. |
| Query returns 0 rows | Your account isn't enabled yet, or you're querying from a different account than the one registered. Contact Yuki. |
| You don't have the listing name | Ask Yuki for your <LISTING_NAME>. |