Soru

Zorluk: ZorConfiguring Cloud Logging, Monitoring, and Operational Alerting

An enterprise DevOps team manages a critical microservice deployed on Google Kubernetes Engine (GKE). The microservice writes structured JSON payload logs containing a custom numerical field, `processing_latency_ms`. The Site Reliability Engineering (SRE) team needs to evaluate latency distributions and set up automated alerts whenever the 99th percentile latency exceeds 500 ms over a rolling 5-minute window across all clusters. How should the team configure Google Cloud Logging and Monitoring to fulfill this operational requirement while strictly adhering to security least-privilege principles?

  1. Create a distribution log-based metric in Cloud Logging extracting `processing_latency_ms` from incoming log entries, and configure a Cloud Monitoring alerting policy targeting the 99th percentile of this metric aggregated over a 5-minute alignment window.Cevap
  2. B
    Grant the Editor primitive role to the service account executing log routing so that it can dynamically create log sinks, modify Cloud Monitoring metrics, and update alerting channels across the project without encountering permission errors.
  3. C
    Grant the Service Account Admin role (`roles/iam.serviceAccountAdmin`) to the alerting service account so it can impersonate the Logging service account and create metric descriptors on demand.
  4. D
    Create a counter log-based metric for latency occurrences and submit a regional quota increase request for Cloud Logging API read limits to prevent alerting delays during high traffic bursts.

Cevap

Create a distribution log-based metric in Cloud Logging extracting processing_latency_ms from incoming log entries, and configure a Cloud Monitoring alerting policy targeting the 99th percentile of this metric aggregated over a 5-minute alignment window.
The correct answer leverages a distribution log-based metric to extract numerical values (`processing_latency_ms`) directly from structured JSON log entries. Cloud Monitoring can then compute distribution statistics, such as the 99th percentile over a 5-minute alignment period, and trigger alerts accordingly without requiring elevated privileges or additional application code.

Adım Adım Çözüm

1
Identify metric type requirements
Determined that measuring 99th percentile latency requires a distribution log-based metric rather than a counter log-based metric.
Counter metrics only track log line counts, whereas distribution metrics extract numerical values to calculate statistical distribution functions like percentiles.
2
Configure metric extraction in Cloud Logging
Defined a custom distribution metric with a field extractor targeting payload `processing_latency_ms`.
This bridges unstructured/structured log entry values into Cloud Monitoring timeseries data.
3
Configure Cloud Monitoring Alerting Policy
Created an alerting threshold policy on the 99th percentile alignment calculation over a 5-minute rolling window.
This fulfills the operational alerting criteria using native Cloud Operations suite features under least-privilege IAM configuration.

Anahtar Kavram

Configuring distribution log-based metrics and operational alert threshold policies in Google Cloud Operations suite.
Tahmini Süre:2m 0s
Bu soruyu puanla