我正在尝试向Prometheus中的目标添加一个标签,以修改SpringBoot中的文件。
我尝试在Springboot中添加一个Prometheus标签,方法如下(在SpringBoot中修改SpringBoot中的Prometheus),但没有成功。
management:
metrics:
tags:
application: ${spring.application.name}
threadLimitInPrometheus: 40 # This tag didn't work
您能告诉我在SpringBoot中添加Prometheus标签的
我试图弄清楚如何将map[string]string的键值对添加到prometheus.Labels结构中。
如果您有使用prometheus的经验:我正在尝试动态添加标签和它的值。
labelsMap := make(map[string]string)
labelsMap["nodepool"] = "default"
labelsMap["zone"] = "europe-west"
// here I'd like to add my key / value pairs from my map
container
我试图在推送网关中添加标签到度量中。下面是我使用的代码:
completionTime := prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "completion_timestamp_seconds",
Help: "The timestamp of the last successful completion.",
},
[]string{"cluster"},
)
我们正在使用Prometheus进行度量收集。Prometheus将被部署为一个容器,它将从各种来源收集度量,并将数据存储在本地机器(容器正在运行的地方)中。如果保存容器的节点失败了,我们将与该节点一起丢失度量,因为Prometheus将所有度量存储在该本地机器中。Kubernetes将在一个健康的节点中检测容器故障并跨越该容器,但是我们已经丢失了旧节点中的数据.。
为了解决这个问题,我们有两个想法
我们得把整个普罗米修斯和库伯奈特脱钩。
- We need to make sure of high availability for the Prometheus server