Monitor and Log with Google Cloud Operations Suite: Challenge Lab

Monitor and Log with Google Cloud Operations Suite: Challenge Lab

Monitor and Log with Google Cloud Operations Suite: Challenge Lab

Task 1: Configure Cloud Monitoring

Goto Navigation Menu -> Monitoring

Check it is enabled or not , if not enabled then enable it

Task 2: Configure a Compute Instance to generate Custom Cloud Monitoring metrics

Goto Navigation Menu -> Compute Engine -> VM instances

Screenshot 2022-05-20 032336.png

  • Stop video-queue-monitor instances
  • Edit video-queue-monitor instace:

Screenshot 2022-05-20 032624.png

  • Go to Custom metadata
    • replace the startup-script:
      • replace MY_PROJECT_ID value with your PROJECT ID
      • replace MY_GCE_INSTANCE_ID value with your your video-queue-monitor Instance id (find it in top)
      • replace MY_GCE_INSTANCE_ZONE value with us-east1-b

Then Click on Save

  • And Start/Resume video-queue-monitor instances

Task 3: Create a custom metric using Cloud Operations logging events

Screenshot 2022-05-20 033209.png

  • Goto Navigation Menu -> Logging -> Log explorer
  • Click show query and enable it and then paste this

    textPayload=~"file_format\: ([4,8]K).*"
    

    in query box and run query. Create Metric with name large_video_upload_rate,

    Click Create Metric

Task 4: Add custom metrics to the Media Dashboard in Cloud Operations Monitoring

  • Goto Navigation Menu -> Monitoring -> Media_Dashboard

  • Click Edit Dashboard -> Add Chart

  • Select Line Chart

    • Resource and metric
      • Click VM instance -> Custom -> OpenCensus

Screenshot 2022-05-20 034807.png

Then Click Apply -> Save it

  • Again Click Add Chart

  • Select Line Chart

    • Resource and metric
      • paste this in search box large_video_upload_rate

Screenshot 2022-05-20 040029.png

Apply -> Save

Task 5: Create a Cloud Operations alert based on the rate of high resolution video file uploads

Screenshot 2022-05-20 040502.png

Go to Monitoring > Alerting

  • Create Policy
    • Metric: large_video_upload_rate in search box and select logging/user/large_video_upload_rate

Screenshot 2022-05-20 040338.png

  • Rolling window : 1 minute
    • next
      • Threshold : {value as supplied to you in task} in my case it 4 might be different for you please change it accordingly
    • use notification channel turn it off
    • Name your alert with large video uploads then Save

Congratulations

You earned a new Skill Badge

Screenshot 2022-05-20 040834.png