Day 13: Monitor and Log with Google Cloud Operations Suite: Challenge Lab
Tasks:
- Initialize Cloud Monitoring.
Navigation menu > Monitoring
PS: 這步造理說滿簡單的,但第一次第二次做時,Not work!
後來隔一段時間再做沒有特別更動操作就可以了,估計是平台(Qwiklabs)的Checkpoints問題
- Configure a Compute Instance to generate Custom Cloud Monitoring metrics
Navigation Menu > Compute Engine > VM Instances
- 點選
video-queue-monitor
的 instance
- 點選Edit
- 找到Custom metadata
設定MY_PROJECT_ID
設定INSTANCE-ID(往上滑頁面有INSTANCE-ID可複製)
設定MY_GCE_INSTANCE_ZONE="us-east1-b"
PS: 不確定Zone設別的有沒有差
- Save
- Stop and Start
video-queue-monitor
PS: 可以Check 右上
提醒紀錄點開看狀態切換
- Create a custom metric using Cloud Operations logging events
Navigation menu > Logging > Logs Explorer
接著Run Query
- 右下有 Action,點Action再下拉點Create Metric
- custom metric的name設定為
large_video_upload_rate
4: Add custom metrics to the Media Dashboard in Cloud Operations Monitoring
Navigation menu > Monitoring > Dashboards
- click Media_Dashboard
- 點右上VIEWING,接著點Switch to Editing mode
- 中間偏右點選 ADD CHART > click Line
- 左半邊設定 resources, metrics
1)
- resource type: gce_instance
- metric: input_queue_size
2)
- resource type: gce_instance
- metric: large_video_upload_rate
5: Create a Cloud Operations alert based on the rate of high resolution video file uploads
Navigation menu > Monitoring > Alerting
- CREATE POLICY
- ADD CONDITION
- resource type: gae_instance
- metric: large_video_upload_rate
- condition: (跟Reference不同)
is above 3(Threshold) 1(minute)
- ADD > Next > Next
- Alert Name: High resolution video uploads
- Save
Get one Badget
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Reference:
GSP338 —— Monitor and Log with Google Cloud Operations Suite