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 Stackdriver Trace sample every request?

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"

Where:

  • 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 "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 Stackdriver Trace to show trace spans between related projects. See Viewing traces across projects for details.

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 will need to get additional permissions to view the whole trace.

For security purposes, you will not 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 may 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.

Was this page helpful? Let us know how we did:

Send feedback about...

Stackdriver Trace Documentation