Prepare and test your skills
Prepare and test your skills
Free sample question, answered and explained below. The Professional Cloud DevOps Engineer practice bank has 1,455 more like it. Try 10 free: instant score, no account.
A team of DevOps engineers is redesigning the observability architecture for a distributed microservices application running on Google Cloud. The application currently produces hundreds of gigabytes of unstructured string logs per day, experiences high Cloud Trace ingestion costs due to un-sampled tracing, and struggles with query latency during production incident investigations.
Which strategy should the team implement to optimize observability telemetry for efficient troubleshooting while balancing operational costs?
Head-based sampling makes a sampling decision at the very beginning of a request (the root span) before the transaction executes or encounters any errors. Fixed percentage head-based sampling (such as 0.01%) uniformly discards 99.99% of all traces regardless of whether the transaction eventually succeeds or throws a critical 500 internal server error.
This approach would only be suitable for ultra-high-throughput, stateless read-only APIs where cost reduction is the sole priority and end-to-end debugging fidelity or error tracking is not required.
This approach runs production microservices at maximum verbosity (DEBUG), capturing detailed execution traces, memory structures, and verbose debug logs into raw files. Telemetry pipelines then attempt to infer severity levels downstream by scanning unstructured log strings for keywords like info, warning, or error using regular expressions.
DEBUG verbosity exponentially increases logging volume, saturating disk I/O, network bandwidth, and cloud ingestion quotas while generating massive ingestion costs.error in its payload, regex matching will misclassify the severity level as an alert-worthy event.Enabling global debug logging is appropriate only in isolated, non-production staging environments or during targeted, short-lived diagnostic reproduction sessions for complex bugs.
This pattern strips out distributed trace context propagation headers (such as traceparent or X-Cloud-Trace-Context) between microservices to minimize network payload sizes. Ingestion parsers then attempt to extract metadata and map log severity values to generic platform classifications after ingestion.
The architecture consisted strictly of isolated, monolithic legacy applications with no inter-service communication and simple availability reporting needs.
Structured observability is an engineering practice where application logs, metrics, and distributed traces are emitted in standardized, machine-readable formats. Instead of writing raw text strings, applications output JSON structured payloads with well-defined metadata fields such as severity, message, timestamp, and distributed tracing context (logging.googleapis.com/trace and spanId). Combined with tail-based trace sampling and disciplined metric design, this creates a cost-effective, high-fidelity troubleshooting ecosystem.
severity (e.g., INFO, WARNING, ERROR) without complex, CPU-intensive runtime parsing. This accelerates log querying, filtering, and automated alerting during incidents.trace_id and span_id) directly into the JSON log payload correlates log entries with distributed trace spans automatically, enabling engineers to jump from a latency spike in a trace view straight to the relevant diagnostic logs.This approach strikes the ideal balance between telemetry fidelity and cost control. It structures diagnostic data so that automated tools and engineers can pinpoint root causes rapidly while eliminating redundant telemetry spend.
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