Managing Implementation and Ensuring Solution and Operations Reliability →hardMultiple ChoiceObjective-mapped
Google PCA Cloud Logging Practice Question
An application running on Compute Engine is experiencing increased latency. You suspect a network bottleneck due to high egress traffic. Which gcloud command can you use to quickly check the network egress traffic for a specific VM instance?
⚠ Common exam trap
Students may think that Cloud Monitoring is the only way to view metrics, but Cloud Logging can also be used to query specific data like egress bytes if logs are collected. They might also incorrectly choose D because monitoring sounds relevant, but the command 'gcloud monitoring metrics list' only lists metric descriptors, not actual data.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
gcloud logging read 'resource.type=gce_instance AND jsonPayload.egress_bytes'
The gcloud logging read command allows you to query Cloud Logging for specific log entries. For a Compute Engine instance, the resource type is gce_instance. You can filter for egress bytes by using the query 'resource.type=gce_instance AND jsonPayload.egress_bytes'. This will return log entries containing egress bytes information, assuming your VM is configured to send these logs (e.g., via the monitoring agent or VPC flow logs). This is the quickest way among the given options to check network egress traffic for a specific VM using a native gcloud command. Option B is incorrect: gcloud compute instances list only displays the network IP of instances, not egress traffic metrics. Option C is incorrect: gcloud compute instances get-serial-port-output shows the serial console output, which does not include network traffic data. Option D is incorrect: gcloud monitoring metrics list just lists available metrics but does not retrieve the actual traffic data for a specific instance. To get the data you would need to use gcloud monitoring metric descriptors or gcloud monitoring dashboards, but the command as given does not return traffic. Thus, A is the best choice.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
gcloud logging read 'resource.type=gce_instance AND jsonPayload.egress_bytes'
Why this is correct
gcloud logging read with the specified filter queries Cloud Logging for egress bytes logs from Compute Engine instances, making it the correct choice.
- ✗
gcloud compute instances list --format='value(networkInterfaces[0].networkIP)'
Why it's wrong here
gcloud compute instances list only shows the network IP of instances, not egress traffic.
- ✗
gcloud compute instances get-serial-port-output
Why it's wrong here
gcloud compute instances get-serial-port-output displays serial console output, not network traffic.
- ✗
gcloud monitoring metrics list
Why it's wrong here
gcloud monitoring metrics list lists available metric descriptors but does not retrieve actual traffic data.
Visual reference
Go deeper
Related to this question
Learn chapter
Introduction to Google Cloud Platform
Key term
VPC
A Virtual Private Cloud (VPC) is a logically isolated section of a cloud provider's network where you can launch and manage resources like servers and databases with complete control over IP addressing, subnets, route tables, and security.
Key term
Cloud logging
Cloud logging is the practice of collecting, storing, and analyzing log data generated by cloud-based resources and applications to monitor performance, troubleshoot issues, and maintain security.
About these practice questions
This PCA question is part of Courseiva's 955-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This PCA practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCA exam.