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.
You are instrumenting a distributed microservices application running on GKE and Cloud Run using OpenTelemetry and the Telemetry API. The application includes Go and Java services communicating over HTTP and gRPC, with some services spawning background worker threads and calling a legacy service that only recognizes X-Cloud-Trace-Context.
During incident triage, you need to meet the following observability requirements:
Which instrumentation strategy should you implement?
traceparent header across HTTP and gRPC metadata (using X-Cloud-Trace-Context only as a fallback), explicitly pass the active trace context across worker threads, attach exemplars to metric measurements, and populate the trace ID field in structured Cloud Logging entries.Context propagation and signal correlation form the foundation of unified troubleshooting in distributed architectures. OpenTelemetry standardizes how a single request's Trace ID, Parent Span ID, and sampling flags travel across process boundaries and asynchronous execution units so that metrics, logs, and traces share common diagnostic identifiers.
SetTextMapPropagator in Go) to prioritize the W3C traceparent header across both HTTP headers and gRPC metadata ensures downstream services link new child spans to the invoking parent span. Retaining X-Cloud-Trace-Context strictly as a fallback preserves compatibility with the legacy service while modernizing the rest of the mesh. Explicitly passing the active context object into spawned worker threads prevents background work from splitting into disconnected root traces.projects/<PROJECT_ID>/traces/<TRACE_ID>) into structured Cloud Logging entries allows Logs Explorer and Observability Analytics to group all application logs emitted during a request alongside its trace spans.traceparent and the OTLP format through the Telemetry API avoids proprietary lock-in and provides higher quotas.X-Cloud-Trace-Context as a fallback prevents trace breaks when interacting with older Google Cloud runtimes or legacy services.Unlike strategies that rely on ad-hoc headers, manual timestamp matching, or isolated logging, this approach binds all three observability signals—metrics, logs, and traces—together automatically using standardized correlation identifiers.
X-Cloud-Trace-Context header for all services, and filter Cloud Logging entries by instanceId and time windows during metric spikes.This approach assumes that Cloud Trace handles context propagation automatically on behalf of applications, standardizes on Google Cloud's legacy X-Cloud-Trace-Context header format, and attempts to tie logs to metrics using container instance identifiers (instanceId) and approximate timestamps.
X-Cloud-Trace-Context goes against modern W3C trace context standards, lacks clean interoperability across OpenTelemetry gRPC integrations and newer services, and formats span IDs in decimal rather than hexadecimal.instanceId only isolates events on a single Cloud Run container instance—which frequently processes multiple concurrent requests—and does not connect Cloud Monitoring latency spikes to specific distributed traces or cross-service logs.SetTextMapPropagator to pass headers across HTTP and gRPC metadata.instanceId filter groups all concurrent requests handled by one instance rather than isolating a single transaction's path.You only needed to inspect sequential container crash behavior on a single Cloud Run instance in Logs Explorer without performing distributed tracing or metric-to-trace drilldowns.
While X-Cloud-Trace-Context remains supported for backward compatibility, services should prioritize traceparent and use the legacy header only as a fallback mechanism.
X-Goog-Request-Reason HTTP header across services, write that UUID into unstructured text log lines, and create logs-based metrics to link Cloud Monitoring alerts back to distributed spans.This strategy repurposes the X-Goog-Request-Reason HTTP header to transmit a custom request identifier, records that identifier inside plain-text logs, and derives logs-based metrics in Cloud Logging to monitor request behavior.
traceparent or grpc-trace-bin metadata. A custom UUID in X-Goog-Request-Reason is ignored by OpenTelemetry trace exporters and Google Cloud automatic tracing.X-Goog-Request-Reason header is designed to pass metadata such as a CI/CD pipeline run ID into Cloud Audit Logs for change attribution, not to propagate distributed tracing context across microservices or worker threads.trace field required for Logs Explorer to automatically link log entries with Cloud Trace spans, and standard logs-based metrics do not attach exemplars that link metric data points to distributed traces.X-Goog-Request-Reason enriches administrative audit trails rather than application performance telemetry.Your goal were to establish a non-repudiable audit trail correlating CI/CD deployment pipelines or Terraform runs with Cloud Audit Logs entries rather than instrumenting runtime microservices.
Although custom correlation IDs in logs help basic log filtering, adopting OpenTelemetry with W3C traceparent and structured trace ID log fields provides native cross-signal navigation across Cloud Monitoring, Cloud Logging, and Cloud Trace.
tracestate header across HTTP and gRPC calls, start a new root span with the sampled flag set to true at every downstream service boundary, and use Observability Analytics SQL queries to join logs and traces by HTTP request path.This configuration transmits the optional tracestate header between services, initiates independent root spans with sampling enabled at each microservice hop, and relies on Observability Analytics SQL joins over request URL paths to match logs with traces.
tracestate header is optional and only carries vendor-specific key-value metadata. Without the traceparent header, downstream services do not receive the shared Trace ID or Parent Span ID needed to link operations into a unified trace.Parent span ID is null) at each downstream service boundary destroys the end-to-end execution hierarchy, turning one distributed transaction into isolated single-service traces. Additionally, components make independent sampling decisions and cannot force downstream sampling without propagating the parent traceparent sampling flag (01) and using a ParentBased sampler.traceparent is mandatory for W3C trace identity, whereas tracestate is supplemental.You needed to pass supplemental vendor-specific routing metadata alongside an already configured traceparent header, and each service's trace was intentionally meant to be analyzed independently.
Using Observability Analytics to join logs and traces via SQL is highly effective only when both telemetry signals actually share a propagated Trace ID.
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