是什么“向上{}”语法是什么意思?

问题描述 投票:0回答:1

我一直对一些普罗米修斯模板,每当我看到模板的其他例子我一直遇到这样的命令:

$jobs = label_values(job)

$instance = up{job=~"$jobs"}

据我所知,$工作是创建一个变量,但我旁边有没有什么线索up命令在做什么。我在网上看了,我真的不能缩小搜索范围足以让一个通用词,如“向上”哈哈

我最好的猜测是,它使$instance变量只等于在那里的工作是类似的工作情况?我真的不知道

任何帮助将澄清了一堆。谢谢!

syntax prometheus grafana-templating
1个回答
0
投票

按照Jobs and instances普罗米修斯文档:

当普罗米修斯擦伤的目标,它会自动附加到用以识别目标刮刮的时间序列的一些标签:

job: The configured job name that the target belongs to.
instance: The <host>:<port> part of the target's URL that was scraped.

如果这些标签都已经存在于刮数据,该行为取决于honor_labels配置选项。

对于每个实例刮,普罗米修斯存储在以下时间序列的样本:

up{job="<job-name>", instance="<instance-id>"}: 1 if the instance is healthy, i.e. reachable, or 0 if the scrape failed. 

up时间序列例如可用性监控。

© www.soinside.com 2019 - 2024. All rights reserved.