Support & Troubleshooting

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

Several projects already do this today! Stackdriver Trace will analyze all data submitted through its API, regardless of where the instrumented service is hosted, including traces and spans collected from the Stackdriver Trace instrumentation libraries or through the Stackdriver Trace Zipkin Connector.

How long does Stackdriver Trace retain trace data?

Traces are stored for 30 days.

Does Google Stackdriver Trace sample every request?

Google Stackdriver Trace samples requests at a rate of 0.1 requests per second for each App Engine instance. The Stackdriver 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 hex 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 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:

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

Stackdriver Trace Documentation