Release Notes
Announcements
status:>=400 | select count(*) as errorRequestCount
{"requestTime":"2020/12/30 15:35:46","method":"POST","handler":"/messages","timeCost":"45","status":"200"}{"requestTime":"2020/12/30 15:35:46","method":"POST","handler":"/users","timeCost":"23","status":"200"}{"requestTime":"2020/12/30 15:35:47","method":"POST","handler":"/messages","timeCost":"57","status":"200"}{"requestTime":"2020/12/30 15:35:47","method":"POST","handler":"/users","timeCost":"25","status":"200"}{"requestTime":"2020/12/30 15:35:47","method":"POST","handler":"/users","timeCost":"689","status":"200"}{"requestTime":"2020/12/30 15:35:48","method":"POST","handler":"/users","timeCost":"87","status":"200"}{"requestTime":"2020/12/30 15:35:48","method":"POST","handler":"/users","timeCost":"34","status":"200"}{"requestTime":"2020/12/30 15:35:48","method":"POST","handler":"/users","timeCost":"698","status":"200"}{"requestTime":"2020/12/30 15:35:48","method":"POST","handler":"/messages","timeCost":"25","status":"200"}{"requestTime":"2020/12/30 15:35:48","method":"POST","handler":"/messages","timeCost":"78","status":"200"}
* | select count(*) as requests_total,method,handler group by method,handler order by requests_total desc limit 10000
requests_total{method="POST", handler="/messages"} 4requests_total{method="POST", handler="/users"} 6
Configuration Item | Description |
Source Log Topic | The input for the scheduled SQL task, namely, the log topic where the original logs to be converted into metrics are located. |
Target topic | The output of the scheduled SQL task, select metric topic to store the converted metrics in the specified metric topic. If there is no metric topic currently, you can create a metric topic. |
Query Statement | * | select count(*) as requests_total,method,handler group by method,handler order by requests_total desc limit 10000 |
Metric Name | Select the field that needs to be the metric name from the SQL statement results. For example, in the example above, requests_total is the metric name, and its value is the metric value. |
Metric Dimensions | Select the fields that need to be metric dimensions from the SQL statement results. For example, in the example above, method and handler are metric dimensions. |
Configuration Item | Description |
Duration | The time range for querying logs. For example, query log data from 2023-01-01 00:00:00 to 2023-03-31 00:00:00. An empty end time means the task will continue to run. It is recommended to set the end time to empty to continuously convert newly collected logs into metrics. |
Scheduling cycle | Periodic query, meaning logs are queried once every X minutes. The value ranges from 1 to 1,440 minutes. It is recommended to run it every 1 minute to convert logs into metrics more promptly. |
Query Time Window | Time window for query statements. It is recommended to use @m-1m ~ @m, the last minute. With the scheduling cycle of 1 minute, this is equivalent to converting the logs of that minute into metrics every minute. |
SQL execution delayed | The delay time for query execution, set in Advanced Settings. The default value to 60 seconds. There is usually a delay in log index generation, and queries cannot be performed before the index is generated. Therefore, it is recommended to set a 60-second delay for querying, by which time the index is already generated (99.9% of the index data will be generated within 5 seconds). |
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback