You can add variable replacement to a Simple Log Service dashboard to support custom label-based drilling and analysis.For example, the label code for the apiserver_request_total metric indicates status code.To filter out metric data with the specified code value, perform the following steps:
Create a filter. You also need to set the Key value parameter because this example uses code as the label.You can manually set a static entry list for the entries to be selected, or use an SQL statement to obtain a dynamic entry list from the Metricstore.
Add a variable replacement template in the PromQL statement.
After you select a specific value in the filter, $ in the query statement is automatically replaced with the parameter value in the filter.After the query statement is executed, the corresponding chart is automatically refreshed, as shown in the following figure.