用户影响加权SLO仪表盘——通过实际客户暴露量来衡量真实99.99%的正常运行时间,而非原始可用性
概览
通过实际客户暴露来衡量真实的99.99%正常运行时间——而不仅仅是原始可用性。 每个SRE都知道公式:(total_time − 停机时间) / total_time。但该度量对 的处理与 是相同的。 当你的值班平台显示99.99%的可用性时,是不是意味着你的客户体验到了99.99%的可用性?还是仅仅说明你的基础设施在99.99%的时间里处于正常状态? 原始的正常运行时间每分钟都很重要。影响的正常运行时间权重是谁受影响,以及是否是高峰流量。 从仓库内演示收集器(合成银行平台,没有实时客户数据)渲染。用 docker-compose up 或 slo-impact 启动,然后打开 http://localhost:8080. 对于每个事件,我们捕捉两个额外的维度: 凌晨3点8%流量的中断影响5%的用户,只能贡献高峰时同一故障的贡献。这个差距——基础设施报告与客户感受之间的差距——是SLO完整性的关键数字。 “如果你的SLO从未被入侵过,那就不是SLO。
概述(AI 翻译)
用户影响加权的SLO仪表盘。 通过实际客户暴露来衡量真实的99.99%正常运行时间——而不仅仅是原始可用性。
原始可用性的问题
每个SRE都知道公式:(total_time − downtime) / total_time。
但这个指标将影响3%用户的凌晨3点故障视为
中午停电影响所有高峰负载用户。
当值班平台显示99.99%时,是否意味着你的客户体验
99.99%的可用性?还是仅仅是你的基础设施99.99%的时间都在运行?
慢冲击回答了真正的问题。
建筑
原始的正常运行时间每分钟都很重要。影响的正常运行时间权重是谁受影响,以及是否是高峰流量。
演示仪表盘
从回购内演示收集器(合成银行平台,没有实时客户数据)中渲染出来。
以docker-compose up或slo-impact开启,打开http://localhost:8080.
它是如何运作的
对于每个事件,我们捕捉两个额外的维度:
| 维度 | 含义 |
|---|---|
user_fraction |
实际受影响的用户比例(0–1) |
traffic_weight |
事故期间的交通÷基线交通 |
每次事件用户影响停机时间:
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
slo-impact
User-impact-weighted SLO dashboard.
Measure true 99.99% uptime by actual customer exposure — not just raw availability.
The problem with raw availability
Every SRE knows the formula: (total_time − downtime) / total_time.
But that metric treats a 3 AM outage affecting 3% of users identically to a
noon outage affecting all users at peak load.
When your oncall platform showed 99.99%, did it mean your customers experienced
99.99% availability? Or just that your infrastructure was up 99.99% of the time?
slo-impact answers the real question.
Architecture
Raw uptime counts every minute. Impact uptime weights who was affected and whether it was peak traffic.
Demo dashboard
Rendered from the in-repo demo collector (synthetic banking platform, no live customer data).
Start it with docker-compose up or slo-impact and open http://localhost:8080.
How it works
For each incident we capture two extra dimensions:
| Dimension | Meaning |
|---|---|
user_fraction |
Fraction of the user base actually affected (0–1) |
traffic_weight |
Traffic during incident ÷ baseline traffic |
User-impact downtime per incident:
impact_seconds = duration × user_fraction × traffic_weight
User-impact uptime:
user_impact_uptime = 1 − (Σ impact_seconds) / window_seconds
A 3 AM outage at 8% traffic affecting 5% of users contributes only 0.4% of what the same outage would contribute at peak. That gap — between what your infrastructure reports and what customers feel — is the number that matters for SLO integrity.
“If your SLO has never been breached, it isn’t an SLO. It’s a slogan.”
Quick start
Option 1 — Docker (recommended, zero setup)
git clone https://github.com/Ajay150313/slo-impact.git
cd slo-impact
docker-compose up
Open http://localhost:8080 — the dashboard runs with built-in synthetic data that mirrors a realistic digital banking platform. No Prometheus required.
Option 2 — pip
pip install slo-impact # once published to PyPI
# or from source:
pip install -e .
slo-impact # starts on http://0.0.0.0:8080
Option 3 — from source (development)
git clone https://github.com/Ajay150313/slo-impact.git
cd slo-impact
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
uvicorn slo_impact.main:app --reload --port 8080
Prometheus integration
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add ajay150313/slo-impact