Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
今 SLI/SLO の監視をするなら Sloth が良さそうという話
Search
kanata
August 04, 2022
Technology
1.3k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
今 SLI/SLO の監視をするなら Sloth が良さそうという話
3-shake SRE Tech Talk #4 (
https://3-shake.connpass.com/event/253028/
) の登壇資料です。LT です。
kanata
August 04, 2022
More Decks by kanata
See All by kanata
ISUCON で使えるツールを作った
shotakitazawa
0
1.4k
CloudNative Days を支える CI/CD ワークフローの変遷
shotakitazawa
2
2.1k
OpenFlow について
shotakitazawa
0
100
Kubernetes で Pod ができるまで
shotakitazawa
3
1.2k
Spinnaker で Blue-Green Deployment やってみた
shotakitazawa
1
1.5k
Other Decks in Technology
See All in Technology
What the customer really needed
kawaguti
PRO
3
220
aws-iot-platform-architecture-use-cases.pdf
ma2shita
0
520
AIエージェントの一手は 誰も見ていない - Falco拡張OSS「Prempti」とeBPFで サーバーレス実行基盤を二層防御する
keitah
0
480
2026-09-18 gotanda.sre Terraformで複数環境作ったり、複数Stateに分割したりそれとTerragrunt / Terraform multi envs and multi states
masasuzu
4
700
データ_AIの事業の勝敗をわけるもの
nek0128
1
470
Azure Serverless 2026:Production-ready な AI エージェント基盤 / Azure Serverless 2026: Production-Ready AI Agent Platform
miyake
2
530
あけおめLINE 傾向とその対策
nasa9084
0
270
時うどん〜Socket.getifaddrsで学ぶネットワーク編 / Tokiudon: The Socket.getifaddrs Edition
coe401_
4
220
AIに任せた品質は、誰が見立てるのか - AI時代のテストマネジメント
nakanao
3
2.8k
絵ではじめるKubernetesセキュリティ
aoi1
4
700
Issue 駆動でスペシャリストの意図を届ける、AI 実装のアクセシビリティ向上
thkt
0
130
Antigravity SDK for the Java Developer
glaforge
0
180
Featured
See All Featured
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
430
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Prompt Engineering for Job Search
mfonobong
0
460
Facilitating Awesome Meetings
lara
57
7.1k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Paper Plane
katiecoart
PRO
4
53k
GraphQLとの向き合い方2022年版
quramy
50
15k
The Invisible Side of Design
smashingmag
301
52k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
200
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
540
Transcript
今 SLI/SLO の監視をするなら Sloth が良さそうという話 北澤 祥太 / kanata 1
北澤 祥太 / kanata / かなた @kanatakita ShotaKitazawa 趣味: ラーメン、スノボ、自宅鯖構築、イベント裏方
最近: Kubernetes custom controller の実装など $ whoami 2 よく使う アイコン
今日話すこと・話さないこと 話すこと • Sloth というツールで何が出来るのか • Sloth を使うと何が嬉しいのか 話さないこと •
Sloth を実際のプロダクト開発・運用に利用する話 ◦ SLO Review 等のプロセスについて ◦ 特定のプロダクトの特性起因の苦労話について ◦ etc. • 自作の自動化ツールについてのあれこれ 3
今日話すこと・話さないこと 話すこと • sloth というツールで何が出来るのか • sloth を使うと何が嬉しいのか 話さないこと •
sloth を実際のプロダクト開発・運用に利用する話 ◦ SLO Review 等のプロセスについて ◦ 特定のプロダクトの特性起因の苦労話について ◦ etc. • 自作の自動化ツールについてのあれこれ 4 🙇 🙇 🙇
Sloth - Easy and simple Prometheus SLO generator 一言で表すと •
yaml を書くだけで、いい感じの Alerting Rules を出力してくれたり Grafana Dashboard で SLI/SLO をモニタリングできるようになるツール 前提 • Prometheus / Grafana を利用していること • SLI の元となるメトリクスが取得できていること https://github.com/slok/sloth 5
Sloth の設定例 (1/2) 6 https://github.com/slok/sloth/blob/v0.10.0/examples/getting-started.yml version: "prometheus/v1" service: "myservice" labels:
owner: "myteam" repo: "myorg/myservice" tier: "2" slos: - name: "requests-availability" objective: 99.9 description: "Common SLO based on availability for HTTP request responses." sli: events: error_query: sum(rate(http_request_duration_seconds_count{job="myservice",code=~"(5..|429)"}[{{.window}}])) total_query: sum(rate(http_request_duration_seconds_count{job="myservice"}[{{.window}}])) (snip…) {{.window}} にはデフォルトで 5m, 30m, 1h, 2h, 6h, 1d, 3d, 30d が入る 生成される Rules に付与するラベルを指定 目標値を指定 total, error 条件となるクエリを定義
Sloth の設定例 (2/2) 7 https://github.com/slok/sloth/blob/v0.10.0/examples/getting-started.yml slos: - (snip…) alerting: name:
MyServiceHighErrorRate labels: category: "availability" annotations: summary: "High error rate on 'myservice' requests responses" page_alert: labels: severity: pageteam routing_key: myteam ticket_alert: labels: severity: "slack" slack_channel: "#alerts-myteam" 生成される Alerting Rules に付与するラベルを指定 Page レベルの Alerting Rules に付与するラベルを指定 Ticket レベルの Alerting Rules に付与するラベルを指定
Recording Rules の生成 8 sloth.yml rules.yml $ sloth generate -i
sloth.yml --- # Code generated by Sloth (v0.10.0): https://github.com/slok/sloth. # DO NOT EDIT. groups: - name: sloth-slo-sli-recordings-myservice-requests-availability rules: - record: slo:sli_error:ratio_rate5m expr: | (sum(rate(http_request_duration_seconds_count{ job="myservice",code=~"(5..|429)"}[5m]))) / (sum(rate(http_request_duration_seconds_count{ job="myservice"}[5m]))) labels: owner: myteam repo: myorg/myservice sloth_id: myservice-requests-availability sloth_service: myservice sloth_slo: requests-availability sloth_window: 5m tier: "2" - record: slo:sli_error:ratio_rate30m (snip…)
SLO のアラーティング • 以下の閾値の Multiwindow, Multi-Burn-Rate のアラートルールを自動生成 • What advantage
of Multiwindow, Multi-Burn-Rate Alerts? ◦ エラーバジェットの消費速度の傾き (Burn Rate) を用いるため精度が高い ◦ システムを復旧させたのにアラートが止まない問題 (Burn Rate ベースのアラートの特徴) を軽減 詳しくは https://sre.google/workbook/alerting-on-slos/ 9 Severity Long window Short window Burn rate Page 1 day 2 hours 1 3 days 6 hours 1 Ticket 1 hour 5 minutes 14.4 6 hours 30 minutes 6 time window が 1 日, 2 時間のどちらに おいても burn rate が 1 を超える場合に発火
Grafana Dashboard • Sloth が出力する Recording Rules のみを参照する Grafana Dashboard
が提供されている 10 https://sloth.dev/introduction/dashboards/ 現在の Burn rate 残りの Error Budget SLI の推移 Burn Rate の推移 Error Budget の burn down chat
Sloth による一元管理 before after 11 dashboard.json rules.yaml sloth.yml dashboard.json rules.yaml
👍 シングルバイナリで可搬性が高い 👍 validate サブコマンドがあるので CI に組み込みやすい
痒いところに手が届く機能 Recording Rules 用クエリの最適化 • time window の大きい Recording Rule
は、元となるメトリクスの rate 30d を取らず time window の小さい Recording Rule の rate 30d を取る ▪ 多量のデータポイントの読み込まずに算出可能 様々な入力/出力フォーマットに対応 • v0.10.0 現在、以下に対応 ◦ 入力: default, K8s CustomResource, OpenSLO ◦ 出力: Prometheus Recording Rules, K8s CustomResource (for Prometheus Operator) SLI 算出のためのプラグイン機構 • https://github.com/slok/sloth-common-sli-plugins 12
Have a good SRE-Life with Sloth! 13