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
960
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
20250705 Headlamp: 專注可擴展性的 Kubernetes 用戶界面
pichuang
0
280
PO初心者が考えた ”POらしさ”
nb_rady
0
220
FOSS4G 2025 KANSAI QGISで点群データをいろいろしてみた
kou_kita
0
400
さくらのIaaS基盤のモニタリングとOpenTelemetry/OSC Hokkaido 2025
fujiwara3
3
460
ゼロからはじめる採用広報
yutadayo
3
970
データグループにおけるフロントエンド開発
lycorptech_jp
PRO
1
110
AI専用のリンターを作る #yumemi_patch
bengo4com
6
4.3k
Model Mondays S2E04: AI Developer Experiences
nitya
0
190
高速なプロダクト開発を実現、創業期から掲げるエンタープライズアーキテクチャ
kawauso
3
9.6k
Getting to Know Your Legacy (System) with AI-Driven Software Archeology (WeAreDevelopers World Congress 2025)
feststelltaste
1
160
CDKTFについてざっくり理解する!!~CloudFormationからCDKTFへ変換するツールも作ってみた~
masakiokuda
1
170
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
2
7.8k
Featured
See All Featured
Bash Introduction
62gerente
613
210k
Mobile First: as difficult as doing things right
swwweet
223
9.7k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Building Adaptive Systems
keathley
43
2.7k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
740
For a Future-Friendly Web
brad_frost
179
9.8k
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の設定画⾯ 前のほうが ⾒やすかったと思うのは 私だけではないはず...
ありがとうございました