Configure data completion for a line chart

Updated at:
Copy as MD

The data completion feature for line charts fills in missing or discontinuous data points, improving the accuracy of log data analysis in dashboards.

Prerequisites

Feature overview

In the General Configuration panel on the right side of the chart editing page, expand Query and Analysis Configuration > Data Configuration. Enable Data Completion, and then set Completion Window (for example, 60) and completion value (for example, 15).

  1. Query and Analysis: Query and analyze logs in the console, including log searches, aggregation, and statistics.

  2. Add a statistical chart: A dashboard consists of multiple statistical charts. Each chart represents one or more query statements.

  3. Configure data completion: Fill missing data values in a line chart.

Step 1: Query and analyze data

  1. Log on to the Simple Log Service console. In the Projects section, click the project you want.

    image

  2. On the Log Storage > Logstores tab, click the logstore you want.

    image

  3. Enter a query and analysis statement and click Last 15 Minutes to set the time range for the query.

    Example:

    • The following is an example of a query and analysis statement:

      * | select __time__,count(request_url) as pv,count(request_url)-50 as pv1,count(request_url)+50 as pv2 group by __time__

Step 2: Add a chart

  1. In the left-side navigation pane, choose Dashboard > Dashboards. In the Dashboard list, click the dashboard you want. In the upper-right corner of the dashboard page, click Edit. In edit mode, choose Add > Add Chart.

    image

  2. Under General Configurations > Chart Type. On the Query and Analysis tab, select Logstore (SQL) (a Logstore is used in this example), choose the target Logstore, and enter the query statement.

    In the upper-right corner, select a time range, such as Last 15 Minutes, from the drop-down list. Click OK > Save.

    • In the Query and Analysis Configurations section, set Axis X Field to __time__ and Axis Y Field to pv, pv1, and pv2.

Step 3: Configure data completion

Under Data Configuration > Data Completion. Set Completion Window to 60 (minimum: 10 seconds) and completion value to 15.

Note

Before you enable data completion, ensure that your x-axis data is sorted in strictly ascending order. This feature fills missing data points based on the specified completion window.