On this page

Permanent and Stale Gates

Learn how to manage feature gates lifecycle with Types to track flags ready for cleanup or permanent integration

Bring feature gates to a final state (flags permanently part of your codebase or completely removed) after they have served their purpose, as described in Feature Gate lifecycle. In Statsig, use feature gate Types to track flags that might be ready for cleanup.

Types

In your feature gates catalog, different Types appear in the Status column and under the filter option:

Feature gates catalog with status types filter

  • Permanent Gates (set by you)
    • Permanent feature gates are expected to live in your codebase for an extended period, beyond a feature release, usually for operations or infrastructure control. Common examples include user permissions (such as premium features based on subscription level), circuit breakers or disable switches (such as ending a connection to prevent negative customer impact), or support for legacy features in old app versions.
      • There are two ways to mark a gate as Permanent:
        • When creating the gate: the Permanent box in the gate creation flow

          Permanent checkbox in gate creation flow

        • After a gate has been created: click on the "..." menu and then "Mark Gate Permanent"

          Mark Gate Permanent menu option

    • Implications of marking a gate as Permanent
      • No change in the gate's behavior when called
      • Easy filtering on feature gates catalog
      • More caution in its management: while you can archive or delete a permanent feature gate, Statsig shows a warning before proceeding
      • Statsig foregoes reminding you to clean up these gates and may display them differently in the console
    • You can change the gate back to Temporary at any point.
      • All newly created feature gates default to Temporary, unless you mark them as Permanent. Statsig doesn't display the phrase Temporary in the feature gates Catalog or within the individual gates page.
  • Stale Gates (set by Statsig)
    • Stale feature gates indicate to your team that these gates could be good candidates for cleanup. Statsig automatically marks gates as stale based on the following criteria (excludes Permanent and archived gates):
      • Gates created less than 30 days ago, modified in the last 30 days, or referenced by other gates, experiments, or dynamic configs are never considered stale
      • Otherwise, any of the following conditions make a gate stale:
        • The gate has had 0 checks within last 30 days
        • The gate is still being checked but its earliest check was at least 30 days ago
    • Implications of gates being marked as Stale
      • No change in the gate's behavior when called
      • Easy filtering on Feature Gates catalog
      • Statsig includes the gate in nudges for cleanup (more below)
    • Stale Reasons are the reason why a gate has been set as stale. You can query this information on the Console API.
      • None No Stale Gates should have their reason set as None, this is exclusively for Temporary or Permanent gates.
      • STALE_PROBABLY_DEAD_CHECK There have been no checks in the last 30 days.
      • STALE_PROBABLY_LAUNCHED The Gate is marked as launched or has an everyone rule passing 100% (rollout rate of 100%).
      • STALE_PROBABLY_UNLAUNCHED The Gate is marked as disabled or has an everyone rule passing 0% (rollout rate of 0%).
      • STALE_PROBABLY_FORGOTTEN This gate appears to have been only partially launched for some time. Consider launching or disabling it, or marking it permanent if you need to keep it around.
      • STALE_NO_RULES The Gate has no set rules.
      • STALE_ALL_TRUE The Gate has been returning true every time it has been checked for the last 30 days (or number of days configured in project settings). It could probably be removed.
      • STALE_ALL_FALSE The Gate has been returning false every time it has been checked for the last 30 days (or number of days configured in project settings). It could probably be removed.
      • STALE_EMPTY_CHECKS The Gate has been returning empty (probably indicating an error) every time it has been checked for the last 30 days (or number of days configured in project settings). It could probably be removed or might need to be investigated.

Nudges to clean up stale gates

Using the Stale type, Statsig provides both in-console and external nudges to remind you to clean up (or make Permanent) your feature gates.

  • In-console: A reminder appears at the top of the individual feature gate page.

    Stale gate cleanup reminder notification

  • Email/Slack: Statsig sends a monthly email or Slack reminder (if you have enabled the Slack integration) to clean up or mark permanent any stale gates you own. Reminders continue until the gates are cleaned up or marked as permanent.

Was this helpful?