Metrics
Read time: 4 minutes
Last edited: Nov 07, 2024
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.
To view your list of metrics, navigate to the Metrics list:
Metric groups appear at the beginning of the Metrics list, and individual metrics appear lower in the list. You can search for a metric or group by name or description.
To learn how to create, edit, and delete metrics, read Creating and managing metrics. To learn more about metric groups, read Metric groups.
You can also use the REST API: Metrics
The metric details page
From the Metrics list, click on a metric to view its details.
The metric details page displays the metric's:
- Name
- Description
- Maintainer
- Event kind:
custom
,click
, orpage view
- Event key: the value you insert into your code to track events
- Tags
- Metric connections to any experiments or guarded rollouts, including information on the experiment name, status, environment, and metric status
LaunchDarkly automatically generates a metric key when you create a metric. You can use the metric key to identify the metric in API calls. To learn more, read Creating and managing metrics.
Sending custom events to LaunchDarkly also requires an 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.
Measurement definition
The "Measurement definition" section of the right sidenav displays the following information:
- Randomization unit
- Aggregation method: by average or by sum
- Analysis method: by average or by percentile
- For numeric metrics only: whether it's better for this metric to increase or decrease
- For numeric metrics only: unit of measure
- For numeric metrics only, Units without events:
Exclude units that did not send any events from the analysis
, orInclude units that did not send any events and set their value to 0
Metric connections
The "Metric connections" section of the right sidenav displays a summary of experiments, metric groups, and legacy experiments the metric is included in, either currently or previously.
To view a detailed list of metric connections, click the expand icon in the "Metric connections" section of the right sidenav:
The expanded metric connections view includes:
- Experiment: the name of the experiment.
- Experiment status: whether the experiment is not started, running or stopped.
- Environment: the environment the experiment is in.
- Metric status: when LaunchDarkly last received events from this metric.
- Effect size from control: the difference in performance for the variation being tested against the control variation.
You can also use the REST API: Get metric
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 at the beginning of the Metrics list.
To learn more, read Metric groups.