Metrics

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:

The Metrics list.

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:

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 details page

From the Metrics list, click on a metric to view its details. You can view the experiments the metric is used in on the Impact tab, and the metric’s event activity on the Activity tab.

The right sidebar displays the following information:

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.

The right sidebar of a metric.

The right sidebar of a metric.

Metric connections

The “Metric connections” section of the right sidebar displays a summary of experiments, multi-armed bandits, metric groups, guarded rollouts, 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:

The metric connections section of a flag's sidebar with the expand icon called out.

The metric connections section of a flag's sidebar with the expand icon called out.

The expanded metric connections view includes tabs for experiments, guarded rollouts, metric groups, and multi-armed bandits.

The Experiments tab

The Experiments tab includes the following information:

  • 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: 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.

The Guarded rollouts tab

The Guarded rollouts tab includes the following information:

  • Flag name: The name of the flag for the 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, or archived.
  • Environment: The name of the environment the flag change is being rolled out in.

The Metric groups tab

The Metric groups tab includes the following information:

  • Metric group: The name of the group.
  • Metric groups type: Whether the metric group is a guardrail metric group, a standard metric group, or a funnel metric group.

The Multi-armed bandits tab

The Multi-armed bandits tab includes the following information:

  • Multi-armed bandit: The name of the Multi-armed bandit.
  • Multi-armed bandit status: Whether the multi-armed bandit is not started, running, or stopped.
  • 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.

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 on the Metric groups tab.

To learn more, read Metric groups.