From 8a84f00731d204eff3e4f6848571da3000a8ab99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Qi=CE=BC=24hi=D0=AFu=C3=AD?= <39378935+srstack@users.noreply.github.com> Date: Sun, 24 Apr 2022 14:36:49 +0800 Subject: [PATCH] fix: exporter and grafana are abnormal in prometheus (#1853) --- embed/templates/config/prometheus.yml.tpl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/embed/templates/config/prometheus.yml.tpl b/embed/templates/config/prometheus.yml.tpl index 6dec42b071..65a4b8b4cf 100644 --- a/embed/templates/config/prometheus.yml.tpl +++ b/embed/templates/config/prometheus.yml.tpl @@ -298,6 +298,19 @@ scrape_configs: labels: group: 'tiflash' {{- end}} + relabel_configs: + - source_labels: [__address__] + target_label: __param_target + - source_labels: [__param_target] + target_label: instance + - target_label: __address__ + replacement: {{.BlackboxAddr}} + - job_name: "monitor_port_probe" + scrape_interval: 30s + metrics_path: /probe + params: + module: [tcp_connect] + static_configs: {{- if .PushgatewayAddr}} - targets: - '{{.PushgatewayAddr}}'