Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Developer practice bank has an additional 608 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
Your team operates a C# (.NET) application across Compute Engine, Google Kubernetes Engine (GKE), and Amazon EC2. To meet compliance requirements, all Cloud Logging buckets in your Google Cloud project are encrypted with customer-managed encryption keys (CMEK). After enabling CMEK, application exceptions written to logs no longer appear in Google Cloud Error Reporting.
You must meet the following requirements:
What should you do?
Several managed Google Cloud compute platforms—such as App Engine flexible environment, Cloud Run, and Cloud Run functions—automatically capture output written to stderr, forward it to Cloud Logging, and allow Error Reporting to extract stack traces without custom client instrumentation.
stderr collection still relies on Cloud Logging as the intermediary. When customer-managed encryption keys (CMEK) are enabled on the destination log buckets, Error Reporting cannot analyze those logged exceptions.stderr output to Cloud Logging without configuring a logging agent and parser.stderr output on VMs or containers can be split into individual log lines unless the logging agent reconstructs multi-line stack traces into a single entry.The workload ran exclusively on managed serverless environments like Cloud Run or App Engine flexible environment and stored logs in standard Cloud Logging buckets without CMEK.
Developers migrating from serverless platforms to Compute Engine, GKE, and Amazon EC2 often assume stderr alone triggers Error Reporting. In heterogeneous VM environments—especially when CMEK is active—direct Error Reporting API integration via client libraries is required.
The Cloud Ops Agent collects logs from virtual machines and forwards them to Cloud Logging. When an application writes plain-text stack traces across multiple lines, a parse_multiline processor groups those consecutive lines into a single log entry so Error Reporting can recognize the complete exception.
Your Cloud Logging buckets did not use CMEK, Assured Workloads were disabled, and the primary issue was that plain-text multi-line stack traces from custom VM applications were being split into separate log entries.
A common misconception is that fixing log formatting alone guarantees Error Reporting ingestion. In reality, bucket-level settings such as CMEK prevent log-based error inference regardless of how cleanly the Ops Agent parses stack traces.
Emitting structured JSON payloads with a message field containing the complete stack trace, a serviceContext object identifying the service, and a severity of ERROR formats log entries so Error Reporting can automatically parse and group exceptions from Cloud Logging.
parse_json processor or a Fluentd sender) to forward structured payloads to Cloud Logging.serviceContext.service and the stack trace in message to organize errors by service and version.ERROR for automatic event creation.Your Cloud Logging buckets used Google-managed encryption keys instead of CMEK, and you wanted to standardize custom exception metadata (such as httpRequest context and serviceContext) without integrating the Error Reporting client library.
Structured JSON logging is a best practice for log-based Error Reporting in standard projects, but when CMEK is mandated for log buckets, applications must send error events directly via the Error Reporting API or a language-specific client library.
The Google.Cloud.Diagnostics set of libraries enables C# and .NET applications to capture unhandled exceptions and custom error events and send them directly to the Error Reporting API (clouderrorreporting.googleapis.com). Rather than relying on log agents and Cloud Logging log-bucket scanning to infer errors, the client library calls the projects.events.report endpoint directly.
Google.Cloud.Diagnostics bypasses log-based inference so errors are still captured and grouped while log buckets remain CMEK-encrypted.roles/errorreporting.writer) to the Compute Engine/GKE service accounts (with the cloud-platform access scope) and to the Amazon EC2 service account credentials authorizes all environments to write error events.serviceContext and HTTP request details in a single structured payload.Any approach that relies on Cloud Logging ingestion—such as Ops Agent multiline parsing, structured JSON logs, or stderr collection—fails when log buckets use CMEK. Direct instrumentation with Google.Cloud.Diagnostics is the only supported method here that satisfies both multi-environment stack trace collection and strict CMEK compliance.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated