Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Stackdriver MonitoringのAlert設定はコード管理が可能か/Stackd...
Search
Ka
January 17, 2019
Technology
5
890
Stackdriver MonitoringのAlert設定はコード管理が可能か/Stackdriver Alert coding
GCPUG Tokyo Stackdriver
LT枠
15/1/2019
Ka
January 17, 2019
Tweet
Share
Other Decks in Technology
See All in Technology
忙しい人のためのLangGraph概要まとめ
__ymgc__
1
190
アプリをリリースできる状態に保ったまま 段階的にリファクタリングするための 戦略と戦術 / Strategies and tactics for incremental refactoring
yanzm
6
1.4k
フルカイテン株式会社 採用資料
fullkaiten
0
32k
Google CloudのLLM活用の選択肢を広げるVertex AIのパートナーモデル
nayuts
0
130
「自動テストのプラクティスを効果的に学ぶためのカードゲーム」 ( #sqip2024 )
teyamagu
PRO
2
180
株式会社EventHub・エンジニア採用資料
eventhub
0
3k
ロリポップ! for Gamersを支えるインフラ/lolipop for gamers infrastructure
takumakume
0
130
やってやろうじゃないかメカアジャイル! / Let's do it, mechanical agile!
psj59129
1
670
Swift Testingのconfirmationを コードリーディング/Dive into Swift Testing confirmation
laprasdrum
2
260
Classmethod AI Talks(CATs) #1 司会進行スライド(2024.09.19) / classmethod-ai-talks-aka-cats_moderator-slides_vol1_2024-09-19
shinyaa31
0
110
スタッフエンジニアの道: The Staff Engineer’s Path
snoozer05
PRO
44
14k
LINEヤフーのフロントエンド組織・体制の紹介
lycorp_recruit_jp
1
1.2k
Featured
See All Featured
The Mythical Team-Month
searls
218
43k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
28
1.6k
The World Runs on Bad Software
bkeepers
PRO
64
11k
10 Git Anti Patterns You Should be Aware of
lemiorhan
653
58k
Code Reviewing Like a Champion
maltzj
517
39k
Docker and Python
trallard
39
3k
The Art of Programming - Codeland 2020
erikaheidi
48
13k
Become a Pro
speakerdeck
PRO
22
4.9k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
166
48k
Design by the Numbers
sachag
277
19k
How to train your dragon (web standard)
notwaldorf
85
5.6k
Agile that works and the tools we love
rasmusluckow
327
20k
Transcript
Stackdriver Monitoringの Alert設定はコード管理が可能か 株式会社リクルートライフスタイル 吉⽥ 和弘 2019年1⽉15⽇ GCPUG Tokyo Stackdriver
Day
⾃⼰紹介 吉⽥ 和弘 所属 : 株式会社リクルートライフスタイル Airメイト SREチーム GCP歴 :
ちょうど2年 趣味 : スノーボード、餃⼦
担当プロダクト ・飲⾷店経営サジェスト ・店舗の集客、売上から⽇報まで 店舗経営をサポート ・AirレジなどのAirシリーズの1つ など
担当プロダクト 技術的特徴 ・アプリ部分はGAEをフル活⽤ ・監視は Stackdriver Monitoringを利⽤ ・Stackdriverは他にも Trace, Logging, Error
Reporting などを活⽤
本題
突然ですが... 監視アラートの設定って ちゃんと管理していますか?
アラート設定の管理 ドキュメントで監視設定を定義して 設定は⼿動で⾏っているところが 多いのではないでしょうか? 実は我々もそうでした
アラート設定の管理 抱えていた課題 1. 多くのGCPサービスを利⽤しているので 監視設定が複雑 構成図の⼀部を抜粋
アラート設定の管理 抱えていた課題 2. 絶賛開発継続中なので 監視設定の追加、変更が度々発⽣する ・その度に⼿動で変更作業 ・2⼈でクロスチェック ・1つ,2つなら⼿動でもいいが⼤量に変更したいときは地獄
アラート設定の管理 抱えていた課題 3. 「このアラート設定って 前からこうだっけ?」問題 ・stackdriver側で変更⽇時はとっているが どこが変更されたのか ・いつからその設定だったのか
アラート設定の管理 アラート設定もコード化もしてちゃんと管理しよう
アラート設定の管理(検討) ・Cloud Deployment Manager →Stackdriver⾮対応
アラート設定の管理(検討) ・gcloudコマンド or API ・gcloudコマンド ・API 公式ドキュメント: バックアップ https://cloud.google.com/monitoring/alerts/using-alerting- api?authuser=3&hl=ja#api-backup-policies
リストア https://cloud.google.com/monitoring/alerts/using-alerting- api?authuser=3&hl=ja#api-restore-policies $ gcloud alpha monitoring policies create --policy-from-file $ gcloud alpha monitoring policies update --policy-from-file
アラート設定の管理(検討) ・gcloudコマンド or API →出来そう! けどそもそも設定ファイルをYAML or JSONで管理するの⾟い (1環境あたり1000⾏over) 何度も同じこと書かないといけない
アラート設定の管理(検討) ・Terraform ・2018年12⽉にTerraformがStackdriver Alertに対応 ・変数が使えるのでコード量が減らせる ・もともと他のGCPリソースも Terraformで管理していたので学習コスト低 ・GCPの他リソースと 同じデプロイパイプラインにのせられる
アラート設定の管理(検討)
アラート設定の管理(結論) Stackdriver Monitoringの Alert設定はコード管理することが可能 その場合はTerraformなどのサードパーティツールを 利⽤したほうが運⽤性は⾼くなる
注意点 ただしアラート設定はパラメータ数が多いので 他のGCPリソースと⽐べてコード化が複雑になる →管理するアラートが少ないor変更があまり発⽣しないケース では⼿動で管理するのもアリ。 運⽤コストに⾒合っているかが⼤切。
まとめ ・Stackdriver Monitoringのアラート設定を コード化して管理していくことは可能 ・gcloudコマンドやAPIでもできるが運⽤⾯考えると サードパーティツール使うのが良さそう ・アラート設定はパラメータが多いのでコードで 管理していくのは楽ではない →変更が少ないシステムの場合は ⼿動管理の⽅が幸せかも
最後に
最後に Stackdriver Monitoring Alertの設定画⾯ 前のほうが ⾒やすかったと思うのは 私だけではないはず...
ありがとうございました