- alert: Pod_all_memory_usage expr: sort_desc(avg by(name)(irate(container_memory_usage_bytes{name!=""}[5m]))*100) > 1024*10^3*2 for: 10m labels: severity: critical annotations: description: 容器 {{ $labels.name }} Memory 资源利用率大于 2G , (current value is {{ $value }}) ...
5.3 排序函数 5.3.1 sort:排序 查看第一个cpu的使用时间,从小到大排序 sort(node_cpu_seconds_total{cpu="0"}) 5.3.2 sort_desc:逆向排序 查看第一个cpu的使用时间,从小到大排序 sort_desc(node_cpu_seconds_total{cpu="0"}) 5.4 其他函数 5.4.1 abs:求绝对值 求cpu使用时间的绝对值 abs(node_cpu_...
label_replace 的具体参数如下: label_replace(v instant-vector, dst_label string, replacement string, src_label string, regex string) 1. 该函数会依次对 v 中的每一条时间序列进行处理,通过regex匹配 src_label 的值,并将匹配部分relacement写入到 dst_label 标签中。如下所示: label_replace(up, "host...
sort_desc(countby(instance)({__name__!="", instance!=""})) 查询各个指标,平均在每个instance上,包含的时间序列数量,倒序排序: sort_desc(avgby(__name__)(countby(__name__, instance)({__name__!="", instance!=""})))
searchin/prometheus-users/memory%7Csort:date/prometheus-users/q4oiVGU6Bxo/uifpXVw3CwAJ https://github.com/prometheus/prometheus/issues/5723 https://github.com/prometheus/prometheus/issues/1881 Prometheus 容量规划 容量规划除了上边说的内存,还有磁盘存储规划,这和你的 Prometheus 的架构方案有关。
count(count by (label_name) (metric_name)) 如: count(count by (url) (apiserver_request_duration_seconds_bucket)) 另外还有一些其他的 PromQL, 罗列如下: sum(scrape_series_added) by (job)通过 job Label 分析 series 增长 sum(scrape_samples_scraped) by (job)通过 job Label 分析 series 总量 ...
searchin/prometheus-users/memory%7Csort:date/prometheus-users/q4oiVGU6Bxo/uifpXVw3CwAJ https://github.com/prometheus/prometheus/issues/5723 https://github.com/prometheus/prometheus/issues/1881 Prometheus 容量规划 容量规划除了上边说的内存,还有磁盘存储规划,这和你的 Prometheus 的架构方案有关。
(2) By 指定要保留的标签 Tips : 何时用Without ,何时用By? 代码语言:javascript 复制 # 下述两种情况使用By可能更有用。 # 1.与without不同的是它不会自动删除`__name__`标签 sort_desc(count by(__name__)({__name__=~"node_filesystem.+"})) # node_filesystem_files{} 116 # node_filesy...
topk(largest k elements by sample value) quantile(calculate φ-quantile (0 ≤φ≤ 1) over dimensions) 这些操作符既可以用于对所有标签维度进行聚合,也可以通过包含without或by子句来保留不同的维度。这些子句可以在表达式之前或之后使用。 <aggr-op> [without|by (<label list>)] ([parameter,] <vector ...
sort() sort(v instant-vector)函数,输入:瞬时向量,输出:key: value = 度量指标:样本值[升序排列] sort_desc() sort(v instant-vector函数,输入:瞬时向量,输出:key: value = 度量指标:样本值[降序排列] sqrt() sqrt(v instant-vector)函数,输入:瞬时向量,输出:key: value = 度量指标: 样本值的平方根 ...