Add collect[] parameter (#699)
* Add `collect[]` parameter * Add TODo comment about staticcheck ignored * Restore promhttp.HandlerOpts * Log a warning and return HTTP error instead of failing * Check collector existence and status, cleanups * Fix warnings and error messages * Don't panic, return error if collector registration failed * Update README
This commit is contained in:
parent
8f9edf87b5
commit
f3a7022602
4 changed files with 91 additions and 14 deletions
6
Makefile
6
Makefile
|
|
@ -27,6 +27,10 @@ DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD))
|
|||
MACH ?= $(shell uname -m)
|
||||
DOCKERFILE ?= Dockerfile
|
||||
|
||||
# TODO: Remove deprecated and problematic InstrumentHandlerFunc usage.
|
||||
STATICCHECK_IGNORE = \
|
||||
github.com/prometheus/node_exporter/node_exporter.go:SA1019
|
||||
|
||||
ifeq ($(GOHOSTARCH),amd64)
|
||||
# Only supported on amd64
|
||||
test-flags := -race
|
||||
|
|
@ -99,7 +103,7 @@ vet:
|
|||
|
||||
staticcheck: $(STATICCHECK)
|
||||
@echo ">> running staticcheck"
|
||||
@$(STATICCHECK) $(pkgs)
|
||||
@$(STATICCHECK) -ignore "$(STATICCHECK_IGNORE)" $(pkgs)
|
||||
|
||||
build: $(PROMU)
|
||||
@echo ">> building binaries"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue