Soru

Zorluk: Çok zorMonitoring and Logging

A Cloud Engineer is configuring the unified Ops Agent on a fleet of Linux Compute Engine virtual machines (VMs) to ingest custom application logs located at `/var/log/app_telemetry.log` into Cloud Logging. After installing the agent with its default configuration, system metrics and standard syslog entries are correctly appearing in Cloud Observability, but entries from `/var/log/app_telemetry.log` are missing. Which modification to the Ops Agent configuration file (`/etc/google-cloud-ops-agent/config.yaml`) is required to ingest these custom log entries?

  1. Add a receiver of type `files` specifying `/var/log/app_telemetry.log` under `include_paths` in the `logging` section, and reference that receiver in a logging pipeline under `service`.Cevap
  2. B
    Install and configure the legacy Stackdriver Logging Agent (`google-fluentd`) alongside the Ops Agent to process non-system log files.
  3. C
    Grant the Compute Engine default service account the primitive Owner role (`roles/owner`) so the agent gains permission to tail custom local directory paths.
  4. D
    Enable the Cloud Logging API in the organization resource node rather than in the project hosting the virtual machines.

Cevap

Add a receiver of type `files` specifying `/var/log/app_telemetry.log` under `include_paths` in the `logging` section, and reference that receiver in a logging pipeline under `service`.
To collect non-standard application log files using the unified Google Cloud Ops Agent, you must edit `/etc/google-cloud-ops-agent/config.yaml`. Inside the `logging` section, define a receiver with `type: files` and include the path `/var/log/app_telemetry.log` under `include_paths`. Finally, add this receiver to a pipeline under `logging.service.pipelines` so that the agent routes those log lines to Cloud Logging.

Adım Adım Çözüm

1
Identify the telemetry ingestion mechanism
Recognize that the unified Ops Agent requires custom log sources to be explicitly configured in `/etc/google-cloud-ops-agent/config.yaml`.
By default, the Ops Agent only collects standard system metrics and syslog/journald logs.
2
Configure the receiver for file monitoring
Define a receiver under `logging.receivers` with `type: files` and set `include_paths: ["/var/log/app_telemetry.log"]`.
The `files` receiver type tells the agent to tail specific file paths on the local filesystem.
3
Connect the receiver to the logging service pipeline
Add the newly defined receiver key to `logging.service.pipelines.default_pipeline.receivers`.
Receivers must be bound to an active pipeline in the service section for data to flow to Cloud Logging.

Anahtar Kavram

Ops Agent Custom Logging Configuration
Bu soruyu puanla