From 6fc3696260b86f9882653c7cf6faeb5a725aee1a Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Fri, 2 Jul 2021 14:48:16 +0300 Subject: [PATCH] lib/promscrape/discovery/consul: use case-insensitive comparison for service names Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1424 --- lib/promscrape/discovery/consul/watch.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/promscrape/discovery/consul/watch.go b/lib/promscrape/discovery/consul/watch.go index e85a4869e..f5d60c4ea 100644 --- a/lib/promscrape/discovery/consul/watch.go +++ b/lib/promscrape/discovery/consul/watch.go @@ -5,6 +5,7 @@ import ( "flag" "fmt" "net/url" + "strings" "sync" "time" @@ -252,7 +253,8 @@ func shouldCollectServiceByName(filterServices []string, serviceName string) boo return true } for _, filterService := range filterServices { - if filterService == serviceName { + // Use case-insensitive comparison for service names according to https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1422 + if strings.EqualFold(filterService, serviceName) { return true } }