Professional Cloud DevOps Engineer
Prepare and test your skills
Prepare and test your skills
Worked example. The correct answer is already marked and every option is explained below, so there is nothing to select here. To answer questions yourself, start the free trial.
A DevOps team is deploying a business-critical microservice across a fleet of Compute Engine Linux virtual machines (VMs). The service writes application events and stack traces to /var/log/app/service.log.
The team has the following observability and operational requirements:
/var/log/app/service.log.DEBUG log entries before sending data to Cloud Logging to manage ingestion costs.How should the DevOps team configure /etc/google-cloud-ops-agent/config.yaml to achieve these objectives?
The Ops Agent uses an embedded Fluent Bit engine to provide high-throughput, unified log collection and processing on Compute Engine virtual machines. Its architecture is configured using a declarative YAML structure comprising receivers (log data sources), processors (log parsing, field modification, and filtering), and service pipelines (directional streams connecting receivers through processors to the Cloud Logging exporter).
type: files under logging.receivers with the target path /var/log/app/service.log tells the Fluent Bit engine to tail and collect log entries from the custom application log file.parse_multiline and parse_json processors under logging.processors ensures multi-line stack traces (such as Java, Python, or Go exceptions) are properly concatenated into single log entries before payload JSON structures are parsed.exclude_logs processor allows the team to evaluate log statements against matching rules (e.g., matching DEBUG level) and discard them prior to egress, preventing unnecessary ingestion and storage charges in Cloud Logging.logging.service.pipelines guarantees that raw file logs flow through multiline reconstruction, JSON field extraction, and exclusion filtering before export./etc/google-cloud-ops-agent/config.yaml file.This solution relies completely on standard, supported Ops Agent logging mechanisms. It consolidates log gathering and pre-ingestion filtering directly on the host without requiring custom sidecar daemons or external log forwarders.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.