本文介绍了如何使用Prometheus输入为Grafana查询设置别名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前遇到Grafana/Prometheus的问题.我有一个面板,我正在尝试向其中添加其他查询.为了能够配置阈值,我应该给每个查询一个唯一的别名,但是我真的不知道该怎么做.

I am currently facing an issue with Grafana/Prometheus. I've got a panel and I am trying to add different queries to it. To be able to configure thresholds I should give every query a unique alias but I really don't know how to do that.

有人可以给我一个例子吗?

Could anybody provide an example to me?

谢谢.

推荐答案

查看此链接 http://docs.grafana.org/features/datasources/prometheus/#templated-queries

使用模板查询对您有帮助.

To use Template Query is help for you.

首先,您应该定义是否带有metric的label_values.然后,在面板中提取您想要的内容.

First, you should define label_values with metric or not. and, extract what you want in your panel.

这是我的仪表板.我已导入节点导出器服务器指标,然后在模板查询中将实例"修改为别名".希望对您有帮助.

this is my dashboard. I have imported Node Exporter Server metrics, and modify 'instance' to 'alias' in Template Query. I hope this will help you.

这篇关于如何使用Prometheus输入为Grafana查询设置别名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 00:23