You instrumented your app with OpenTelemetry and need to ensure a specific request is always traced. What should you do?
Choose an answer
Tap an option to check your answer.
Correct answer: Add the X-Cloud-Trace-Context header to the request with the appropriate parameters..
Why this is the answer
To ensure a specific request is always traced, you must explicitly instruct the tracing system to do so. Adding the X-Cloud-Trace-Context header to the request with the appropriate trace ID and span ID parameters forces the request to be part of a trace, regardless of sampling decisions. This header allows you to propagate tracing context across services. Waiting 10 minutes is not a reliable method; tracing often involves sampling, so not all requests are automatically traced. Writing a custom script to send repeated requests might eventually capture one due to sampling, but it doesn't guarantee tracing for every specific request. Using the Trace API to apply custom attributes is done after a trace has been initiated and doesn't guarantee the trace's creation in the first place.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed