Finding and viewing traces

Trace list window (generally available)

The Trace list window lets you find, and examine, individual traces in detail. You can view and inspect all spans for a trace, view summary information for a request, and view detailed information for each span in the trace from this window. To restrict the traces being investigated, you add filters. For example, you can add a filter to display only traces whose latency exceeds 1 second.

The Trace list window stores and displays at most 1000 traces.

To view recent traces, in the Google Cloud Console select Trace and then select Trace list, or use the following button:

Go to Trace List

If this is your first time using Trace, it can take a few minutes for traces to appear. The following screenshot shows an example of the trace list for a Compute Engine configuration:

Stackdriver Trace list for Compute Engine.

Time interval

The Trace list window defaults to displaying data from the previous hour. You can change this interval to preset values by using the buttons in top of the window. The preset options are:

  • 1 hour
  • 4 hours
  • 12 hours
  • 1 day
  • 3 days
  • 1 week
  • 1 month

By default, the time interval is set to 1 hour.

To select a custom time frame, you use your pointer to highlight a section of the latency graph. This selection sets the time interval and the range of latency values for the displayed traces. For example, the following image selects a time interval of 19:00 to 6:10 AM that have a latency in the range of about 90 ms to 390 ms:

Selecting a custom time range in the trace graph.

To restore the graph to the preset time interval, click Undo zoom.

Filters

You use filters to hide, or to find individual traces. The previous section described how you can highlight a section of the latency graph to show a subset of traces in more detail, while hiding all of the other traces. In this section, the Request filter, and the filter menus are described.

By default, the filters are set to include all traces.

Filter Description
Request filter Lets you specify one or more conditions that must be satisfied for a trace to be displayed. The filter syntax lets you define when matches are exact, or when they are prefix tests. All matches are case-sensitive. For detailed information on trace filter syntax, go to Trace filters.

For example, to list all traces for a project with root span name Recv, enter the root span name, Recv, or a prefix for the root span name, such as Re.

When you want to list all traces with spans annotated with an /http/status_code label in the range 200299, where the latency is one second or more, and the trace contains a span with the exact name /modules.GetNumInstances, you would use the following filter:
    +span:/modules.GetNumInstances latency:1s /http/status_code:2
In the previous example, the trace filter term +span forces an exact match on the span name. When you want to include all traces where /modules.GetNumInstances is a prefix for a span name, omit the plus sign.

You don't need to include the string delimiter in filters unless your filter expression contains a space. For example, Recv and "Recv", are equivalent.
HTTP method The value you select for this filter applies only to trace root spans annotated with the /http/method label. You can include all requests or filter by the HTTP method type: GET, DELETE, POST, or PUT.
HTTP status The value you select for this filter applies only to trace root spans annotated with the /http/status_code label. You can select individual status values, such as 301 or ranges of status values, such as 3xx.
Service (App Engine only) Lets you select traces by their service. The value you select for service is tested against all spans of a trace. When any span matches the service, the trace is displayed.
Version (App Engine only) Lets you select traces by the application's version. The value you select for version is tested against all spans of a trace. When any span matches the value, the trace is displayed.

Latency graph

Under the row of filters is a latency graph and a table of the most recent traces. Each dot in the latency graph corresponds to a specific request. The (x,y) coordinates for a request correspond to the time and latency of the request.

When you hold the pointer over a dot, a dialog appears that includes the date, time, and latency:

    5/15/2019, 9:25:02 AM - 69 ms

When you click a dot, the following changes occur:

  • The table is updated to highlight the request you selected.
  • A Timeline is displayed under the latency graph. The timeline displays all of the latency information between services for that request.
  • A pane is displayed that includes a Summary table with information about the request and a Details table with information about the root span.

When you click a span in the Timeline, the Details pane displays additional information about that span. From this pane, you can open and view log entries, when they are available. For more information, go to Viewing trace details.

Recent-request table

By default, the recent-request table displays the 5 most recent requests. The table stores 1000 traces.

Attribute Description
Latency The end-to-end time for the application to handle the request.
HTTP method Type of HTTP method, when applicable. This field is blank for non-HTTP requests.
URI The relative URI of the request.
Analysis report
A link to the associated analysis report, when one is available.
Time When the request was started.

You can change the requests displayed in the table by using any of the following methods:

  • Select a time range.
  • Browse backwards or forwards by using the Previous and Next buttons.
  • Click a column header to change the row ordering.
  • Click a dot in the latency graph.

What's next

Trace list window (beta)

The Trace list window lets you find, and examine, individual traces in detail. You can view and inspect all spans for a trace, view summary information for a request, and view detailed information for each span in the trace from this window. To restrict the traces being investigated, you add filters. For example, you can add a filter to display only traces whose latency exceeds 1 second.

