如何使用Prometheus输入为Grafana查询设置别名

编程入门 行业动态 更新时间:2024-10-08 22:51:56
本文介绍了如何使用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?

谢谢.

推荐答案

查看此链接 docs.grafana/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查询设置别名

本文发布于:2023-11-25 21:41:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1631450.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:别名   如何使用   Prometheus   Grafana

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!