All Products
Search
Document Center

Application Real-Time Monitoring Service:Trace Explorer

Last Updated:Jan 08, 2024

Application Real-Time Monitoring Service (ARMS) provides the Trace Explorer feature to analyze stored full trace data. This feature allows you to filter and aggregate trace data, providing a simple and flexible analysis solution. This way, the requirements of custom diagnosis in various scenarios can be met.

Procedure

  1. Log on to the ARMS console.
  2. In the left-side navigation pane, choose Application Monitoring > Trace Explorer. In the top navigation bar, select a region.

    If this is the first time that you enter the Trace Explorer page, you must authorize ARMS to access Simple Log Service. This allows data to be delivered to Simple Log Service for analysis. You are not charged for the authorization.

    After you complete authorization, resources are automatically prepared. The process is expected to be completed within 2 minutes.

    Note
    • You are not charged for using the Trace Explorer feature.

    • If Trace Explorer fails to be activated, try again or contact technical support. For more information, see Technical support.

    Trace Explorer开通流程

  3. In the upper-right corner of the Trace Explorer page, select a time range that you want to query.

  4. Specify filter conditions.

    • In the Saved Filters section, query traces by status, duration, application name, span name, or host address.

      The filter conditions that you specify are displayed in the search box.

    • In the search box, add or remove filter conditions.自定义筛选

    • In the search box, enter a query statement. For more information about the syntax, see Use Trace Explorer to query traces.

    Note
    • You can click the 保存 icon next to the search box to save the current filter conditions.

    • You can click Saved View to view the saved filter conditions and click a filter condition to view the corresponding trace data.

    • You can aggregate the queried data based on specific dimensions.

Trace list

After you specify filter conditions, trace data is displayed on the Trace Explorer page. The trace data includes the column charts of spans and HTTP errors, the time series curve of duration, and a span list.

Span数据信息

In the span list, you can perform the following operations:

  • Click Details in the Actions column to view complete trace information. For more information, see Trace details.

  • Click Logs in the Actions column to view the logs of a trace. For more information, see Analyze logs collected by Log Service.

  • Click the 设置 icon in the upper-right corner to add or hide the fields of the list.

  • Move the pointer over a span and click the 过滤 icon to add the current parameter values as a filter condition.添加筛选条件

Scatter chart

On the Scatter plot tab, time points are distributed along the X axis and the time consumed is distributed along the Y axis. You can move the pointer over a point to view the basic information of the corresponding trace. You can click a point to view the call details of the corresponding trace. For more information, see Trace Explorer.

image.png

Trace aggregation details

Trace Explorer allows you to analyze a queried span based on various dimensions. However, you may need to analyze traces that consist of a large number of spans. The trace aggregation feature allows you to query up to 5,000 distributed traces by using specified conditions and query the corresponding spans based on the traceIds. Then, you can aggregate the queried spans to obtain the results. The integrity of the aggregated traces is guaranteed in this process.

Note

When you use the trace aggregation feature, note that aggregate queries are performed on the trace data based on the specified conditions. If you specify multiple query conditions, the calculation may not be completed in real time. We recommend that you wait patiently.

全链路聚合

Parameter

Description

spanName

The name of the span.

serviceName

The name of the application that corresponds to the span.

Number of Requests / Request Ratio

The request ratio indicates the ratio of the requests that call the current span to the total number of requests.

For example, 10% indicates that 10% of requests call the current span.

Calculation formula: Request ratio = Number of requests that call the current span / Total number of requests × 100%

Number of Spans / Request Multiple

The request multiple indicates the average number of times that the current span is called by each request.

For example, 1.5 indicates that the current span is called 1.5 times by each request.

Calculation formula: Request multiple = Number of spans / Number of requests

Average Duration / Ratio

The average duration of a span excludes the duration of its child spans.

For example, if Span A takes 10 milliseconds and its child span (Span B) takes 8 milliseconds, the average duration of Span A is 2 milliseconds.

Calculation formula: Average duration of a span = Duration of the span - Duration of all child spans

Important

For asynchronous calls, the average duration of a span includes the duration of its child spans.

Average Duration

The average duration of the span.

