From 918b9f1ef4bd278967e01cfd1ed47a52ed513703 Mon Sep 17 00:00:00 2001 From: Tyler Reid Date: Fri, 27 Aug 2021 12:02:25 -0500 Subject: [PATCH] Add faillint paths to reject global prometheus metrics (#18) * Add faillint paths to reject global prometheus metrics and MustRegister() Signed-off-by: Tyler Reid --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 270c244f7..00f970607 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,10 @@ lint: .tools/bin/misspell .tools/bin/faillint .tools/bin/golangci-lint faillint -paths "github.com/bmizerany/assert=github.com/stretchr/testify/assert,\ golang.org/x/net/context=context,\ sync/atomic=go.uber.org/atomic,\ - github.com/prometheus/client_golang/prometheus.{MultiError}=github.com/prometheus/prometheus/tsdb/errors.{NewMulti}" ./... + github.com/prometheus/client_golang/prometheus.{MustRegister}=github.com/prometheus/client_golang/prometheus/promauto,\ + github.com/prometheus/client_golang/prometheus.{NewCounter,NewCounterVec,NewGauge,NewGaugeVec,NewGaugeFunc,NewHistogram,NewHistogramVec,NewSummary,NewSummaryVec}\ + =github.com/prometheus/client_golang/prometheus/promauto.With.{NewCounter,NewCounterVec,NewGauge,NewGaugeVec,NewGaugeFunc,NewHistogram,NewHistogramVec,NewSummary,NewSummaryVec}"\ + ./... .PHONY: clean clean: