Update golangci-lint config

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
This commit is contained in:
Mikkel Oscar Lyderik Larsen 2023-06-29 15:03:11 +02:00
parent 54e2d2d564
commit 0f359920af
2 changed files with 2 additions and 7 deletions

View File

@ -4,7 +4,6 @@ run:
linters:
disable-all: true
enable:
- deadcode
- errcheck
- gosimple
- govet
@ -12,4 +11,3 @@ linters:
- staticcheck
- typecheck
- unused
- varcheck

View File

@ -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 {
@ -86,13 +86,11 @@ 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
}