CCNA Pcde Monitoring Strategies Questions

14 of 89 questions · Page 2/2 · Pcde Monitoring Strategies topic · Answers revealed

76
MCQmedium

A DevOps team wants to alert when a Compute Engine instance is unreachable for 5 minutes. Which alerting condition type should be used?

A.Metric threshold condition
B.Logs-based alerting
C.Absent condition
D.Forecast condition
AnswerC

Absent condition triggers when a metric (e.g., uptime check) stops reporting.

77
MCQmedium

Your application runs on Google Kubernetes Engine (GKE) and emits traces using the OpenTelemetry SDK. You want to export these traces to Cloud Trace. Which configuration is required?

A.Use the Cloud Monitoring API to ingest traces directly.
B.Configure the OpenTelemetry SDK to use the Google Cloud Trace exporter and set the GOOGLE_CLOUD_PROJECT environment variable.
C.Deploy the Cloud Trace agent as a DaemonSet on your GKE cluster.
D.Set up a Pub/Sub topic and subscription to forward traces to Cloud Trace.
AnswerB

This is the standard way to export traces from OpenTelemetry to Cloud Trace.

Why this answer

To export OpenTelemetry traces to Cloud Trace, you need to configure the OpenTelemetry exporter to use the Google Cloud Trace exporter, and set the GCP project ID.

78
MCQeasy

Which of the following is a key benefit of using structured logging in Cloud Logging?

A.It reduces log storage costs by compressing data.
B.It automatically creates log-based metrics from the log entries.
C.It allows logs to be shipped to BigQuery in real-time.
D.It enables automatic parsing of log fields for easier querying and correlation with traces.
AnswerD

Structured logs (JSON) allow Cloud Logging to parse fields automatically.

79
MCQeasy

Which Cloud Monitoring feature allows you to group log entries from the same request across multiple services using a common identifier?

A.Cloud Trace
B.Cloud Profiler
C.Log-based metrics
D.Error Reporting
AnswerA

Cloud Trace uses trace IDs to correlate requests across services.

Why this answer

Cloud Trace uses trace IDs to correlate requests across services. Logs can include the trace ID to enable correlation between logs and traces.

80
MCQeasy

What is the primary purpose of including a runbook URL in an alert policy's documentation?

A.To link to a dashboard that shows the alert's metric
B.To automatically trigger a Cloud Function when the alert fires
C.To provide a direct link to the source code repository
D.To give responders immediate access to troubleshooting steps and escalation procedures
AnswerD

Runbook URL provides actionable guidance for alert responders.

81
Multi-Selectmedium

An application is emitting custom metrics using OpenTelemetry. You want to collect and export these metrics to Cloud Monitoring. Which TWO components are required? (Select 2)

Select 2 answers
A.Cloud Logging Agent
B.Cloud Monitoring Agent
C.Pub/Sub topic
D.OpenTelemetry SDK in the application
E.OpenTelemetry Collector
AnswersD, E

The SDK instruments the application to emit metrics.

Why this answer

The OpenTelemetry Collector can receive metrics from the application and export them to Cloud Monitoring using the Google Cloud Monitoring exporter.

82
MCQeasy

A company wants to use Cloud Monitoring dashboards to display real-time metrics for their application, but they also need to version control the dashboard configurations. Which approach should they use?

A.Define dashboards as code using the Cloud Monitoring API and store the configuration in a Git repository.
B.Manually create dashboards in the Cloud Monitoring console and export them periodically.
C.Use Grafana with the Cloud Monitoring data source and export dashboard JSON.
D.Use Cloud Monitoring's built-in 'Clone' feature to backup dashboards.
AnswerA

This allows declarative management, review, and version control of dashboard configurations.

Why this answer

Cloud Monitoring dashboards can be defined as JSON or YAML and managed via the Monitoring API or Terraform. This allows version control and CI/CD. Manually creating dashboards in the console is not reproducible.

83
MCQmedium

A developer needs to manually instrument a Go application with distributed tracing and send traces to Cloud Trace. Which approach should they use?

A.Enable automatic instrumentation by adding a Cloud Trace agent to the application.
B.Write logs with trace IDs and use log-based metric to track traces.
C.Add trace statements using the Cloud Trace API directly.
D.Use the OpenTelemetry Go SDK and configure the Cloud Trace exporter.
AnswerD

OpenTelemetry is the recommended vendor-neutral approach for manual instrumentation.

84
MCQhard

You are designing a distributed tracing strategy for a multi-service application deployed on Cloud Run and GKE. You need to ensure that all traces are captured with 100% sampling for the first 10 minutes after a new deployment, and then reduce to 10% sampling to control costs. Which approach should you use?

A.Use OpenTelemetry SDK with a custom sampler that checks the deployment timestamp stored in an environment variable, and send traces to the OpenTelemetry Collector configured to export to Cloud Trace.
B.Use Stackdriver Trace's automatic instrumentation on GKE and Cloud Run, and adjust the sampling rate via the Cloud Trace API after deployment.
C.Use Cloud Trace's built-in probabilistic sampler and configure it with 10% sampling in the configuration file.
D.Enable Cloud Trace on all services and use Cloud Monitoring alert on trace count to trigger a Cloud Function that changes the sampling rate.
AnswerA

