Grafana中使用promql的sum_over_time如何将Grafana的选择时间作为sum_over_time时间
在Grafana中使用sum_over_time函数时,可以使用Grafana的选择时间作为sum_over_time函数的时间范围。以下是具体步骤:
-
打开Grafana的仪表盘编辑器,并选择要应用
sum_over_time函数的指标。 -
点击查询编辑器中的“函数”按钮,然后在函数列表中选择
sum_over_time函数。 -
在
sum_over_time函数的参数中,使用Grafana的内置变量$__range来表示选择的时间范围。例如,将参数设置为sum_over_time(metric_name[$__range])。 -
确保选择了正确的时间范围变量,以便
sum_over_time函数将其应用于选择的时间范围。 -
保存并应用仪表盘。
现在,sum_over_time函数将使用Grafana的选择时间作为时间范围,并计算指定指标在该时间范围内的总和。
原文地址: http://www.cveoy.top/t/topic/iirV 著作权归作者所有。请勿转载和采集!