获取 Prometheus Alert 中的指标名称
我正在设置一个 Prometheus 警报,它将针对多个指标发出警报。 它看起来像这样:
metric_x > threshold or metric_y > threshold or metric_x > threshold
但是如果此警报响起,我想在描述中包含有关哪个指标收到警报的内容。 有没有办法知道这 3 种情况中哪一种会导致警报响起?只是作为在警报描述中添加更多详细信息的一种方式吗? 唯一的方法是使用单独的警报或在描述中包含指标值吗?
I am setting up a Prometheus alert that will alert on several metrics.
It will look something like this:
metric_x > threshold or metric_y > threshold or metric_x > threshold
But if this alert goes off, I would like to include something in the description about which metric got alerted on.
Is there a way to know which one of those 3 conditions cause the alarm to go off? Just as a way to add more details in the alarm description?
Is the only way to do that is to have separate alarms or include the metric value in the description?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
底层的指标名称只是另一个标签,这意味着您可以将其插入注释中。方法如下:
A metric name under the hood is just another label, which means you can insert it into an annotation. Here's how: