0
0
GCPcloud~10 mins

Cloud Monitoring overview in GCP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a basic alert policy in Cloud Monitoring using gcloud CLI.

GCP
gcloud monitoring policies create --notification-channels=[1] --condition-display-name="High CPU Usage" --condition-filter="metric.type=\"compute.googleapis.com/instance/cpu/utilization\"" --condition-threshold-value=0.8
Drag options to blanks, or click blank then click option'
Aemail-channel
Bcpu-channel
Cdisk-channel
Dmemory-channel
Attempts:
3 left
💡 Hint
Common Mistakes
Using a metric name instead of a notification channel ID.
Leaving the notification channel blank.
2fill in blank
medium

Complete the code to list all monitored resource descriptors in Cloud Monitoring.

GCP
gcloud monitoring resource-descriptors [1]
Drag options to blanks, or click blank then click option'
Adescribe
Bcreate
Cdelete
Dlist
Attempts:
3 left
💡 Hint
Common Mistakes
Using describe which shows details for one resource only.
Using create or delete which modify resources.
3fill in blank
hard

Fix the error in the command to create a metric descriptor for custom metrics.

GCP
gcloud monitoring metric-descriptors create [1] --metric-kind=GAUGE --value-type=DOUBLE --unit="1" --description="Custom metric"
Drag options to blanks, or click blank then click option'
Amy_metric
Bcustom.googleapis.com/my_metric
Ccompute.googleapis.com/my_metric
Dmetric/custom/my_metric
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the required prefix for custom metrics.
Using a Google Cloud predefined metric prefix.
4fill in blank
hard

Fill both blanks to create a filter for CPU utilization metric with resource type 'gce_instance'.

GCP
filter="metric.type=[1] AND resource.type=[2]"
Drag options to blanks, or click blank then click option'
Acompute.googleapis.com/instance/cpu/utilization
Bgce_instance
Ccustom.googleapis.com/cpu_utilization
Daws_ec2_instance
Attempts:
3 left
💡 Hint
Common Mistakes
Using a custom metric type instead of the predefined CPU utilization metric.
Using a resource type from another cloud provider.
5fill in blank
hard

Fill all three blanks to create a JSON snippet for a Cloud Monitoring alert policy condition.

GCP
{
  "displayName": "High Memory Usage",
  "condition": {
    "displayName": [1],
    "conditionThreshold": {
      "filter": [2],
      "comparison": [3]
    }
  }
}
Drag options to blanks, or click blank then click option'
A"High Memory Usage Condition"
B"metric.type=\"compute.googleapis.com/instance/memory/utilization\""
C"COMPARISON_GT"
D"memory_condition"
Attempts:
3 left
💡 Hint
Common Mistakes
Using unquoted strings for JSON values.
Using incorrect comparison operators.