【发布时间】:2021-11-03 21:16:02
【问题描述】:
我已经使用 helm 将 prometheus 安装到我的 kubernetes 集群中,如下所示;
helm list
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
prometheus prometheus 9 2021-09-07 08:54:54.262013 +0100 +01 deployed prometheus-14.6.0 2.26.0
我正在尝试在 values.yaml 中应用 external_labels 来识别发送到 Alertmanager 的时间序列。我已经使用 prometheus 文档来获得我认为正确的配置,如下所示;
alertmanagerFiles:
alertmanager.yml:
global:
external_labels:
environment: 'perf'
我的安装没问题;
helm upgrade --install prometheus .
但是由于以下错误,我的 prometheus-server pod 崩溃了;
level=error ts=2021-09-06T18:49:25.059Z caller=coordinator.go:124 component=configuration msg="Loading configuration file failed" file=/etc/config/alertmanager.yml err="yaml: unmarshal errors:\n line 2: fie │
│ ld external_labels not found in type config.plain"
这里的许多答案都指向缩进问题,但是我看不出我做错了什么……来自 Prometheus 文档;
global:
# The labels to add to any time series or alerts when communicating with
# external systems (federation, remote storage, Alertmanager).
external_labels:
[ <labelname>: <labelvalue> ... ]
一两个星期以来,我一直在摸不着头脑 - 希望能有第二双更有经验的眼睛,谢谢! ????
【问题讨论】:
标签: kubernetes prometheus kubernetes-helm prometheus-alertmanager