The Trace list window stores and displays at most 1000 traces.

To view recent traces, in the Google Cloud Console select Trace and then select Trace list, or use the following button:

Go to Trace List

If this is your first time using Trace, it can take a few minutes for traces to appear. The following screenshot shows an example of the trace list for a Compute Engine configuration:

Stackdriver Trace list for Compute Engine.

Time interval

The Trace list window defaults to displaying data from the previous hour. You can change this interval to preset values by using the buttons in top of the window. The preset options are:

  • 1 hour
  • 6 hours
  • 12 hours
  • 1 day
  • 2 days
  • 4 days
  • 7 days
  • 14 days
  • 30 days

To view a custom time interval, do the following:

  1. Select a preset option that is longer than your desired custom time interval.
  2. Place your pointer on the Select a trace plot at one end of the time interval and drag your pointer horizontally to the other end of the interval.
  3. (Optional) To view a custom range of latency values, placing your pointer at one end of the desired range, and dragging it vertically to the other end.

You can repeat these actions until you have selected the desired time interval and latency ranges/

To restore the graph to the preset time interval, click Reset.

Filters

You use filters to hide, or to find, individual traces. Each filter is specified by a predefined OPTION that is paired with a VALUE. The general syntax is:

[OPTION] : [VALUE]

For example, the following screenshot illustrates a single filter. The filter option is RootSpan and Recv. is the filter value. With this filter, only traces whose root span is prefixed by Recv. are displayed.

Display a filter.

To display traces that are an exact match to Recv., use +Recv. as the filter value. The use of the plus sign + indicates that you want an exact match. For more details on filtering options, see Trace filters.

If you add multiple filters, only traces that satisfy all filters are displayed.

To add a filter, do the following:

  1. Click Add trace filter to display a menu of filter options and then select an OPTION. You always have the following options:

    • RootSpan: Match the root span name.
    • SpanName: Match the span name.
    • Method: Display traces whose root spans are annotated with the /http/method label, where the value of the label matches VALUE.
    • Status: Display traces whose root spans are annotated with the /http/status_code label, where the value label matches VALUE. In this case, VALUE can contain specific status codes, such as 301, or ranges of status values, such as 3xx.
    • MinLatency: Display traces whose latency is at least as large as VALUE milliseconds.
    • HasLabel: Display traces where the label specified by VALUE appears in at least one span.
    • Service: (App Engine only) Display traces that contain at least one span whose service name matches VALUE.
    • Version: (App Engine only) Display traces that contain at least one span whose application's version matches VALUE.

    You might see other options such as URL and LABEL: Client.

  2. (Optional) If you want an exact match, enter a plus sign +. By default, a match is determined by performing a prefix test with VALUE. For more details on filtering options, see Trace filters.

  3. Specify the filter VALUE by doing one of the following:

    • Selection from the VALUE menu. The value-menu options aren't guaranteed to be complete.
    • Enter a value manually and then hit return on your keyboard.

For example, to show all traces that contain an HTTP POST command and whose latency is at least 2 seconds, add a filter with the option MinLatency whose value is 2000.

Latency graph

The graph labeled Select a trace displays a dot for each request in your selected time interval. The (x,y) coordinates for a request correspond to the time and latency of the request.

When you hold the pointer over a dot, a tooltip appears that includes the date, time, URI, and latency:

Showing a trace tooltip that displays latency information.

When you click a dot, the following changes occur:

  • The graph is refreshed and the dot you selected is highlighted with a circle drawn around the dot.
  • The request table highlights the selected URI.
  • Two new panes might open on the Trace list window. The waterfall graph displays each span in a URI. The details pane displays detailed information about the URI and includes links to logs and analysis reports when they are available. If these panes are already open, clicking a dot refreshes the data displayed in these panes.

Recent-request table

By default, the recent-request table displays the 5 most recent requests. The table stores 1000 traces.

Attribute Description
Latency The end-to-end time for the application to handle the request.
HTTP method Type of HTTP method, when applicable. This field is blank for non-HTTP requests.
URI The relative URI of the request.
Analysis report A link to the associated analysis report, when one is available.
Time When the request was started.

You can change the requests displayed in the table by using any of the following methods:

  • Select a time range.
  • Browse backwards or forwards by using the Previous and Next buttons.
  • Click a column header to change the row ordering.
  • Click a dot in the latency graph.

What's next

หน้านี้มีประโยชน์ไหม โปรดแสดงความคิดเห็น

ส่งความคิดเห็นเกี่ยวกับ...

หากต้องการความช่วยเหลือ ให้ไปที่หน้าการสนับสนุน