If you’re managing large-scale datasets in a cloud data warehouse, you already know that Snowflake is a powerhouse for storage and processing. However, Snowflake isn’t built for the kind of high-frequency, aesthetic observability that developers need. That’s where Grafana comes in. In this connecting Grafana to Snowflake guide, I’ll walk you through the exact process I use to bridge these two tools to create high-performance dashboards.
I’ve found that many teams struggle with this setup not because of the software, but because of permission mismatches and warehouse configuration errors. By the end of this tutorial, you’ll have a live connection and a functioning visualization.
Prerequisites
Before we dive into the UI, make sure you have the following ready. If you’re still deciding on your stack, you might want to check out my comparison of Grafana vs Kibana for log visualization to ensure you’re using the right tool for the job.
- An active Snowflake account with account administrator privileges (or a user with
CREATE USERandCREATE WAREHOUSEpermissions). - A Grafana instance (Cloud or Self-hosted) version 8.0 or higher.
- Network access allowed between your Grafana server and your Snowflake account URL.
Step 1: Configure Snowflake for Grafana
You should never use your primary ACCOUNTADMIN account for Grafana. In my experience, creating a dedicated service user is the only way to maintain a proper security posture and track credit consumption specifically for your dashboards.
Run the following SQL in a Snowflake worksheet:
-- 1. Create a dedicated role for Grafana
CREATE ROLE GRAFANA_ROLE;
-- 2. Create a dedicated warehouse (X-Small is usually enough for dashboards)
CREATE WAREHOUSE GRAFANA_WH
WAREHOUSE_SIZE = 'XSMALL'
AUTO_SUSPEND = 60
AUTO_RESUME = TRUE;
-- 3. Create the service user
CREATE USER GRAFANA_USER
PASSWORD = 'YourSecurePassword123!'
DEFAULT_ROLE = GRAFANA_ROLE
DEFAULT_WAREHOUSE = GRAFANA_WH;
-- 4. Assign role and permissions
GRANT ROLE GRAFANA_ROLE TO USER GRAFANA_USER;
GRANT USAGE ON WAREHOUSE GRAFANA_WH TO ROLE GRAFANA_ROLE;
GRANT USAGE ON DATABASE YOUR_DB TO ROLE GRAFANA_ROLE;
GRANT USAGE ON SCHEMA YOUR_DB.YOUR_SCHEMA TO ROLE GRAFANA_ROLE;
GRANT SELECT ON ALL TABLES IN SCHEMA YOUR_DB.YOUR_SCHEMA TO ROLE GRAFANA_ROLE;
Step 2: Add the Snowflake Data Source in Grafana
Now that the backend is ready, we need to tell Grafana how to talk to Snowflake. As shown in the image below, you’ll need to navigate to the Connections menu to begin.
1. Log into your Grafana instance. 2. Navigate to Connections → Data Sources. 3. Click Add data source and search for Snowflake. 4. Fill in the following configuration fields:
| Field | Value/Example |
|---|---|
| Account | xy12345.us-east-1 (Do not include .snowflakecomputing.com) |
| User | GRAFANA_USER |
| Password | The password you set in Step 1 |
| Role | GRAFANA_ROLE |
| Warehouse | GRAFANA_WH |
Click Save & Test. If you see a green checkmark, you’ve successfully completed the most difficult part of this connecting Grafana to Snowflake guide.
Step 3: Building Your First Visualization
With the connection established, you can now start querying. I recommend starting with a simple Table panel to verify data flow before moving to complex time-series graphs. For those looking to scale their observability, I highly suggest reading my real-time data visualization with Grafana tutorial.
In the query editor, you can use the visual builder, but for Snowflake, I always stick to raw SQL. Here is a basic example to track record growth over time:
SELECT
$__timeFrom() as time,
count(*) as total_records
FROM YOUR_DB.YOUR_SCHEMA.YOUR_TABLE
WHERE $__timeFilter(created_at)
GROUP BY 1
Pro Tip: Always use Grafana’s built-in macros like $__timeFilter(). This ensures that when you change the time range in the Grafana UI, Snowflake only scans the necessary partitions, saving you a massive amount in compute credits.
Pro Tips for Performance
- Avoid SELECT *: Snowflake charges based on data scanned. Only select the columns you absolutely need for the visualization.
- Materialized Views: If your dashboard is slow, don’t increase the warehouse size. Instead, create a Materialized View in Snowflake for the aggregated data and point Grafana to that view.
- Cache Tuning: Adjust the ‘Min interval’ in Grafana’s query options to prevent the dashboard from hammering your Snowflake warehouse every few seconds.
Troubleshooting Common Issues
If you hit a wall, check these three common failure points:
- Invalid Account Format: This is the #1 error. Ensure you aren’t including
https://or.snowflakecomputing.comin the Account field. Only the organization and account ID (e.g.,org-account). - Warehouse Suspended: If queries timeout, ensure
AUTO_RESUME = TRUEwas set on your Grafana warehouse. - Role Hierarchy: If you get a “Table not found” error, verify that
GRAFANA_ROLEhasUSAGEpermissions on both the Database AND the Schema.
What’s Next?
Now that you’ve mastered connecting Grafana to Snowflake, you can start implementing more advanced alerting. You can set up Grafana to ping your Slack channel the moment a Snowflake query detects an anomaly in your business metrics.
If you’re interested in further optimizing your dev workflow, explore more of my guides on automation and productivity tools.