Prepare and test your skills
Prepare and test your skills
Free sample question, answered and explained below. The Professional Cloud DevOps Engineer practice bank has 1,455 more like it. Try 10 free: instant score, no account.
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 Prometheus receiver under the metrics configuration block enables the Ops Agent's OpenTelemetry Collector component to scrape metric endpoints exposed in the standard Prometheus exposition format. Using metric_relabel_configs, administrators can modify, drop, or rename metric labels during scrape time.
metric_relabel_configs operate exclusively on numerical time-series metric data destined for Cloud Monitoring or Managed Service for Prometheus. They have no ability to read, process, or route text log entries to Cloud Logging.prometheus_target resource type in Cloud Monitoring.The microservice exposed an HTTP /metrics scrape endpoint and the goal was to drop high-cardinality JVM metric series before ingesting custom application metrics into Cloud Monitoring.
Telemetry collection in the Ops Agent is split into distinct domains: logging handles event streams via Fluent Bit, whereas metrics handles time series via the OpenTelemetry Collector.
The combined configuration block in the Ops Agent is designed specifically for ingesting OpenTelemetry Protocol (OTLP) payloads. Applications instrumented with OpenTelemetry SDKs can stream OTLP telemetry directly to the agent over gRPC (typically port 4317).
/var/log/app/service.log.combined configuration section does not support defining or applying processors (logging.processors) or log filtering rules.combined block allows only receiver specifications and cannot define pipeline transformations or log parsing.The requirement were to ingest distributed trace spans and user-defined custom metrics emitted directly by an application instrumented with the OpenTelemetry SDK over gRPC.
To ingest logs using OpenTelemetry, applications must write structured log lines to disk or standard output where the Ops Agent's Fluent Bit engine collects and forwards them.
The legacy Cloud Logging agent (google-fluentd) is the predecessor to the Google Cloud Ops Agent. It relies on standalone Fluentd to monitor log files and ship log entries to Cloud Logging.
/etc/google-fluentd/config.d/ rather than the unified YAML schema in /etc/google-cloud-ops-agent/config.yaml.google-fluentd and google-cloud-ops-agent) instead of a single unified binary.The host system ran an obsolete operating system version supported only by the legacy logging agent and incompatible with the Ops Agent.
The Ops Agent was purpose-built to replace both legacy google-fluentd and stackdriver-agent by integrating Fluent Bit for all logging pipelines and OpenTelemetry Collector for metrics.
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.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated