Metrics
Overview
This topic explains how to create and use metrics within LaunchDarkly.
Metrics measure audience behaviors affected by flags. You can use metrics to track all kinds of things, from how often customers access a URL to how long that URL takes to load a page. Create metrics that align with your business goals and connect them to your team’s flags to track the impact of different flag variations over time.
The metrics list
To view your list of metrics, navigate to the Metrics list:
You can search for a metric by name or description. To learn how to create, edit, and delete metrics, read Creating and managing metrics.
Metric filters and sorting
Click on Filters at the top of the metrics list to filter the listed metrics by the following options:
- Tags
- Maintainer
- Metric type
- Whether or not the metric is connected to an experiment or guarded rollout
You can sort the metrics list by age of the metric, name, and connections to experiments and guarded rollouts.
You can also use the REST API: Metrics
Filtering metrics is different from filtering the metrics list
It’s important to distinguish between filtering the metrics list and configuring metric filtering on an individual metric:
- Filtering the Metrics list: Use the filters at the top of the Metrics list to change which metrics are visible in the dashboard. This is a UI-level filter and does not affect how metrics collect or analyze data.
- Metric filtering: Apply filters to an individual metric to control which events are included in its impact analysis. For example, you can restrict a metric to users in a specific country, or only count events triggered by a particular variation.
To learn how to configure metric filtering, read Filtering custom metric events.
The metric page
From the Metrics list, click a metric to open its details. The metric page includes three tabs:
- Details: Shows the metric’s event kind, event key, configuration, and connections. To learn more, read Details tab.
- Impact tab: Lists the experiments that use the metric. To learn more, read Metric impact.
- Activity: Shows recent metric event activity. To learn more, read Metric activity.
Details tab
The Details tab shows the details of the metric in two sections, “Configuration” and “Connections.” It also includes a button to permanently delete the metric across all environments in the project.
The “Configuration” section displays different fields depending on the metric type:
- Count:
- Event key: the value you insert into your code to track events
- Metric type:
Numeric
- Definition
- Clicked or tapped:
- Target URLs
- Click targets
- Metric type:
Clicked or tapped
- Definition
- Numeric:
- Event key: the value you insert into your code to track events
- Metric type:
Numeric
- Definition
- Unit of measure
The “Connections” section displays a summary of experiments, metric groups, and legacy experiments the metric is included in, either currently or previously.
The metric connections section includes four tabs:
You can also use the REST API: Get metric
Experiments tab
The Experiments tab includes the following information:
- Experiment name: The experiment that uses this metric.
- Experiment status: Whether the experiment is
not started
,running
, orstopped
. - Environment: The environment the experiment is in.
- Metric status: The most recent date LaunchDarkly received events for this metric. This helps you determine whether the metric is still receiving data or has become inactive. The Activity tab on the metric details page shows the most recent event and the last 100 events received within two hours of that event. To learn more, read Metric activity.
- Effect size from control: the difference in performance for the variation being tested against the control variation.
Guarded rollouts tab
The Guarded rollouts tab includes the following information:
- Flag name: The flag that includes this metric in a guarded rollout.
- Rollout count: The number of guarded rollouts on the flag this metric was used in.
- Rollout status: Whether the rollout is
monitoring
,completed
,manually completed
,reverted
,manually reverted
, orarchived
. - Environment: The name of the environment the guarded rollout is in.
Metric groups tab
The Metric groups tab includes the following information:
- Metric group: The metric groups that include this metric.
- Metric group type: Whether the metric group is a
guardrail
metric group, astandard
metric group, or afunnel
.
Multi-armed bandits tab
The Multi-armed bandits tab includes the following information:
- Multi-armed bandit: The multi-armed bandit that uses this metric.
- Multi-armed bandit status: Whether the multi-armed bandit is
not started
,running
, orstopped
. - Environment: The environment the multi-armed bandit is in.
- Metric status: The most recent date LaunchDarkly received events for this metric. This helps you determine whether the metric is still receiving data or has become inactive.
Sidebar information
The right sidebar displays additional information about the metric:
- Description
- Maintainer
- Tags
- Sources
- Metric key
Event keys and metric keys are different
Sending custom events to LaunchDarkly requires a unique event key. You can set the event key to anything you want. Adding this event key to your codebase lets your SDK track actions customers take in your app as events. To learn more, read Sending custom events.
LaunchDarkly also automatically generates a metric key when you create a metric. You only use the metric key to identify the metric in API calls. To learn more, read Creating and managing metrics.
Metric versions
When you create a new metric, the metric has a version of 1. Each time you edit and save the metric, LaunchDarkly increments the metric version. This ensures that experiments, measured releases, and other features continue to display the correct analysis for the metric as it was configured at the time of its use. If you make edits to a metric currently in use, any LaunchDarkly feature using it will continue to use the old version of the metric.
For example, if you create an experiment using version 1 of a metric, then edit the metric while the experiment is running, the experiment will continue to use version 1 of the metric until you stop the experiment iteration. This ensures the experiment analysis is valid. Any new iterations of the experiment you begin later will then use version 2 of the metric.
Metric groups
A metric group is a reusable, ordered list of metrics you can use to standardize metrics across multiple experiments and flags. Metric groups appear on the Metric groups tab.
To learn more, read Metric groups.