Bird
0
0

You want to create a log-based metric that counts calls to the API method storage.objects.get only when the log severity is WARNING or higher. Which filter correctly implements this?

hard📝 Application Q8 of 15
GCP - Cloud Monitoring and Logging
You want to create a log-based metric that counts calls to the API method storage.objects.get only when the log severity is WARNING or higher. Which filter correctly implements this?
AprotoPayload.methodName = "storage.objects.get" OR severity >= "WARNING"
Bresource.type = "api" AND protoPayload.methodName = "storage.objects.get" AND severity >= "WARNING"
Cresource.type = "api" AND protoPayload.methodName = "storage.objects.get" OR severity >= "WARNING"
Dseverity = "WARNING" AND protoPayload.methodName = "storage.objects.get"
Step-by-Step Solution
Solution:
  1. Step 1: Identify required conditions

    Filter must include resource.type = "api", methodName = "storage.objects.get", and severity >= "WARNING".
  2. Step 2: Analyze logical operators

    Use AND to combine all conditions; OR would broaden the filter incorrectly.
  3. Step 3: Check severity comparison

    Severity >= "WARNING" includes WARNING and higher severities.
  4. Final Answer:

    resource.type = "api" AND protoPayload.methodName = "storage.objects.get" AND severity >= "WARNING" -> Option B
  5. Quick Check:

    All conditions combined with AND for precise filtering [OK]
Quick Trick: Use AND to combine all filter conditions precisely [OK]
Common Mistakes:
  • Using OR instead of AND, causing incorrect matches
  • Using severity = WARNING instead of >= WARNING
  • Omitting resource.type filter

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes