Flag health
Read time: 3 minutes
Last edited: Oct 01, 2024
Overview
This topic explains how to use the flag health page in engineering insights.
LaunchDarkly uses stale flags as an indicator of flag health. Stale flags are temporary flags older than 90 days that have a status of either "inactive" or "launched" within a given environment.
Flag health summary
The flag health summary includes:
- Percentage of stale flags
- Total number of stale flags
- Total number of temporary flags
Use the selection menus to narrow your view to a specific LaunchDarkly project or environment, or one or more applications.
Flag statuses
The flag status chart provides an aggregate view of your flags in your selected environment and project.
Flags may be in one of the following statuses:
- New: You created the flag fewer than seven days ago and it has never been evaluated.
- Active: The flag is being evaluated, and either
- different contexts have received different variations of the flag over the last seven days, or
- you have made changes to the flag's configuration in the past seven days, or
- the flag is toggled off.
- Launched: The flag is being evaluated, and
- all context instances have received one variation of the flag over the past seven days, and
- you have made no changes to the flag's configuration in the past seven days, and
- the flag is toggled on.
- Inactive: The flag has not been evaluated for at least seven days.
In engineering insights, the "launched" flag status is solely based on evaluations, so the counts displayed here may differ slightly from the Flags list.
Using the stale Flags list
The stale Flags list shows information about flags in a selected environment that we recommend you remove.
You can refine this list into a different subset of flags using the search and filter options:
- Search by flag key.
- Filter by archive check status, flag maintainer, or tags.
- Sort by flag age.
- Use the Compare environments menu to compare the flag state across additional environments. This helps you verify that you can archive the flag without unintended consequences.
If you choose additional environments, LaunchDarkly performs the checks again and highlights stale flags.
Description of checks
LaunchDarkly runs four checks to determine if a flag is stale. They are:
- Verify absence of code references:
- If you have either never used the flag, or have not set up code references for the repository, this check passes with the explanation "Code references never detected."
- If you use code references and have removed this flag from your code completely, this check passes with the explanation "Removed code references on [date]," and links to the extinction message. To learn more, read About extinction events.
- If you do not use code references, this check does not run.
- Verify the flag has not been requested: If the flag has not been requested in the last seven days, this check passes.
- Verify only one variation is being served: If all environments are serving the same variation as the selected environment at the top of the page, this check passes.
- Verify the flag is not a prerequisite: If the flag is not a prerequisite of any other flags, this check passes.
To view additional information about these checks, click Show archive checks. Here's an example:
When the archive checks are showing, you can view additional information about flag evaluation by hovering over the "Status" field. A flag evaluations chart appears. Here's an example:
If all checks pass, you can click Archive to begin the archive process.