Overview

This topic explains the data requirements for Snowflake native Experimentation.

To use Snowflake native Experimentation, two types of data sources are required: assignment data and metric events data. These two datasets are required for computing metrics and analyzing experiment results. LaunchDarkly handles generating and exporting experiment assignment data, and you are responsible for ensuring that metric event data is prepared, stored, formatted, and refreshed appropriately in your Snowflake warehouse.

Assignment data

Assignment data is a timestamped dataset that tracks which context, such as a user or account, was exposed to which experiment variation and when. Each row represents a unique assignment event, tracking the experiment exposure for each context. This data is automatically generated by LaunchDarkly when you run an experiment and is exported to Snowflake using the Snowflake Data Export integration. To prepare and use the assignment data dataset, configure the Snowflake Data Export integration.

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.

Metric events data

Metric events data is a timestamped dataset that tracks individual context observations that LaunchDarkly uses to calculate experiment metrics.

For example:

  • “Alice submitted a form at 2025-01-10 09:00:00"
  • "George purchased a $10 order at 2025-01-11 13:10:13”

You need to prepare this dataset in Snowflake according to the metric events schema, below. You will grant LaunchDarkly access to that dataset as part of the integration setup process.

Metric events schema

To use your existing metric events data in your Snowflake account, you must prepare a metric events data either as a table or view.

This table or view should have SELECT privilege on ACCOUNTADMIN role. The schema is as follows:

Column nameTypeExampleDescription
EVENT_IDVARCHAR, NOT NULLmetric-event-id-123abcA unique ID for the event.
EVENT_KEYVARCHAR, NOT NULLOrder placedThe event key.
CONTEXT_KINDVARCHAR, NOT NULLuser, memberThe kind of the context for the metric event.
CONTEXT_KEYVARCHAR, NOT NULLuser-key-123abcThe key of the context for the metric event.
EVENT_VALUEFLOAT3.1The event value.
RECEIVED_TIMETIMESTAMP_TZ, NOT NULL2024-10-22T17:00:00ZThe time (UTC) the metric event was received.

Create the metric events schema table

Here is an example query to create the table. The table name can be anything and the location can be anywhere you would like:

Create the metric events data table
1create or replace TABLE <DATABASE_NAME>.<SCHEMA_NAME>.<TABLE_NAME> (
2 EVENT_ID VARCHAR NOT NULL,
3 EVENT_KEY VARCHAR NOT NULL,
4 CONTEXT_KIND VARCHAR NOT NULL,
5 CONTEXT_KEY VARCHAR NOT NULL,
6 EVENT_VALUE FLOAT,
7 RECEIVED_TIME TIMESTAMP_TZ NOT NULL
8);

Grant the SELECT privilege on this table to the ACCOUNTADMIN role using the following:

Grant SELECT privilege
1GRANT SELECT ON TABLE <DATABASE_NAME>.<SCHEMA_NAME>.<TABLE_NAME> TO ACCOUNTADMIN;
Built with