Courseiva

Google ACE Practice Question: Ensuring Successful Operation of a Cloud Solution

You need to create a log-based metric that counts the number of 5xx errors from your application logs. The logs are in Cloud Logging and contain a field "httpRequest.status". Which filter should you use when creating the metric?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

httpRequest.status >= 500

Log-based metrics use Cloud Logging filter language to select log entries.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    httpRequest.status:5*

    Why it's wrong here

    The syntax httpRequest.status:5* attempts to use a wildcard on a field value, but Cloud Logging's filter language does not support wildcard matching on field values. The ':' operator is for equality or "has" checks, not pattern matching; there's no wildcard expansion for log field values. Thus this will cause an invalid filter error or simply not match as intended.

  • ✗

    severity=ERROR AND "5xx"

    Why it's wrong here

    This filter combines severity=ERROR with a quoted string "5xx". The severity field is typically 'ERROR' but the lexical presence of "5xx" in a log entry's text payload is not guaranteed; HTTP status codes appear as numeric values in the httpRequest.status field, not as literal strings like "5xx". Therefore this filter is unreliable and will miss most relevant log entries.

  • ✗

    httpRequest.status = 500 OR httpRequest.status = 501 OR httpRequest.status = 502

    Why it's wrong here

    This OR condition explicitly enumerates only statuses 500, 501, and 502. It will miss other 5xx statuses such as 503, 504, and 505, which are also count-worthy errors under the metric definition. Such enumerated filters are brittle as they require updating when additional 5xx codes need to be captured.

  • ✓

    httpRequest.status >= 500

    Why this is correct

    This filter uses a comparison operator on the numeric field httpRequest.status. In Cloud Logging, filters support comparison operators like >= for numeric values, so this will match any log entry where the HTTP response status is 500 or higher, capturing all server error statuses (5xx). This is the recommended approach because it is concise and semantically correct.

About these practice questions

This ACE question is part of Courseiva's 775-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This ACE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ACE exam.