Configure maximum categories

Updated at:
Copy as MD

Limit the number of data categories displayed in a Log Service dashboard flow chart to reduce query and rendering load, improving dashboard performance and response speed.

Prerequisites

Overview

  1. Query and analysis: Query and analyze logs in the console, including log search, aggregation, and statistics.

  2. Add a chart: A dashboard consists of one or more charts, each representing one or more query and analysis statements.

  3. Configure maximum categories: The flow chart groups data by the request_method field. Set the maximum number of categories to control how many values are displayed.

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 specify a time range.

    Example:

    • * | select __time__,count(0) as pv group by request_method,__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 Types > image. On the Search & Analysis tab, select LogStore (SQL), select the target Logstore, and enter a query statement.

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

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

    By default, the x-axis field __time__ is in the UNIX time format. To format the time for readability, enable Time Series Mode and set the Format option for the x-axis to YYYY-MM-DD hh:mm:ss. Time Series Mode.

Step 3: Configure maximum categories

Under Data Configuration > Maximum Categories to 20. This limits how many categories are displayed for the request_method field. The resulting chart shows data for the GET and POST categories.