launchdarkly-guarded-rollout

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

LaunchDarkly Guarded Rollouts

LaunchDarkly 受控发布

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.
你正在使用一项可引导你在LaunchDarkly中配置受控发布的技能。你的任务是设计发布阶段、选择监控指标、配置回归阈值并启动发布。

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
使用此技能需要在你的环境中配置远程托管的LaunchDarkly MCP服务器。
必需的MCP工具:
  • start-guarded-rollout
    —— 启动带监控的渐进式发布
  • get-flag
    —— 检查功能标志及其变体
  • list-metrics
    —— 查找发布期间需监控的指标
可选的MCP工具:
  • stop-guarded-rollout
    —— 立即停止正在进行的发布
  • toggle-flag
    —— 确保启动前功能标志处于开启状态
  • create-metric
    —— 若指标不存在则创建指标

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.
受控发布通过一系列阶段逐步增加新功能标志变体的流量占比。在每个阶段,LaunchDarkly会监控选定的指标以检测回归问题。如果检测到回归,发布可以自动暂停并通知团队——甚至自动回滚。

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%
发布权重采用千分比(基点):
  • 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
监控窗口以毫秒为单位指定:
  • 3600000
    = 1小时
  • 86400000
    = 24小时
  • 604800000
    = 7天

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
  1. 从小规模开始:以低占比(1-5%)起步,尽早发现问题
  2. 监控关键指标:选择能反映用户体验的指标
  3. 设置合理阈值:阈值过严会导致误报;过松则会遗漏回归问题
  4. 预留足够时间:每个阶段需要足够的监控时间以获取有效信号
  5. 制定回滚计划:至少配置回归时的通知机制

Workflow

工作流程

Step 1: Prepare

步骤1:准备

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
启动受控发布前:
  1. 使用
    get-flag
    检查功能标志——记录测试变体和基准变体的ID
  2. 使用
    list-metrics
    查找适合监控的指标
  3. 确保目标环境中的功能标志处于开启状态(必要时使用
    toggle-flag
  4. 确认该功能标志当前没有正在进行的受控发布

Step 2: Design Stages

步骤2:设计阶段

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
规划发布进度。典型模式如下:
阶段流量占比监控窗口目的
11%1小时冒烟测试——发现明显崩溃问题
210%24小时提前获取指标信号
350%24小时提升发布信心
4100%24小时全量发布并持续监控

Step 3: Configure Metrics

步骤3:配置指标

Select metrics that indicate problems:
Metric TypeExampleThresholdAction
Error rate
api-error-rate
0.05 (5% increase)Rollback
Latency
p99-response-time
0.2 (20% increase)Notify
Conversion
checkout-completed
0.1 (10% decrease)Notify + Rollback
选择能指示问题的指标:
指标类型示例阈值操作
错误率
api-error-rate
0.05(增加5%)回滚
延迟
p99-response-time
0.2(增加20%)通知
转化率
checkout-completed
0.1(下降10%)通知+回滚

Step 4: Start the Rollout

步骤4:启动发布

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
    }
  ]
}
使用
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

步骤5:验证

  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
  1. 使用
    get-flag
    确认受控发布已激活
  2. 检查功能标志在环境中显示的发布配置是否正确
  3. 监控是否有即时的回归通知
结果报告:
  • 已启动包含N个阶段的受控发布
  • 正在监控M个指标
  • 第一阶段流量占比X%,持续Y小时

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.
若出现问题或需要终止发布:
json
{
  "projectKey": "my-project",
  "flagKey": "new-checkout-flow",
  "environmentKey": "production"
}
此操作会立即停止渐进式发布,并将功能标志锁定在当前状态。

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
场景操作
功能标志处于关闭状态先使用
toggle-flag
开启——发布要求功能标志必须处于开启状态
已有正在进行的发布先使用
stop-guarded-rollout
停止当前发布,再启动新的发布
无合适指标先使用
create-metric
创建指标
需要审批若环境要求审批,工具会返回一个审批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
  • 不要在关闭状态的功能标志上启动受控发布
  • 不要跳过监控窗口设计——仓促推进阶段会失去受控发布的意义
  • 不要将回归阈值设置为0——小幅度波动是正常现象
  • 不要忘记配置至少一个指标——无监控的发布只是普通发布