From 7c2458f185657dd532f71273df8534fef52f4465 Mon Sep 17 00:00:00 2001 From: Song Gao Date: Mon, 24 Feb 2020 11:29:10 +0800 Subject: [PATCH] Fix TidbMonitor template error (#1745) * Fix TidbMonitor template error --- pkg/monitor/monitor/template.go | 2 +- pkg/monitor/monitor/template_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/monitor/monitor/template.go b/pkg/monitor/monitor/template.go index 3de9ae28e1..5992df4ae8 100644 --- a/pkg/monitor/monitor/template.go +++ b/pkg/monitor/monitor/template.go @@ -74,7 +74,7 @@ func init() { if err != nil { klog.Fatalf("monitor regex template parse error,%v", err) } - tikvPattern, err = config.NewRegexp(".*\\-tikv\\-\\d*$") + tikvPattern, err = config.NewRegexp("tikv") if err != nil { klog.Fatalf("monitor regex template parse error,%v", err) } diff --git a/pkg/monitor/monitor/template_test.go b/pkg/monitor/monitor/template_test.go index 9a052ccf2e..d6b08bcbe3 100644 --- a/pkg/monitor/monitor/template_test.go +++ b/pkg/monitor/monitor/template_test.go @@ -137,7 +137,7 @@ scrape_configs: regex: target action: keep - source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_component] - regex: .*\-tikv\-\d*$ + regex: tikv action: keep - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] regex: "true"