Set a table threshold

Updated at:
Copy as MD

Table thresholds visually highlight metrics on a dashboard based on configured rules, helping you quickly identify values that require attention, such as high request volumes or long response times.

Prerequisites

Overview

In the Field Configuration panel of a chart, select the pv field, set Cell Display Mode to Full Line Background Highlight, and set Color Scheme to Threshold. Then, add a condition to highlight the entire row in pink when the pv value exceeds 400. By default, other rows have a green background.

  1. Query and analysis: Query and analyze logs in the console, performing operations such as log retrieval, aggregation, and statistical analysis.

  2. Add a chart: Dashboards consist of charts, each powered by one or more query and analysis statements.

  3. Set a table threshold: Set thresholds to make a table's appearance change dynamically based on your data and configured rules.

Step 1: Query and analyze logs

  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 then select a time range for the query, such as Last 15 Minutes.

    Example:

    • The following is a sample query and analysis statement:

      * | select request_url,count(*) as pv group by request_url order by pv 

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. In the General Configurations section, select the image icon for Chart Type. On the Query and Analysis tab, select your data source (in this case, LogStore (SQL)), select the target Logstore, and enter a query statement.

    In the upper-right corner, select a time range such as Last 15 Minutes and click Apply.

    Set Chart Type to Table. An example query: * | select *.

Step 3: Set a table threshold

  • Standard Configurations > Color Scheme > Threshold: Sets the color scheme for the chart based on configured thresholds.

  • Field/Column Settings > Cell Display Mode > Full Line Background Highlight: Highlights the entire row based on a field's value and the threshold settings.

  • Threshold > Threshold: Configures value-based conditions for a field. For example, for the pv field, set the threshold to 400. Rows where pv > 400 are then displayed with a pink background, and other rows with a green background.

In the Field Configuration panel, select the pv field. Set Cell Display Mode to Full Line Background Highlight and Color Scheme to Threshold. Then, add a threshold condition. For example, a threshold of 400 highlights the entire row in pink when the pv value exceeds 400. Other rows retain a green background by default.