Merge pull request #305 from GLYASAI/RAINBOND-984

[FIX] error skiping metric for host
This commit is contained in:
barnettZQG 2019-06-25 17:53:25 +08:00 committed by GitHub
commit 5d73f15103
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,7 +28,6 @@ import (
"os" "os"
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
jsoniter "github.com/json-iterator/go" jsoniter "github.com/json-iterator/go"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
"k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/sets"
@ -209,7 +208,7 @@ func (sc *SocketCollector) handleMessage(msg []byte) {
return return
} }
for _, stats := range statsBatch { for _, stats := range statsBatch {
if !sc.hosts.Has(stats.Host) { if !sc.hosts.HasAny(stats.Host, "tls"+stats.Host) {
logrus.Infof("skiping metric for host %v that is not being served", stats.Host) logrus.Infof("skiping metric for host %v that is not being served", stats.Host)
continue continue
} }