iT邦幫忙

2021 iThome 鐵人賽

DAY 13
0
自我挑戰組

FRIENDS系列 第 13

Day 13: Monitor and Log with Google Cloud Operations Suite: Challenge Lab

Tasks:

  1. Initialize Cloud Monitoring.
    Navigation menu > Monitoring
    PS: 這步造理說滿簡單的,但第一次第二次做時,Not work!
    後來隔一段時間再做沒有特別更動操作就可以了,估計是平台(Qwiklabs)的Checkpoints問題
  2. 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 右上提醒紀錄點開看狀態切換
  3. Create a custom metric using Cloud Operations logging events
    Navigation menu > Logging > Logs Explorer
    • 在Query Section 填寫
      textPayload=~"file_format\: ([4,8]K).*"
      
    接著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

Reference:

GSP338 —— Monitor and Log with Google Cloud Operations Suite


上一篇
Day 12: ML APIs | Google Cloud
下一篇
Day 14: Draft
系列文
FRIENDS30

尚未有邦友留言

立即登入留言