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"