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
header to the request. The header specification is:
TRACE_IDis 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_IDis the decimal representation of the (unsigned) span ID. It should be
0for the first span in your trace. For subsequent requests, set
SPAN_IDto the span ID of the parent request. See the description of
TraceSpan(REST, RPC) for more information about nested traces.
1to trace this request. Specify
0to not trace the request.
For example, to force a trace with cURL:
curl "http://www.example.com" --header "X-Cloud-Trace-Context: 105445aa7843bc8bf206b120001000/0;o=1"
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
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.