From 0f359920af1d39e7a99a3decccf696def674c9b6 Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Larsen Date: Thu, 29 Jun 2023 15:03:11 +0200 Subject: [PATCH] Update golangci-lint config Signed-off-by: Mikkel Oscar Lyderik Larsen --- .golangci.yml | 2 -- pkg/collector/external_rps_collector.go | 7 ++----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index f2c38d8..888a65d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,7 +4,6 @@ run: linters: disable-all: true enable: - - deadcode - errcheck - gosimple - govet @@ -12,4 +11,3 @@ linters: - staticcheck - typecheck - unused - - varcheck diff --git a/pkg/collector/external_rps_collector.go b/pkg/collector/external_rps_collector.go index 4d2d17e..0eb02cd 100644 --- a/pkg/collector/external_rps_collector.go +++ b/pkg/collector/external_rps_collector.go @@ -12,7 +12,7 @@ import ( const ( ExternalRPSMetricType = "requests-per-second" - ExternalRPSQuery = `scalar(sum(rate(%s{host=~"%s"}[1m])) * %.4f)` + ExternalRPSQuery = `scalar(sum(rate(%s{host=~"%s"}[1m])) * %.4f)` ) type ExternalRPSCollectorPlugin struct { @@ -85,14 +85,12 @@ func (p *ExternalRPSCollectorPlugin) NewCollector( } weight = num / 100.0 } - - confCopy.Config = map[string]string{ "query": fmt.Sprintf( ExternalRPSQuery, p.metricName, - strings.ReplaceAll(strings.Join(hostnames, "|"), ".", "_"), + strings.ReplaceAll(strings.Join(hostnames, "|"), ".", "_"), weight, ), } @@ -125,4 +123,3 @@ func (c *ExternalRPSCollector) GetMetrics() ([]CollectedMetric, error) { func (c *ExternalRPSCollector) Interval() time.Duration { return c.interval } -