PromQL topk 函数使用指南:快速识别指标变化趋势
To use the "topk" function in PromQL, you need to specify a range vector and a number "k" to determine the top "k" time series based on a given metric.\n\nAssuming "req_cnt" is a counter type metric, you can use the "rate()" function to calculate the per-second rate of change for this counter. Then, you can apply the "topk" function to get the top "k" time series based on this rate of change.\n\nHere's an example PromQL query using "topk" for a range vector of 5 minutes and "k" value of 10:\n\n\ntopk(10, rate(req_cnt[5m]))\n\n\nThis query will return the top 10 time series based on the rate of change of "req_cnt" over the last 5 minutes.
原文地址: https://www.cveoy.top/t/topic/pEP4 著作权归作者所有。请勿转载和采集!