If an exception is identified on a dashboard, you can configure an interaction occurrence to perform drill-down analysis in an efficient manner. For example, you can select Open Logstore, Open Trace Analysis, or Open Dashboard from the Add Event drop-down list to configure an interaction occurrence and identify the root cause of the exception. This topic describes the supported types of interaction occurrences. This topic also describes how to configure an interaction occurrence for a dashboard.
Feature description
If an exception is identified on a dashboard, you can configure an interaction occurrence to perform drill-down analysis in an efficient manner. You can configure the following types of interaction occurrences: Open Logstore, Open Dashboard, Open Saved Search, Create Custom HTTP URL, Open Trace Details, and Open Full-stack Observability Trace Details.
In this example, an NGINX access log is used as the sample log, and a dashboard named HTTP Status Codes is added. After you click the part that corresponds to HTTP status code 200 in the pie chart on the dashboard, you are navigated to the related Logstore, and you can view the logs of requests for which HTTP status code 200 is returned. The query time range of the Logstore is the same as the query time range of the dashboard.
Add a pie chart: Configure the query time range, Logstore, and query statement for the chart.
Configure an interaction occurrence: Configure an Open Logstore interaction occurrence for the pv field in the pie chart on the dashboard and add the
${{status}}
variable when you configure the interaction occurrence. The ${{status}} variable is used to dynamically modify the related parameter in the specified query statement. This way, you can view the logs of requests for which the status code specified by the ${{status}} variable is returned in the specified Logstore. For more information, see Use variables to dynamically modify the parameters of a query statement.
Simple Log Service supports the following types of interaction occurrences. For more information about how to configure an interaction occurrence, see the "Procedure" section of this topic.
Open Logstore
Open Dashboard
Create Custom HTTP URL
Open Saved Search
Open Trace Analysis
Open Trace Details
Open Full-stack Observability Trace Analysis
Open Full-stack Observability Trace Details
Procedure
Example 1: Configure an Open Logstore interaction occurrence
1. Add a pie chart
1.1 Add a dashboard
Add a dashboard: Log on to the Simple Log Service console and select the project that you want to manage. On the Dashboard > Dashboards page, add a dashboard named HTTP Status Codes.
1.2 Add a chart
Click Add Chart.
Configure and save a chart.
On the left side of the page that appears, configure the query time range, Logstore, and query statement for the chart.
On the right side of the page that appears, select a chart type in the Chart Types section and configure the Category and Value Column parameters in the Query and Analysis Configurations section. After you complete the configuration, click Apply in the upper part of the page to view the configuration effects of the chart. Then, click OK in the upper-right corner of the page to save the chart.
* | select count(1) as pv ,status group by status
2. Configure an interaction occurrence
In this example, an Open Logstore interaction occurrence is configured. After you click the part that corresponds to HTTP status code 200 in the pie chart on the dashboard, you are navigated to the related Logstore, and you can view the logs of requests for which HTTP status code 200 is returned. The query time range of the Logstore is the same as the query time range of the dashboard.
2.1 Configure an interaction occurrence for a field
On the right side of the page, click the Interaction Occurrences tab. Then, click Add Field and select the field that you want to manage from the drop-down list.
Click Add Event and select Open Logstore from the drop-down list. In the Open Logstore dialog box, configure the Select Logstore parameter and the dynamic variables in the Filter Statement field.
The Select Logstore parameter specifies the Logstore whose data you want to query. The Time Range parameter specifies the time range of the query statement. The Filter Statement parameter specifies the query statement displayed on the query and analysis page of the Logstore.
2.2 Save the chart and the dashboard
In the upper-right corner of the Edit Chart page, click OK.
In the upper-right corner of the dashboard page, click Save.
2.3 Verify the interaction occurrence
Click the part that corresponds to HTTP status code 200 in the pie chart on the dashboard. In the popover that appears, click Open Logstore. Then, you are navigated to the query and analysis page of the Logstore and the query statement on the page is status: 200
. The query time range is Two Days Before, which is the same as the query time range of the dashboard.
Example 1: Configure an Open Dashboard interaction occurrence
This section provides an example on how to configure an interaction occurrence by using a Logstore named website_log that stores NGINX access logs and two dashboards named RequestMethod and destination_drilldown.
Add a table of request methods to the RequestMethod dashboard and configure an interaction occurrence for the table to open the destination_drilldown dashboard.
Add a line chart that displays the trend of page views (PVs) over time to the destination_drilldown dashboard.
After the configuration is complete, you can click a request method on the RequestMethod dashboard to access the destination_drilldown dashboard. Then, you can view the trend of PVs over time on the destination_drilldown dashboard. You can perform the following operations to configure the interaction occurrence:
Add a line chart that displays the trend of PVs over time to the destination_drilldown dashboard.
Enter the following query statement.
${{method|PUT}}
specifies a variable. For more information, see Add a chart to a dashboard.request_method: ${{method|PUT}} | SELECT __time__ - __time__ %60 AS time, COUNT(1) AS PV GROUP BY time ORDER BY time
Add a table of request methods to the RequestMethod dashboard and configure an interaction occurrence for the table.
Enter the query statement shown in the following figure. For more information, see Add a chart to a dashboard.
Configure the interaction occurrence based on the following figure.
Set the Select Dashboard parameter to destination_drilldown.
Add a dynamic variable named method and select the request_method column.
Verify the interaction occurrence.
On the RequestMethod dashboard, click GET and click Open Dashboard. You are navigated to the destination_drilldown dashboard.
The trend of PVs for GET requests over time is displayed in a line chart.