Number of Exceptions / Exception Ratio

The exception ratio indicates the ratio of requests with exceptions to the total number of requests.

For example, 3% indicates that exceptions occur in 3% of requests.

Calculation formula: Number of requests with exceptions / Total number of requests

Important

The number of requests with exceptions is not equal to the number of exceptions. If the request multiple is greater than 1, a request may have multiple exceptions.

Example: Span A calls Span B and Span C. The following table shows the parameters.

spanName

serviceName

Number of Requests / Request Ratio

Number of Spans / Request Multiple

Average Duration / Ratio

Average Duration

Number of Exceptions / Exception Ratio

A

-

demo

10/100.00%

10/1.00

5.00ms/25.00%

20ms

2/20.00%

-

B

demo

4/40.00%

8/2.00

16.00ms/100.00%

16ms

2/50.00%

-

C

demo

1/10.00%

1/1.00

4.00ms/100.00%

4ms

1/100.00%

The Number of Requests / Request Ratio parameter of Span A indicates that the total number of requests is 10 and the request ratio is 100%. The Number of Requests / Request Ratio parameter of Span B indicates that only 4 requests call Span B. Similarly, only one request calls Span C. The request ratio of Span B is 40% and request ratio of Span C is 10%. Other requests do not call Span B and Span C due to logical judgments or exceptions. This reflects the distribution of requests.

The Number of Spans / Request Multiple parameter of Span A is 10/1.00, which indicates that Span A is called only once by each request. However, for Span B, eight spans are called by four requests. Therefore, Span B is called twice by each request. This reflects the distribution of spans in each request.

The Average Duration / Ratio parameter of Span A is 5.00 ms/25.00%, which indicates that the average duration of Span A (except Span B and Span C) is 5 milliseconds. The average duration of Span A accounts for only 25% of the overall average duration. However, the average duration of Span B and Span C is equal to their overall average duration because Span B and Span C do not have child spans. This reflects the distribution of average duration.

The Number of Exceptions / Exception Ratio parameter of Span A is 2/20.00%, which indicates that Span A has two exceptions, accounting for 20% of the total number of requests. The Number of Exceptions / Exception Ratio parameter of Span B is 2/50.00%. Given that each request calls Span B twice, the total number of requests is 4, and the exception ratio is 50%, two requests have exceptions. Therefore, the distribution of exceptions in Span B may be: Among the total four requests, two requests are successful. Among the remaining two requests, an exception occurs in the first call of each request whereas the second call is successful.

Note

To view the details of a specific trace, move the pointer over the blue span name. You can click the recommended traceId to view the details.

Trace topology

The Trace Topology tab displays the inter-application topology of aggregated traces. The following figure shows that the two applications have call relationships. The following information is displayed for each application: the number of requests, the number of errors, and the response time.

全链路拓扑

Trace details

In the trace details panel, you can view all the spans, start time, errors, total duration of the trace, and the duration of each span.

调用链详情

In the trace details panel, you can perform the following operations on the Details tab:

  • Move the pointer over the name of a span to view the span name, application, IP address, and start time.

  • Click the 放大镜图标 icon next to a span to view the method stacks and analysis overview.

    Method Stack

    接口方法栈

    Analysis Overview

    image.png

  • Click the name of a span to view the additional information, metric details, and logs on the right of the panel. For information about the parameters in the Additional Information and Metrics tabs, see Trace Explorer parameters. For information about Java virtual machines and hosts, see JVM monitoring and Host monitoring. For information about logs, see Analyze logs collected by Log Service.

    Figure 1. Additional Information接口附加信息

    Figure 2. Metric接口指标详情

Custom development

Trace data is stored in Simple Log Service. The project name is proj-xtrace-<encode>-<region-id>. The Logstore name is logstore-tracing. The region-id parameter is the region where you use Trace Explorer, for example, cn-hangzhou. For information about data formats, see Trace Explorer parameters. You can perform custom development on the stored full trace data. You can analyze the stored full trace data based on filter conditions or aggregation dimensions. This way, the requirements of custom diagnostics in various scenarios can be met. For more information, see Analyze trace data in real time by using Trace Explorer.