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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
110
Kubernetes で Pod ができるまで
shotakitazawa
3
1.2k
Spinnaker で Blue-Green Deployment やってみた
shotakitazawa
1
1.5k
Other Decks in Technology
See All in Technology
QA4AI 2026-Oct 生成AI時代の品質保証
tokuty
1
850
エンタメ企業のM&Aを支えるデータ基盤 ― 統合から店舗のリアルタイム分析まで / Data Engineering Summit 2026
genda
0
160
味覇で作るパスタが美味い - 20261001_yabaubuki.dev
livesense
PRO
0
130
Active Record Connection Adaptersにおける長年の課題に再び取り組む
yahonda
0
130
[JAWS-UG彩の国埼玉#12]そろそろ準備する?re:Invent2026をやさしく解説 / reinvent2026-sainokuni
sh_fk2
1
320
AI駆動で「他アプリの音を加工できる」アプリを作った
satomasahiro2005
0
130
UniFi(ユニファイ)AIカメラの現場活用
ludicmind
1
430
SAENM ~Jupyterで残すPoCの試行錯誤、未来の自分と仲間を助ける記録!~
terapyon
0
110
無理せず続ける、子育てエンジニアの学び
codmoninc
PRO
0
800
Rust で関数型ドメインモデリング
takonda
0
130
分析AIエージェントを育てる、動く環境を育てる
codatum
1
1.1k
Local CI × GitHub Actions
gogutan
2
150
Featured
See All Featured
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
330
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
330
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2k
How to build a perfect <img>
jonoalderson
1
6.1k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
870
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
59k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
520
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
630
Building Applications with DynamoDB
mza
96
7.2k
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