Stackdriver Trace shows the details for a trace in the Trace Details view. This view shows a summary of details about the request, a graphical timeline that shows the root span for the request and subspans for any RPC calls, and a detailed view of latency data collected for the spans.
To view the details for a trace:
Go to your trace list at Stackdriver > Trace > Trace List in the Google Cloud Platform Console, or click the following button:
For more information about finding traces, see Finding traces.
In the trace list, click any request URI. The trace details appear below:
The pane on the right in the trace details view includes a summary and details for this request. The details include the following information:
|Timestamp||The time at which the application received the incoming request.|
|Traced Time||The aggregate time it took for all RPC calls to be completed.|
|Untraced Time||The time during which no RPC calls were made (i.e. time spent locally in the app). Longer than typical untraced time at the beginning of a request can often be caused by a new instance being created to handle the load.|
|Log||A link to the associated log entries.|
|Report||A link to the associated analysis report details.|
|Service||The App Engine service that handled the request. See the documentation for Java, Python, Go and PHP.|
|Version||The version of the App Engine application that handled the request.|
|HTTP Method||The HTTP method for the request.|
|Status Code||The HTTP status returned by the request.|
Stackdriver Trace associates logs with traces using annotations in the log entries. App Engine Standard automatically associates its log entries with traces, but not all services do.
If you use the Trace SDK, then you have the option to annotate a log entry by
trace field of the
LogEntry object to a trace ID
in the following format:
You can also associate a log entry with a specific trace span. To do this, set
span_id field to the 16-character hexadecimal encoding of the
span's ID. For example, a span with an ID of "74" would be represented as
From the trace detail view of the GCP Console, there are several ways to find log entries:
Click the Show Logs button in the Timeline panel to show log entries alongside the trace. This button appears when there are log entries associated with the trace.
Click the Log: View link in the Summary panel to open a Stackdriver Logging window and view the log entries associated with your trace. If no log entries are associated with your trace, the Logging window is empty.
Click the VM Log: View link in the Summary panel, which is present for traces generated by Cloud Load Balancer. The link opens a Stackdriver Logging window and shows you the logs from the VM instance that served the request. The Logging window view is restricted to the timestamp range of the trace.
To view any log entries, you must have the
in your project. This permission is provided by the Logging Logs Viewer and
Project Viewer IAM roles.
To view VM instance logs, you must have the
in your project. This permission is provided by the Compute Engine Network
Viewer and Project Viewer IAM roles.
For more information about viewing log entries in Stackdriver Logging, see the Logs Viewer.
Span annotations and message events (Beta)
Span annotations and message events can be written using the Stackdriver Trace API v2. If present, they are displayed in the trace timeline. As with spans and log entries, you can select an annotation or message event to see its full details in the right-hand details pane.
The timeline is a graphical representation of latency data for the request. It shows a root span that represents the time it took for the application to process the request end-to-end, as well as subspans that represent the time it took to complete RPC calls performed when handling the request.
You can click on any span in the timeline to view span details. Parent-child relationships between the selected span and its subspans are shown on the timeline, and additional data reported to Stackdriver Trace during application runtime is displayed in the pane on the right.
For the root span, Stackdriver Trace displays the following properties:
|Name||Relative URL for the request. Displayed in the span label.|
|Latency||The time it took the application to handle the request end-to-end. Displayed in the span label.|
|gae/request_log_id||Internal App Engine request ID. Displayed in the details panel below the timeline.|
|http/host||Hostname where the application is running. Displayed in the details panel below the timeline.|
|http/response/size||Number of bytes in the HTTP response body. Displayed in the details panel below the timeline.|
|http/url||Relative URL for the request. Displayed in the details panel below the timeline.|
The information displayed for subspans varies depending on the RPC call. However, Stackdriver Trace always displays the following:
|Name||Name of the RPC call in format service_name.call_name (for example,
|Latency||The time it took to complete the round-trip RPC call. Displayed in the span label.|
Insights on the performance of the request will be shown below the timeline, if available.
For more information, see Performance insights.
View traces across projects
You can set up Stackdriver Trace to show trace spans from projects calling into your target project as well as trace spans from other projects servicing requests for your target project.
See Viewing traces across projects for details.