LoginSignup
16
9

More than 5 years have passed since last update.

StackDriverでのGCP監視 / GoogleCloudPlatform

Last updated at Posted at 2017-12-13

GoogleCloudPlatformの公式モニタリングツール・Stackdriverの使用方法です。

image.png

Stackdriverとは?

・GoogleCloudPlatform公式のモニタリングツール
・GoogleCloudPlatform と AWS をモニタリングが可能
・Google プロダクトなどとのネイティブな統合
 - BigQuery、Cloud Storageなど
・強力なモニタリング、ロギング、診断機能
 アラート、ログ管理、レポート、トレース機能
・画面は、英語のみ
image.png

少なくともGCPサービスとの親和性は高そうです。

プロジェクト設定方法

GCPの左上のメニューより、STACKDRIVERのモニタリングを選択。
image.png

StackDriverの画面にリダイレクトされます。Googleアカウントを選択してログイン。
image.png

対象のプロジェクトを選択して、利用がスタートします。

特にComputeEngine側での設定は不要です。さすがGoogle公式。

監視設定

簡単に設定できる2つの監視設定について、手順を記載します。

CPU監視・通知

今回は、CPUのしきい値チェックをして、80%超えで通知を出します。
メニュー → Alerting → Create a Policy
68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3134323933332f38623763343836382d306563342d343639612d376365652d3131363238396261613132362e706e67.png

以下4つを設定します。
1.Conditions … しきい値の設定。
2.Notifications … しきい値チェック時の通知方法。
3.Documentation … 通知の際の付与メッセージを設定
4.Name this policy … 本設定の名前。

1.Conditions 

Threshold(しきい値)の設定をします。
image.png

GatewayというGCEに対して、CPUが80%以上が5分継続したら、という設定です。
image.png

2.Notifications 

通知方法です。無料プランのため、メール一択ですね。Premiumでは、Slack直接行けそうです。
image.png

3.Documentation

通知メール本文に記載する文章です。Markdown形式で記述できるようです。
image.png

1〜4設定まとめ

image.png
image.png

UptimeCheck(URLチェック)監視・通知

メニュー → UptimeCheck
右上のAdd Uptime Checkから追加します。
image.png

以下設定でhealthcheck.htmlを5分おきに叩いてくれて、応答のあり/なしをチェックしてくれます。
Mackerelでは有償プランのみ設定可能であり、便利!
image.png

以下は管理画面です。海外6拠点からチェックしているようです。
image.png

Email監視の設定をするため、UptimeCheckに対して、Alertingからemail設定をします。
先ほどのCPUのしきい値設定から、1.Conditionsの手順が一部異なるだけです。
メニュー → Alerting → Create a Policy → 1.Conditions
UptimeCheckを選択
image.png

TargetをURLにして、先ほどのUptimeCheckを選択します。
image.png

2.〜4.はCPUしきい値設定と同様です。

++
以上で設定はおしまいです!

料金体系

参考までに。2017/12/13現在です。
https://cloud.google.com/stackdriver/pricing?hl=ja
image.png

16
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
9