Can I use Stackdriver Trace on infrastructure not hosted on Google Cloud?

Trace analyzes all data submitted through its API, regardless of where the instrumented service is hosted, including traces and spans collected from the Trace instrumentation libraries or through the Trace Zipkin Connector.

How long does Trace retain trace data?

Traces are stored for 30 days.

Does Trace sample every request?

Trace samples requests at a rate of 0.1 requests per second for each App Engine instance. The Trace SDKs can be configured to sample at custom rates.

How do I force a request to be traced?

To force a specific request to be traced, add an X-Cloud-Trace-Context header to the request. The header specification is:

"X-Cloud-Trace-Context: TRACE_ID/SPAN_ID;o=TRACE_TRUE"


  • TRACE_ID is a 32-character hexadecimal value representing a 128-bit number. It should be unique between your requests, unless you intentionally want to bundle the requests together. You can use UUIDs.

  • SPAN_ID is the decimal representation of the (unsigned) span ID. It should be 0 for the first span in your trace. For subsequent requests, set SPAN_ID to the span ID of the parent request. See the description of TraceSpan (REST, RPC) for more information about nested traces.

  • TRACE_TRUE must be 1 to trace this request. Specify 0 to not trace the request.

For example, to force a trace with cURL:

curl "" --header "X-Cloud-Trace-Context:

How do I get permissions to view trace spans outside of my project?

You can set up Trace to show trace spans between related projects. For details, go to Viewing traces across projects.

If you see a message One or more spans of this trace are not shown because you lack the "cloudtrace.traces.get" permission for the project where they were written you need to get additional permissions to view the whole trace.

For security purposes, you won't have access to the list of projects contained in the trace. If you are not sure what projects are in the trace that you lack access for, you might need to contact your organization administrator to look at the trace and ensure you have permissions to all spans in it. The project of the current span is visible by clicking on the span and looking at the "Project" label in the span details pane.

Var denne siden nyttig? Si fra hva du synes:

Send tilbakemelding om ...

Stackdriver Trace
Trenger du hjelp? Gå til brukerstøttesiden vår.