From 1a3ce7cf1972a0228e6ef92fb8b77b151587f31d Mon Sep 17 00:00:00 2001 From: Boris Savelev Date: Wed, 3 Jan 2024 17:11:56 +0200 Subject: [PATCH] [fix] Empty label is not allowed For DM deployment there is no blackbox instances and the label value is replaced with an empty string. New Prometheus versions has a check for that: FAILED: instance 0 in group 0: no address , ssh_stdout: Checking /tidb-deploy/prometheus-9090/conf/prometheus.yml , ssh_command: export LANG=C; PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin /tidb-deploy/prometheus-9090/bin/prometheus/promtool check config /tidb-deploy/prometheus-9090/conf/prometheus.yml}, cause: exit status 1: check config failed --- embed/templates/config/prometheus.yml.tpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/embed/templates/config/prometheus.yml.tpl b/embed/templates/config/prometheus.yml.tpl index 238eb179ab..0770f36d2e 100644 --- a/embed/templates/config/prometheus.yml.tpl +++ b/embed/templates/config/prometheus.yml.tpl @@ -376,8 +376,10 @@ scrape_configs: target_label: __param_target - source_labels: [__param_target] target_label: instance + {{- if .BlackboxAddr}} - target_label: __address__ replacement: '{{.BlackboxAddr}}' + {{- end}} {{- range $addr := .BlackboxExporterAddrs}} - job_name: "blackbox_exporter_{{$addr}}_icmp" scrape_interval: 6s