diff --git a/internal/plugins/inputs/dialtesting/dialer.go b/internal/plugins/inputs/dialtesting/dialer.go index 8055525d58..8e3876b081 100644 --- a/internal/plugins/inputs/dialtesting/dialer.go +++ b/internal/plugins/inputs/dialtesting/dialer.go @@ -108,8 +108,6 @@ func (d *dialer) getSendFailCount() int { } func (d *dialer) run() error { - var maskURL string - if err := d.task.Init(); err != nil { l.Errorf(`task init error: %s`, err.Error()) return err @@ -141,7 +139,6 @@ func (d *dialer) run() error { if tokens, ok := params["token"]; ok { // check token if len(tokens) >= 1 { - maskURL = getMaskURL(parts.String()) if isValid, err := dialWorker.sender.checkToken(tokens[0], parts.Scheme, parts.Host); err != nil { l.Warnf("check token error: %s", err.Error()) } else if !isValid { @@ -170,7 +167,7 @@ func (d *dialer) run() error { for { failCount := d.getSendFailCount() - taskDatawaySendFailedGauge.WithLabelValues(d.regionName, d.class, maskURL).Set(float64(failCount)) + taskDatawaySendFailedGauge.WithLabelValues(d.regionName, d.class).Set(float64(failCount)) // exceed max send fail count, sleep for MaxSendFailSleepTime if failCount > MaxSendFailCount { diff --git a/internal/plugins/inputs/dialtesting/input.go b/internal/plugins/inputs/dialtesting/input.go index 7da9c937c1..0d066f213c 100644 --- a/internal/plugins/inputs/dialtesting/input.go +++ b/internal/plugins/inputs/dialtesting/input.go @@ -21,7 +21,6 @@ import ( "net/url" "path/filepath" "reflect" - "regexp" "strconv" "strings" "sync" @@ -39,11 +38,10 @@ import ( ) var ( // type assertions - _ inputs.ReadEnv = (*Input)(nil) - _ inputs.InputV2 = (*Input)(nil) - g = datakit.G("inputs_dialtesting") - urlMaskRegexp = regexp.MustCompile(`(token=tkn_[\w\d]{6})([\w\d]+)([\w\d]{6})`) - dialWorker *worker + _ inputs.ReadEnv = (*Input)(nil) + _ inputs.InputV2 = (*Input)(nil) + g = datakit.G("inputs_dialtesting") + dialWorker *worker ) var ( @@ -776,10 +774,6 @@ func (ipt *Input) stopAlltask() { }) } -func getMaskURL(url string) string { - return urlMaskRegexp.ReplaceAllString(url, `${1}******${3}`) -} - func defaultInput() *Input { return &Input{ Tags: map[string]string{}, diff --git a/internal/plugins/inputs/dialtesting/metrics.go b/internal/plugins/inputs/dialtesting/metrics.go index dfc0f1091a..1998d730e5 100644 --- a/internal/plugins/inputs/dialtesting/metrics.go +++ b/internal/plugins/inputs/dialtesting/metrics.go @@ -6,9 +6,8 @@ package dialtesting import ( - "github.com/prometheus/client_golang/prometheus" - "github.com/GuanceCloud/cliutils/metrics" + "github.com/prometheus/client_golang/prometheus" ) var ( @@ -44,9 +43,9 @@ func metricsSetup() { Namespace: "datakit", Subsystem: "dialtesting", Name: "dataway_send_failed_number", - Help: "The number of failed sending for each Dataway", + Help: "The number of failed sending", }, - []string{"region", "protocol", "dataway"}, + []string{"region", "protocol"}, ) taskPullCostSummary = prometheus.NewSummaryVec(