Data Export schema reference
Read time: 13 minutes
Last edited: Nov 21, 2024
Overview
This topic explains the schema of Data Export events.
Data Export exposes the following kinds of events:
feature
eventsindex
eventsidentify
eventsclick
eventspage view
eventscustom
eventssummary
events. To exportsummary
events, start a Support ticket.debug
events
LaunchDarkly no longer supports alias
events for SDKs that support contexts. LaunchDarkly continues to support sending and receiving alias
events for older SDK versions and for SDKs that do not yet support contexts. For a list of SDKs that still support alias
events, read Aliasing users.
Some Data Export destinations have different event formatting schema. If you use mParticle or Segment as your event destination, we have specific documentation for their event schema:
These events are described in more detail below.
Event kinds
This table lists event kinds:
Description | Event kind |
---|---|
feature | This event kind includes full-fidelity details of each individual feature flag evaluation. These events are present both for flags evaluated directly by a LaunchDarkly SDK, and for flags evaluated indirectly (for example, flags that are prerequisites of flags being evaluated directly). These events are only present if you explicitly enable detailed tracking for a feature flag, or if you are using an older SDK. |
index | This event kind contains the context attributes for a particular context, defined by a context key, when a feature flag evaluates the context. This event kind is not available for Segment or mParticle destinations. To export |
identify | This event kind passes details about a context provided in an explicit |
click | This event kind is generated by the LaunchDarkly SDK when an end user clicks on an HTML element matching a CSS selector configured on an experiment metric. |
page view | This event kind is generated by the LaunchDarkly SDK when an end user loads a page with URL matching a regular expression configured on an experiment metric. |
custom | This event kind passes data provided in an explicit |
summary | This event kind describes a roll-up of individual feature evaluations over an interval. These events are present both for flags evaluated directly by a LaunchDarkly SDK, and for flags evaluated indirectly (for example, flags that are prerequisites of flags being evaluated directly). To export |
debug | This event kind is similar to the |
The index
and identify
event kinds are not available for Segment and mParticle destinations.
SDK versioning for events
Newer SDKs generate the summary
and index
events described below. Older SDKs always send feature
events regardless of whether detailed tracking is enabled for that flag.
Newer SDKs send contextKeys
and context
as objects inside feature
events. Older SDKs send user
or userKeys
objects instead.
Expand for additional information on event versions
SDKs generate events using a schema versioned in the following way:
- Events sent from SDKs upgraded for contexts are version
4
. - Events sent from SDKs that only support users are version
3
. - Events sent from supported versions of the PHP SDK, through version 6.0, are version
2
. Events sent from the PHP SDK version 6.1 and later are version4
.
Each of these SDK event schemas are part of version 2 of the Data Export event schema. The definitions and examples on this page show the Data Export event schema version. If you are inspecting the events sent directly by your SDK, for example as part of debugging a Data Export integration, you may notice the SDK event versions.
To receive feature
events, in addition to index
, identify
, and custom
events, check the Send detailed events to data export destinations checkbox on a flag's Settings tab or an environment's Edit panel. By default, LaunchDarkly does not export summary
events. To export summary
events, start a Support ticket.
Event kind structures
LaunchDarkly sends each of these events as JSON files to your destinations.
All events have the following top level structure:
project
: The ID of the LaunchDarkly project associated with the event.environment
: The ID of the LaunchDarkly environment associated with the event.version
: The Data Export event version.event
: The event itself. It is an object with a structure described below, depending on thekind
of event.
Feature events
Feature
events represent individual flag evaluations and are considered "full fidelity" events. Feature events are only sent by the SDK in one of these scenarios:
- the
trackEvents
ortrackEventsFallthrough
attribute on the flag configuration is sent - the
trackEvents
attribute on a targeting rule is sent - the targeting rule or default rule when on has a rollout of kind
"experiment"
and the variation associated with the event is included in the tracked variations for that rollout
Here is an example feature
event:
Here is a list of feature
event properties:
kind
: The kind for afeature
event isfeature
. An SDK only generates afeature
event if the you set thetrackEvents
attribute of the flag totrue
. You can also control this with settings in the UI.creationDate
: When the SDK requested the feature flag, as UNIX epoch time in milliseconds.key
: The key of the feature flag requested.variation
: The variation of the flag requested. The SDK stores flag variation values in an array. This value corresponds to the index of the variation the array. Boolean flags show as0
or1
fortrue
andfalse
. For other flags, the array index starts at0
for the different variations.variationName
: The evaluated variation's name, if it exists. If the evaluated variation doesn't have a name, this field doesn't appear.value
: The value of the feature flag returned by feature flag evaluation.default
: The default value that the application passed in.version
: The version of the evaluated feature flag.reason
: (Optional) Included only if the flag being evaluated was in an experiment and the target was part of the experiment allocation, or if you called a variation detail method.- Evaluations that were part of an experiment have the optional
inExperiment
attribute on the evaluation reason set totrue
. Evaluations that were not part of an experiment omit this attribute. - If you called a variation detail method, the
reason
property will be a JSON representation of the evaluation reason.
- Evaluations that were part of an experiment have the optional
prereqOf
: A feature flag key, if this flag evaluation was only performed in order to determine whether the prerequisite values were met for the indicated flag.contextKeys
: The keys of thecontext
object used in a feature flag evaluation. SDKs periodically transmit details for thecontext
object used in a feature flag evaluation as reported by thefeature
event with a separateindex
event.context
: Thecontext
object used in a feature flag evaluation.userKey
: The key of theuser
object used in a feature flag evaluation. SDKs periodically transmit details for the user object used in a feature flag evaluation as reported by thefeature
event with a separateindex
event. Not included if your SDK configuration is set to inline users. Not included if your SDK supports contexts.user
: Theuser
object used in a feature flag evaluation. Only included if your SDK configuration is set to inline users. Not included if your SDK supports contexts.
Index events
index
event exportsBy default, LaunchDarkly does not export index
events. To export index
events, start a Support ticket. To learn more, read How to enable index events for Data Export.
Server-side SDKs send index
events periodically to describe the attributes of contexts referenced by the contextKey
in feature
events.
An example index
event is shown below:
Here is a list of index
event properties:
kind
: The kind of anindex
event isindex
.creationDate
: The time this context was recorded at UNIX epoch time in milliseconds.context
: The same schema ascontext
objects for feature flag evaluation.userKey
: The same schema asuserKey
for feature flag evaluation. Not included if your SDK configuration is set to inline users. Not included if your SDK supports contexts.user
: The same schema asuser
objects for feature flag evaluation. Only included if your SDK configuration is set to inline users. Not included if your SDK supports contexts.
index
eventsServer-side SDKs have internal logic that determines whether it is necessary to send an index
event. SDKs do not create index
events for every flag evaluation. If the SDKs identify the same context multiple times in succession, the SDK does not send multiple index
events. The SDK identifies contexts based on the contexts' keys.
Client-side SDKs do not send index
events. Instead, client-side SDKs send identify
events when the SDK initializes, which include all of the context properties.
Identify events
identify
events are produced when the client application calls the identify
SDK method. identify
events have a similar structure to index
events.
An example identify
event is shown below:
Here is a list of identify
event properties:
kind
: The kind of anidentify
event isidentify
.creationDate
: The time this context was recorded at UNIX epoch time in milliseconds.context
: The same schema ascontext
objects for feature flag evaluation.userKey
: The same schema asuserKey
for feature flag evaluation. Not included if your SDK configuration is set to inline users. Not included if your SDK supports contexts.user
: The same schema asuser
objects for feature flag evaluation. Only included if your SDK configuration is set to inline users. Not included if your SDK supports contexts.
Click events
JavaScript-based SDKs produce click
events when an end user clicks on an HTML element matching a CSS selector configured on an experiment metric. To learn more, read Clicked or tapped conversion metrics.
An example click
event is shown below:
Page view events
JavaScript-based SDKs produce pageview
events when an end user loads a page with URL matching a regular expression configured on an experiment metric. To learn more, read Page viewed conversion metrics.
An example pageview
event is shown below:
Custom events
SDKs produce custom
events when the client application calls the SDK's track
method.
Try it in your SDK: Sending custom events
The data
event kind is not available for mParticle or Segment events.
An example custom
event is shown below. The metricValue
field will not appear if the event did not provide a metric value.
Summary events
summary
event exportsBy default, LaunchDarkly does not export summary
events. To export summary
events, start a Support ticket.
SDKs send summary
events periodically to describe a set of feature evaluations. Summary events include all feature evaluations, regardless of whether the trackEvents
field was set for individual flags.
An example summary
event is shown below:
The summary
event represents a set of feature flag evaluations occurring during an interval defined by startDate
and endDate
, sorted by feature flag.
Each feature flag includes the following details:
Field | Meaning |
---|---|
startDate | The timestamp of the first feature flag evaluation included in this packet. This value is a UNIX epoch time in milliseconds. |
endDate | The timestamp of the last feature flag evaluation included in this packet. This value is a UNIX epoch time in milliseconds. |
default | The default value the SDK received for the feature, sampled at some point during the interval. |
counters | A set of counters as described below. |
contextKind (version 4 only) | The context kinds used to evaluate the flag. |
The counters
field is an array of objects with the following contents:
Field | Meaning |
---|---|
version | The version of the feature flag evaluated. |
value | The value the SDK returned for the flag evaluation. |
variation | A zero-based index into the list of variations. If LaunchDarkly does not provide this field, it means the SDK returned a fallback value. |
count | The number of times this value/version/variation combination was an evaluation result during the interval. |
unknown (optional) | If this is present and true, it indicates that no flag by this name was known to LaunchDarkly, and therefore the SDK returned the fallback value. |
Debug events
The debug
event is a variant of the feature
event, with two differences. It has kind
set to debug
and it inlines the context
value. The information can help you to troubleshoot feature flag evaluations more quickly.
SDKs send debug
events only if the debugEventsUntilDate
attribute is set for a feature flag and the attribute indicates a UNIX epoch timestamp in milliseconds that has not yet elapsed.
To set the debugEventsUntilDate
attribute for a feature flag, navigate to the Live events page. Find a summary event for the flag you are interested in and click Full fidelity details.
debug
events are not controlled by the trackEvents
field.
Here is an example debug
event:
Here is a list of the debug
event properties:
kind
: The kind of adebug
event isdebug
.context
: The same schema ascontext
objects for feature flag evaluation.creationDate
: When the SDK requested the feature flag, as UNIX epoch time in milliseconds.key
: The key of the feature flag requested.value
: The value of the feature flag returned by feature flag evaluation.default
: Optional. This will betrue
if the feature flag evaluation failed and the SDK served the fallback value instead. This field will befalse
or omitted if the SDK did not serve the fallback value.
Try it in your SDK: Evaluating flags