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
[Codex Meetup Japan #1] Codex-Powered Mobile Apps Development
korodroid
2
1k
リセラー企業のテクサポ担当が考える、生成 AI 時代のトラブルシュート 2025
kazzpapa3
1
370
やる気のない自分との向き合い方/How to Deal with Your Unmotivated Self
sanogemaru
1
530
OSSで50の競合と戦うためにやったこと
yamadashy
2
420
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
8.9k
Digitization部 紹介資料
sansan33
PRO
1
5.6k
Kubernetes self-healing of your workload
hwchiu
0
240
ソースを読むプロセスの例
sat
PRO
15
9.5k
現場データから見える、開発生産性の変化コード生成AI導入・運用のリアル〜 / Changes in Development Productivity and Operational Challenges Following the Introduction of Code Generation AI
nttcom
0
380
Copilot Studio ハンズオン - 生成オーケストレーションモード
tomoyasasakimskk
0
160
RDS の負荷が高い場合に AWS で取りうる具体策 N 連発/a-series-of-specific-countermeasures-available-on-aws-when-rds-is-under-high-load
emiki
7
4.3k
AWS Control Tower に学ぶ! IAM Identity Center 権限設計の第一歩 / IAM Identity Center with Control Tower
y___u
1
250
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
42
2.8k
Docker and Python
trallard
46
3.6k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.1k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
600
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3k
Optimizing for Happiness
mojombo
379
70k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.6k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
253
22k
Speed Design
sergeychernyshev
32
1.2k
Bash Introduction
62gerente
615
210k
The Cult of Friendly URLs
andyhume
79
6.6k
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の設定画⾯ 前のほうが ⾒やすかったと思うのは 私だけではないはず...
ありがとうございました