Our Snowflake integration lets you collect data about query performance, or about the health of your storage systems and warehouses. The integration then presents this data in a set of pre-built , letting you view your most critical query data all in one place.
Tip
This integration falls under the Community project designation in our Open Source categories. This code is developed in the open with input from the community through issues and PRs. There is an active maintainer team within New Relic, as well as troubleshooting support in the New Relic Explorers Hub and documentation available in the project repository.
After setting up the Snowflake integration with New Relic, see your data in dashboards like these, right out of the box.
Install the infrastructure agent
To see your Snowflake data in New Relic, install our infrastructure agent. The infrastructure agent collects data from Snowflake and sends that data to New Relic, where you can use performance metrics dashboards to keep track of how your Snowflake storage system is doing.
Follow our guided install to instrument your system with the infrastructure agent.
Integrate Snowflake with New Relic
Follow these procedures to enable the infrastructure agent to capture data from your Snowflake app:
Run the following command in your CLI to clone the New Relic Snowflake repo:
To ensure you're using the most recent information for the integration, update your config.yaml file so that the file matches the snippet found in Snowflake's Key Pair authentication section.
If the New Relic infrastructure agent runs as a systemd service, follow these steps to set the environment variable. (Skip this step if you're not running the New Relic infrastructure agent as a systemd service and follow the Step 5).
To determine if you're on a system using systemd as the init service, run the following:
bash
$
[[`\systemctl`=~ -\.mount ]]&&echoyes||echo no
Set the NEWRELIC_SNOWFLAKE_HOME environment variable as documented in the Setting NEWRELIC_SNOWFLAKE_HOME section. (Skip this step if you're running the New Relic infrastructure agent as a systemd service and follow the Step 4).
Copy the relevant flex config for your platform from flexConfigs to the agent's integrations.d folder:
for Linux, find it at /etc/newrelic-infra/integrations.d/
for Windows, find it at C:\Program Files\New Relic\newrelic-infra\integrations.d\
Once you've followed all these steps, return to this doc to install the dashboard to your New Relic account.
Create custom queries
You can send your own customized metrics to New Relic and view that data in a dashboard. Below are two examples of custom queries.
To find the queries that take the longest to load:
Create a file and name it longest_queries.sql
Designate the file path as newrelic-snowflake-integrations/queries.
In longest_queries.sql, add the following snippet:
select
query_id,
query_text,
(execution_time /60000)as exec_time,
warehouse_name,
user_name,
execution_status
from
snowflake.account_usage.query_history
where
execution_status ='SUCCESS'
orderby
execution_time desc
In the flex-snowflake-linux.yml file, add the following snippet:
-name: longestQueries
entity: snowflake
# New Relic will capture all your Snowflake metrics when you use `event_type: SnowflakeVirtualWarehouse`.