###### tags: `阿瑜` # 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 ](https://github.com/Hsins/Qwiklabs-Challenges-Guide/tree/main/challenge-labs/GSP338_Monitor-and-Log-with-Google-Cloud-Operations-Suite)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up