launchdarkly-guarded-rollout
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLaunchDarkly 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 a progressive rollout with monitoring
start-guarded-rollout - -- inspect the flag and its variations
get-flag - -- find metrics to monitor during the rollout
list-metrics
Optional MCP tools:
- -- halt an active rollout immediately
stop-guarded-rollout - -- ensure the flag is turned on before starting
toggle-flag - -- create metrics if they don't exist
create-metric
使用此技能需要在你的环境中配置远程托管的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
关键组件
| Component | Description |
|---|---|
| Test variation | The new variation being rolled out |
| Control variation | The existing/baseline variation |
| Stages | Steps with increasing traffic percentage and monitoring windows |
| Metrics | What to monitor for regressions (error rate, latency, etc.) |
| Regression threshold | How much a metric can degrade before triggering action |
| On regression | Whether to notify, rollback, or both when a threshold is breached |
| 组件 | 描述 |
|---|---|
| 测试变体 | 正在发布的新变体 |
| 基准变体 | 现有/基准版本的变体 |
| 阶段 | 包含流量占比提升和监控窗口的步骤 |
| 指标 | 需监控回归的内容(错误率、延迟等) |
| 回归阈值 | 指标退化到何种程度时触发操作 |
| 回归处理 | 阈值被突破时是通知、回滚还是两者皆有 |
Rollout Weight Units
发布权重单位
Rollout weights use thousandths (basis points):
- = 1%
1000 - = 10%
10000 - = 50%
50000 - = 100%
100000
发布权重采用千分比(基点):
- = 1%
1000 - = 10%
10000 - = 50%
50000 - = 100%
100000
Monitoring Window
监控窗口
The monitoring window is specified in milliseconds:
- = 1 hour
3600000 - = 24 hours
86400000 - = 7 days
604800000
监控窗口以毫秒为单位指定:
- = 1小时
3600000 - = 24小时
86400000 - = 7天
604800000
Core Principles
核心原则
- Start Small: Begin with a low percentage (1-5%) to catch issues early
- Monitor What Matters: Choose metrics that reflect user experience
- Set Realistic Thresholds: Too tight = false alarms; too loose = missed regressions
- Allow Time: Each stage needs enough monitoring time for signal to emerge
- Have a Rollback Plan: Always configure at least notification on regression
- 从小规模开始:以低占比(1-5%)起步,尽早发现问题
- 监控关键指标:选择能反映用户体验的指标
- 设置合理阈值:阈值过严会导致误报;过松则会遗漏回归问题
- 预留足够时间:每个阶段需要足够的监控时间以获取有效信号
- 制定回滚计划:至少配置回归时的通知机制
Workflow
工作流程
Step 1: Prepare
步骤1:准备
Before starting a guarded rollout:
- Use to inspect the flag — note the variation IDs for test and control
get-flag - Use to find metrics suitable for monitoring
list-metrics - Ensure the flag is on in the target environment (use if needed)
toggle-flag - Confirm there's no active guarded rollout on this flag already
启动受控发布前:
- 使用检查功能标志——记录测试变体和基准变体的ID
get-flag - 使用查找适合监控的指标
list-metrics - 确保目标环境中的功能标志处于开启状态(必要时使用)
toggle-flag - 确认该功能标志当前没有正在进行的受控发布
Step 2: Design Stages
步骤2:设计阶段
Plan the rollout progression. A typical pattern:
| Stage | Traffic | Monitoring Window | Purpose |
|---|---|---|---|
| 1 | 1% | 1 hour | Smoke test — catch obvious crashes |
| 2 | 10% | 24 hours | Early signal on metrics |
| 3 | 50% | 24 hours | Confidence building |
| 4 | 100% | 24 hours | Full rollout with monitoring |
规划发布进度。典型模式如下:
| 阶段 | 流量占比 | 监控窗口 | 目的 |
|---|---|---|---|
| 1 | 1% | 1小时 | 冒烟测试——发现明显崩溃问题 |
| 2 | 10% | 24小时 | 提前获取指标信号 |
| 3 | 50% | 24小时 | 提升发布信心 |
| 4 | 100% | 24小时 | 全量发布并持续监控 |
Step 3: Configure Metrics
步骤3:配置指标
Select metrics that indicate problems:
| Metric Type | Example | Threshold | Action |
|---|---|---|---|
| Error rate | | 0.05 (5% increase) | Rollback |
| Latency | | 0.2 (20% increase) | Notify |
| Conversion | | 0.1 (10% decrease) | Notify + Rollback |
选择能指示问题的指标:
| 指标类型 | 示例 | 阈值 | 操作 |
|---|---|---|---|
| 错误率 | | 0.05(增加5%) | 回滚 |
| 延迟 | | 0.2(增加20%) | 通知 |
| 转化率 | | 0.1(下降10%) | 通知+回滚 |
Step 4: Start the Rollout
步骤4:启动发布
Use :
start-guarded-rolloutjson
{
"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-rolloutjson
{
"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:验证
- Use to confirm the guarded rollout is active
get-flag - Check that the flag shows the rollout configuration in the environment
- 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
- 使用确认受控发布已激活
get-flag - 检查功能标志在环境中显示的发布配置是否正确
- 监控是否有即时的回归通知
结果报告:
- 已启动包含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
边缘情况
| Situation | Action |
|---|---|
| Flag is off | Turn it on first with |
| Active rollout exists | Stop it first with |
| No suitable metrics | Create metrics first with |
| Approval required | If the environment requires approvals, the tool will return an approval URL |
| 场景 | 操作 |
|---|---|
| 功能标志处于关闭状态 | 先使用 |
| 已有正在进行的发布 | 先使用 |
| 无合适指标 | 先使用 |
| 需要审批 | 若环境要求审批,工具会返回一个审批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——小幅度波动是正常现象
- 不要忘记配置至少一个指标——无监控的发布只是普通发布