This allows dynamic sampling rules based on deployment time. The custom sampler can implement the required logic.

Why this answer

Cloud Trace supports probability-based sampling, but to change the sampling rate based on time since deployment, you need more control. Using OpenTelemetry with a custom sampler in the application allows you to implement a rule: sample 100% if the deployment timestamp is within the last 10 minutes, else sample 10%. The OTel Collector can then export to Cloud Trace.

Cloud Trace's built-in sampling is static.

85
MCQhard

An application running on Cloud Run is automatically instrumented with Cloud Trace, but the trace sampling rate is too high, causing excessive costs. How can the engineer reduce the sampling rate?

A.Set the environment variable TRACE_SAMPLE_RATE to a value between 0 and 1.
B.Disable Cloud Trace and use only Cloud Monitoring metrics.
C.Modify the Cloud Trace API quota to limit trace ingestion.
D.Configure the trace sampling rate in the Cloud Monitoring alert policy.
AnswerA

Cloud Run uses the OpenTelemetry environment variable for sampling rate.

86
MCQmedium

An application running on Google Kubernetes Engine (GKE) emits structured logs in JSON format. The DevOps team wants to count the number of log entries that contain a specific error code (e.g., 'error_code': 500) in the last hour and use that count to trigger an alert if it exceeds a threshold. What is the most efficient way to achieve this?

A.Use Cloud Logging's Logs Explorer to run a query every minute and use Cloud Scheduler to trigger a Cloud Function that checks the count.
B.Create a log-based counter metric in Cloud Logging with the filter jsonPayload.error_code=500, then set up an alerting policy on that metric.
C.Export logs to BigQuery and run a scheduled query to count error codes, then use the result to trigger an alert via Cloud Monitoring.
D.Configure a metric threshold alert directly on the log entries in Cloud Monitoring without creating a metric.
AnswerB

Log-based metrics automatically count matching log entries and export them as a metric to Cloud Monitoring, enabling alerting and dashboards with minimal overhead.

Why this answer

Creating a log-based metric from the logs is the most efficient approach. You can define a counter metric that increments each time a log entry matches the filter (e.g., jsonPayload.error_code=500). Then you can set up an alerting policy on that metric.

This avoids scanning logs in real-time and provides a metric that can be used for dashboards and alerts.

87
Multi-Selectmedium

A DevOps team is implementing distributed tracing for a microservices application on GKE. They want to ensure traces are exported to Cloud Trace with minimal overhead. Which TWO approaches should they consider? (Choose 2)

Select 2 answers
A.Instrument the application using the OpenTelemetry SDK and configure the OTel Collector to export to Cloud Trace
B.Enable automatic instrumentation via Anthos Service Mesh (ASM)
C.Configure a Prometheus metric to capture trace data
D.Use the Stackdriver Trace API directly from the application
E.Use the Cloud Monitoring API to send trace data
AnswersA, B

OpenTelemetry is the recommended approach for distributed tracing.

Why this answer

OpenTelemetry SDK and automatic instrumentation for GKE (via Anthos Service Mesh) are both valid. The Stackdriver Trace API is deprecated in favor of OpenTelemetry.

88
MCQmedium

A team is using OpenTelemetry to instrument their microservices and wants to export traces to Cloud Trace. They have deployed the OpenTelemetry Collector as a DaemonSet on GKE. What configuration is needed on the Collector to send traces to Cloud Trace?

A.No configuration needed; the Collector automatically detects GKE and exports to Cloud Trace.
B.Configure the 'logging' exporter in the Collector to write traces to stdout, and use a sidecar to forward them.
C.Use the 'otlp' exporter to send traces to Cloud Trace's OTLP endpoint.
D.Configure the 'googlecloud' exporter with a project ID and service account credentials.
AnswerD

The googlecloud exporter sends traces directly to Cloud Trace.

Why this answer

The OpenTelemetry Collector needs an exporter configured for Google Cloud Trace. The 'googlecloud' exporter (or 'stackdriver' exporter) sends traces to Cloud Trace. The Collector must also have the appropriate IAM permissions (e.g., roles/cloudtrace.agent).

89
Multi-Selecteasy

You need to send alert notifications to a Slack channel. Which TWO components are required?

Select 2 answers
A.A notification channel of type 'slack' in Cloud Monitoring
B.A Slack webhook URL
C.A Cloud Pub/Sub topic
D.An email notification channel
E.A Cloud Function to transform the alert
AnswersA, B

Correct. The Slack notification channel must be created with the webhook URL.

Why this answer

To send alerts to Slack, you need a Slack app with a webhook URL, and a Cloud Monitoring notification channel of type 'slack' configured with that webhook URL. Pub/Sub is not required for Slack directly; Slack channels are configured via webhooks. Email notification channel type is incorrect; Slack is a separate type.

A Cloud Function could be used as an intermediary but is not required.

← PreviousPage 2 of 2 · 89 questions total

Ready to test yourself?

Try a timed practice session using only Pcde Monitoring Strategies questions.