Professional Cloud DevOps Engineer
You are managing a complex microservices application running on Google Kubernetes Engine (GKE). You recently instrumented your services with OpenTelemetry to generate traces. During a performance investigation in Cloud Trace, you notice a transaction with high latency. The trace waterfall lacks the detail needed to identify the root cause, but you suspect the issue is within the business logic of the service. This service sends structured logs to Cloud Logging. You need to quickly analyze the logs that correspond to the high-latency request. What should you do?
- A. In the Cloud Trace waterfall view, identify the trace ID of a slow request. Then, in the Logs Explorer, write a query to filter for log entries that contain that specific trace ID.
- B. Configure a log-based metric in Cloud Logging to count the occurrences of error messages. Then, create an alerting policy on this metric to be notified of future issues, and analyze the logs associated with those alerts.
- C. Export all logs from Cloud Logging to BigQuery. Write a SQL query to join the trace data with the log data on the trace ID field, and then filter for the specific transaction to find the related log entries.
- D. Ensure your application’s logging configuration includes the trace ID from the OpenTelemetry context in each structured log entry. Then, in the Cloud Trace details view for a slow request, click the “Show logs” option to view correlated logs directly alongside the trace’s span waterfall.