Snowflake integration for warehouse native experiments

Snowflake Native Experimentation works only with LaunchDarkly experiment data

You cannot run Snowflake native experiments on experiment data coming from third-party sources, or flag evaluation data from LaunchDarkly that was not generated as part of a LaunchDarkly experiment.

Overview

This topic explains how to set up the Snowflake Warehouse Native Experimentation integration for warehouse native experiments.

Before you set up the integration, ensure you have the proper role permissions and install the LaunchDarkly Warehouse Native Experimentation app in Snowflake. You must also prepare a metric events data source to be able to use custom events data that already exist in your Snowflake instance.

The Snowflake integration for warehouse native experiments requires the following steps:

  1. In LaunchDarkly, configure the Snowflake Data Export integration.
  2. In Snowflake, [create the required resources](#step-2-in-snowflake-create-the-required resources).
  3. In LaunchDarkly, configure the Snowflake Native Experimentation integration
  4. In Snowflake, generate and run a script.
  5. In Snowflake, create a metric events source.

Each of these steps is explained in detail below.

Prerequisites

To configure the Snowflake integration, you must have the following prerequisites.

Snowflake data requirements

Before you begin, prepare your Snowflake data to meet the Snowflake data requirements for the integration.

Role permissions and Snowflake account URL

The role permissions and account URL requirements include:

IP addresses

You must add to your allow list the following outbound IP addresses:

  • 52.21.152.96/32
  • 52.200.35.24/32
  • 52.200.50.23/32
  • 54.144.218.89/32
  • 54.221.221.197/32
  • 34.236.6.43/32

For a full list of LaunchDarkly’s public IP addresses, read Public IP list.

LaunchDarkly Warehouse Native Experimentation app

Before you begin the configuration process, you must install the LaunchDarkly Warehouse Native Experimentation app in Snowflake. Confirm that ACCOUNTADMIN is set as your current role in Snowflake. If you need to switch roles, click Switch Role in the Snowflake user menu.

To install the app:

  1. Navigate to the Snowflake Marketplace.
  2. In the search field, search for “LaunchDarkly.”
  3. In the search results, click LaunchDarkly Warehouse Native Experimentation.
  4. Click Get.

To initialize the app:

  1. In Snowflake, click Data Products, then Apps to view the Warehouse Native Experimentation App in the “Installed Apps” section.
  2. Click Warehouse Native Experimentation App. A setup screen appears.
  3. Click Select Warehouse. A list of compute resources appears.
  4. Select the appropriate existing warehouse from your Snowflake account to install and run the app. The warehouse should suspend quickly after being used, for example, 60 seconds, to avoid over compute consumption.

Step 1: In LaunchDarkly, configure the Snowflake Data Export integration

You must be using the latest version of the Snowflake Data Export integration

If you were using an earlier version of Snowflake Data Export, you must update it to the version released in January 2025.

To begin, configure the latest Snowflake Data Export integration. The Snowflake Data Export integration provides LaunchDarkly experiment exposure data to Snowflake. This data is used with your metric events data stored in Snowflake to compute experiment results.

Follow the installation instructions at Snowflake Data Export to configure the Snowflake Data Export integration. You can also view a 6-minute instructional video about Snowflake Data Export Setup.

Step 2: In Snowflake, create the required resources

Next, create the initial warehouses and database in Snowflake:

  1. In Snowflake, navigate to the Warehouse Native Experimentation App “Setup” screen.
  2. Under step 2, click Create service warehouses and database in Snowflake.

This creates a new database called LD_EXPERIMENTATION and new warehouses called LD_EXPERIMENTATION_WH and LD_SERVICE_WH in your Snowflake account.

The LD_EXPERIMENTATION_WH warehouse is used for Experimentation calculations published in your Snowflake account under the LD_EXPERIMENTATION database. The LD_SERVICE_WH warehouse is used for LaunchDarkly service syncs that retrieve data to be published in the LaunchDarkly UI.

You can view a 12-minute instructional video about Snowflake Warehouse Native Experimentation App setup.

Step 3: In LaunchDarkly, configure the Snowflake Native Experimentation integration

Now, you will configure the Snowflake Native Experimentation integration in LaunchDarkly. This integration looks similar to the Snowflake Data Export integration you configured in step 1, but is a separate integration requiring a separate setup process.

Before you configure the Snowflake Native Experimentation integration, retrieve your Snowflake account/server URL from Snowflake. You can retrieve your Snowflake account/server URL by navigating to the user menu in Snowflake, hovering on Account, then clicking View account details:

The "Account Details" screen in Snowflake.

The "Account Details" screen in Snowflake.

To set up the Snowflake Native Experimentation integration:

  1. Navigate to the Integrations page and find “Snowflake Native Experimentation.”
  2. Click Add integration. The “Create a destination” panel appears.
  3. (Optional) Give the integration a human-readable Name.
  4. Enter the Snowflake account URL.
  5. Select the Project and environment you want to set up warehouse native Experimentation for. This generates a unique project/environment key.
  6. Copy the Project/Environment key that appears and save it for the “generate a Snowflake script” step, below.
  7. After reading the Integration Terms and Conditions, check the I have read and agree to the Integration Terms and Conditions checkbox.

The Snowflake Native Experimentation configuration panel in LaunchDarkly.

The Snowflake Native Experimentation configuration panel in LaunchDarkly.

  1. Click Save configuration. A public key appears.
  2. Copy the Public key that appears and save it for the “generate a Snowflake script” step, below.

Step 4: In Snowflake, generate and run a Snowflake script

Next, generate and run a Snowflake script to create resources for your LaunchDarkly project/environment.

To generate and run a Snowflake script:

  1. In Snowflake, navigate to the Warehouse Native Experimentation App “Initial Setup” screen.
  2. Under step 4, enter the project/environment key you saved from the configure the Snowflake Native Experimentation integration step in the Enter the project/environment key field.
  3. Enter the public key you saved from the configure the Snowflake Native Experimentation integration step in the Public key field.

Step 4 in the Warehouse Native Experimentation App setup process within Snowflake.

Step 4 in the Warehouse Native Experimentation App setup process within Snowflake.
  1. Click Generate script.
  2. Copy the generated script that appears.
  3. Navigate to Projects / Worksheets.
  4. Click the + “Create SQL worksheet” button to create a new worksheet.
  5. Paste the generated script to the worksheet.
  6. Click the arrow button to run the worksheet.

This creates all the necessary Snowflake resources and privileges for LaunchDarkly to connect to your Snowflake account.

If the script run fails or is interrupted, you can safely re-run the entire worksheet.

Step 5: In Snowflake, create a metric events source

Finally, you must grant read permissions to your metric events data to LaunchDarkly so it can perform experimentation calculations. For guidance on setting up your metric events source, read Snowflake data requirements.

To grant read permissions to your metric events data:

  1. In Snowflake, navigate to the Warehouse Native Experimentation App “Initial Setup” screen.
  2. Under step 5, select an object type of either View or Table.
  3. Click Select Permissions. A privileges dialog appears.
  4. Click the custom events table or view to select as a source. Use the menu to search for a specific database, schema, and table/view.
  5. Click Done. You are returned to the privileges dialog.
  6. Click Save. You are returned to the Warehouse Native Experimentation App setup screen. The source you selected appears in the Select a source field.
  7. Click Create metric events source. A success message appears.

Step 5 in the Warehouse Native Experimentation App setup process within.

Step 5 in the Warehouse Native Experimentation App setup process within.

If you need to drop an existing metric events source e from a LaunchDarkly project/environment, you can drop it in the “Optional Developer Tools” section.

Next steps

You can now create metrics using metric events from your Snowflake warehouse and create warehouse native experiments. To learn how, read Creating and managing metrics and Creating warehouse native experiments. You can also view a 5-minute instructional video about Snowflake Native Metrics Experiments setup.

To learn how to read the results for a warehouse native experiment, read Analyzing experiments. The results page for a warehouse native experiment displays the date and time the results were last updated from Snowflake. The initial load of experiment results can take up to 60 minutes to appear, and further results updates appear within 15–30 minutes.

Built with