Launchdarkly Guarded Rollout

launchdarkly/ai-tooling/skills/feature-flags/launchdarkly-guarded-rollout

作者 launchdarkly2fc544d3140fApache-2.026 个星标收录于 2026年10月8日更新于 2026年10月8日仓库昨天更新

Configure guarded rollouts with progressive traffic increases, metric monitoring, and automatic rollback. Use when releasing features gradually with safety thresholds.

仅含说明DevOps & Cloud
AI 生成的概览

指导配置 LaunchDarkly 受控发布,包括分阶段放量、指标监控与回滚阈值。

功能
该技能引导智能体在 LaunchDarkly 中设置受控发布:检查功能开关、选择测试与对照变体,并设计带监控窗口的渐进式流量阶段。它协助选择监控指标与回归阈值,然后调用受控发布工具启动发布并进行验证。它还涵盖停止进行中的发布,以及处理开关未开启或缺少指标等边界情况。
适用场景
适用于逐步发布功能,并希望设置安全阈值以便在出现回归时暂停、通知或回滚的场景。适合已使用 LaunchDarkly 功能开关、需要规划分阶段放量与监控的团队。
运行要求
需要在环境中配置远程托管的 LaunchDarkly MCP 服务器,并提供 start-guarded-rollout、get-flag、list-metrics 等工具,以及可选的 stop-guarded-rollout、toggle-flag、create-metric。不包含脚本,仅为说明文档。

LaunchDarkly Guarded Rollouts

You're using a skill that will guide you through configuring guarded rollouts in LaunchDarkly. Your job is to design rollout stages, select monitoring metrics, configure regression thresholds, and start the rollout.

Prerequisites

This skill requires the remotely hosted LaunchDarkly MCP server to be configured in your environment.

Required MCP tools:

  • start-guarded-rollout -- start a progressive rollout with monitoring
  • get-flag -- inspect the flag and its variations
  • list-metrics -- find metrics to monitor during the rollout

Optional MCP tools:

  • stop-guarded-rollout -- halt an active rollout immediately
  • toggle-flag -- ensure the flag is turned on before starting
  • create-metric -- create metrics if they don't exist

Core Concepts

What Are Guarded Rollouts?

A guarded rollout progressively increases traffic to a new feature flag variation through a series of stages. At each stage, LaunchDarkly monitors selected metrics for regressions. If a regression is detected, the rollout can automatically pause and notify the team — or even roll back.

Key Components

ComponentDescription
Test variationThe new variation being rolled out
Control variationThe existing/baseline variation
StagesSteps with increasing traffic percentage and monitoring windows
MetricsWhat to monitor for regressions (error rate, latency, etc.)
Regression thresholdHow much a metric can degrade before triggering action
On regressionWhether to notify, rollback, or both when a threshold is breached

Rollout Weight Units

Rollout weights use thousandths (basis points):

  • 1000 = 1%
  • 10000 = 10%
  • 50000 = 50%
  • 100000 = 100%

Monitoring Window

The monitoring window is specified in milliseconds:

  • 3600000 = 1 hour
  • 86400000 = 24 hours
  • 604800000 = 7 days

Core Principles

  1. Start Small: Begin with a low percentage (1-5%) to catch issues early
  2. Monitor What Matters: Choose metrics that reflect user experience
  3. Set Realistic Thresholds: Too tight = false alarms; too loose = missed regressions
  4. Allow Time: Each stage needs enough monitoring time for signal to emerge
  5. Have a Rollback Plan: Always configure at least notification on regression

Workflow

Step 1: Prepare

Before starting a guarded rollout:

  1. Use get-flag to inspect the flag — note the variation IDs for test and control
  2. Use list-metrics to find metrics suitable for monitoring
  3. Ensure the flag is on in the target environment (use toggle-flag if needed)
  4. Confirm there's no active guarded rollout on this flag already

Step 2: Design Stages

Plan the rollout progression. A typical pattern:

StageTrafficMonitoring WindowPurpose
11%1 hourSmoke test — catch obvious crashes
210%24 hoursEarly signal on metrics
350%24 hoursConfidence building
4100%24 hoursFull rollout with monitoring

Step 3: Configure Metrics

Select metrics that indicate problems:

Metric TypeExampleThresholdAction
Error rateapi-error-rate0.05 (5% increase)Rollback
Latencyp99-response-time0.2 (20% increase)Notify
Conversioncheckout-completed0.1 (10% decrease)Notify + Rollback

Step 4: Start the Rollout

Use start-guarded-rollout:

json
{  "projectKey": "my-project",  "flagKey": "new-checkout-flow",  "environmentKey": "production",  "testVariationId": "variation-id-for-new-flow",  "controlVariationId": "variation-id-for-current-flow",  "randomizationUnit": "user",  "stages": [    {"rolloutWeight": 1000, "monitoringWindowMilliseconds": 3600000},    {"rolloutWeight": 10000, "monitoringWindowMilliseconds": 86400000},    {"rolloutWeight": 50000, "monitoringWindowMilliseconds": 86400000},    {"rolloutWeight": 100000, "monitoringWindowMilliseconds": 86400000}  ],  "metrics": [    {      "metricKey": "api-error-rate",      "onRegression": {"notify": true, "rollback": true},      "regressionThreshold": 0.05    },    {      "metricKey": "checkout-completed",      "onRegression": {"notify": true, "rollback": false},      "regressionThreshold": 0.1    }  ]}

Step 5: Verify

  1. Use get-flag to confirm the guarded rollout is active
  2. Check that the flag shows the rollout configuration in the environment
  3. Monitor for any immediate regression notifications

Report results:

  • Guarded rollout started with N stages
  • M metrics being monitored
  • First stage at X% traffic for Y hours

Stopping a Rollout

If issues arise or you need to halt the rollout:

json
{  "projectKey": "my-project",  "flagKey": "new-checkout-flow",  "environmentKey": "production"}

This immediately stops the progressive rollout and locks the flag at its current state.

Edge Cases

SituationAction
Flag is offTurn it on first with toggle-flag — rollouts require the flag to be on
Active rollout existsStop it first with stop-guarded-rollout before starting a new one
No suitable metricsCreate metrics first with create-metric
Approval requiredIf the environment requires approvals, the tool will return an approval URL

What NOT to Do

  • Don't start a guarded rollout on a flag that's turned off
  • Don't skip the monitoring window design — rushing through stages defeats the purpose
  • Don't set regression thresholds to 0 — small fluctuations are normal
  • Don't forget to configure at least one metric — a rollout without monitoring is just a regular rollout

来源与署名

来源:launchdarkly/ai-tooling位于skills/feature-flags/launchdarkly-guarded-rollout提交2fc544d

许可证: Apache-2.0

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架