Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into DaAwesomeP-system…
Browse files Browse the repository at this point in the history
…d-socket-activation

Signed-off-by: Perry Naseck <git@perrynaseck.com>
  • Loading branch information
DaAwesomeP committed Aug 23, 2022
2 parents 29cc0f8 + 46748fd commit 4a66a7b
Show file tree
Hide file tree
Showing 88 changed files with 3,462 additions and 988 deletions.
21 changes: 18 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ executors:
# should also be updated.
golang:
docker:
- image: circleci/golang:1.17
- image: cimg/go:1.18
arm:
machine:
image: ubuntu-2004:current
resource_class: arm.medium

jobs:
test:
executor: golang
Expand All @@ -17,6 +22,12 @@ jobs:
- run: make
- prometheus/store_artifact:
file: node_exporter
test-arm:
executor: arm
steps:
- checkout
- run: uname -a
- run: make test-e2e
codespell:
docker:
- image: circleci/python
Expand Down Expand Up @@ -54,9 +65,9 @@ jobs:
destination: /build
test_docker:
machine:
image: ubuntu-2004:202101-01
image: ubuntu-2204:2022.04.2
environment:
DOCKER_TEST_IMAGE_NAME: quay.io/prometheus/golang-builder:1.16-base
DOCKER_TEST_IMAGE_NAME: quay.io/prometheus/golang-builder:1.18-base
REPO_PATH: github.com/prometheus/node_exporter
steps:
- prometheus/setup_environment
Expand Down Expand Up @@ -86,6 +97,10 @@ workflows:
filters:
tags:
only: /.*/
- test-arm:
filters:
tags:
only: /.*/
- build:
filters:
tags:
Expand Down
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "monthly"
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ jobs:
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
if: github.repository == 'prometheus/snmp_exporter'
- name: Lint
uses: golangci/golangci-lint-action@v3.1.0
uses: golangci/golangci-lint-action@v3.2.0
with:
version: v1.45.2
2 changes: 1 addition & 1 deletion .promu.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
go:
# Whenever the Go version is updated here, .circle/config.yml and
# .promu-cgo.yml should also be updated.
version: 1.17
version: 1.18
repository:
path: github.com/prometheus/node_exporter
build:
Expand Down
36 changes: 34 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,40 @@
* [ENHANCEMENT]
* [BUGFIX]

* [ENHANCEMENT] Add node_softirqs_total metric #2221
* [ENHANCEMENT] Add device filter flags to arp collector #2254
## 1.4.0-rc.0 / 2022-07-27

* [BUGFIX] [node-mixin] Fix fsSpaceAvailableCriticalThreshold and fsSpaceAvailableWarning (#2352)
* [BUGFIX] Fix concurrency issue in ethtool collector (#2289)
* [BUGFIX] Fix concurrency issue in netdev collector (#2267)
* [BUGFIX] Fix diskstat reads and write metrics for disks with different sector sizes (#2311)
* [BUGFIX] Fix iostat on macos broken by deprecation warning (#2292)
* [BUGFIX] Fix NodeFileDescriptorLimit alerts (#2340)
* [BUGFIX] Sanitize rapl zone names (#2299)
* [ENHANCEMENT] [node-mixin] Add missing selectors (#2426)
* [ENHANCEMENT] [node-mixin] Change current datasource to grafana's default (#2281)
* [ENHANCEMENT] [node-mixin] Change disk graph to disk table #2364
* [ENHANCEMENT] [node-mixin] Change io time units to %util (#2375))
* [ENHANCEMENT] Ad user_wired_bytes and laundry_bytes on *bsd (#2266)
* [ENHANCEMENT] Add additional vm_stat memory metrics for darwin (#2240)
* [ENHANCEMENT] Add device filter flags to arp collector (#2254)
* [ENHANCEMENT] Add diskstats include and exclude device flags (#2417)
* [ENHANCEMENT] Add node_softirqs_total metric (#2221)
* [ENHANCEMENT] Add rapl zone name label option (#2401)
* [ENHANCEMENT] Add slabinfo collector (#1799)
* [ENHANCEMENT] Allow user to select port on NTP server to query (#2270)
* [ENHANCEMENT] collector/diskstats: Add labels and metrics from udev (#2404)
* [ENHANCEMENT] Enable builds against older macOS SDK (#2327)
* [ENHANCEMENT] qdisk-linux: Add exclude and include flags for interface name #2432
* [ENHANCEMENT] systemd: Expose systemd minor version (#2282)
* [ENHANCEMENT] Use netlink for tcpstat collector (#2322)
* [ENHANCEMENT] Use netlink to get netdev stats (#2074)
* [FEATURE] [node-mixin] Add darwin dashboard to mixin (#2351)
* [FEATURE] Add "isolated" metric on cpu collector on linux (#2251)
* [FEATURE] Add cgroup summary collector (#2408)
* [FEATURE] Add selinux collector (#2205)
* [FEATURE] Add slab info collector (#2376)
* [FEATURE] Add sysctl collector (#2425)
* [FEATURE] Also track the CPU Spin time for OpenBSD systems (#1971)

## 1.3.1 / 2021-12-01

Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ endif

PROMU := $(FIRST_GOPATH)/bin/promu --config $(PROMU_CONF)

e2e-out-64k-page = collector/fixtures/e2e-64k-page-output.txt
e2e-out = collector/fixtures/e2e-output.txt
ifeq ($(MACH), ppc64le)
e2e-out = collector/fixtures/e2e-64k-page-output.txt
e2e-out = $(e2e-out-64k-page)
endif
ifeq ($(MACH), aarch64)
e2e-out = collector/fixtures/e2e-64k-page-output.txt
e2e-out = $(e2e-out-64k-page)
endif

# 64bit -> 32bit mapping for cross-checking. At least for amd64/386, the 64bit CPU can execute 32bit code but not the other way around, so we don't support cross-testing upwards.
Expand Down Expand Up @@ -123,6 +124,7 @@ skip-test-e2e:
checkmetrics: $(PROMTOOL)
@echo ">> checking metrics for correctness"
./checkmetrics.sh $(PROMTOOL) $(e2e-out)
./checkmetrics.sh $(PROMTOOL) $(e2e-out-64k-page)

.PHONY: checkrules
checkrules: $(PROMTOOL)
Expand Down
75 changes: 11 additions & 64 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,6 @@ GO_VERSION ?= $(shell $(GO) version)
GO_VERSION_NUMBER ?= $(word 3, $(GO_VERSION))
PRE_GO_111 ?= $(shell echo $(GO_VERSION_NUMBER) | grep -E 'go1\.(10|[0-9])\.')

GOVENDOR :=
GO111MODULE :=
ifeq (, $(PRE_GO_111))
ifneq (,$(wildcard go.mod))
# Enforce Go modules support just in case the directory is inside GOPATH (and for Travis CI).
GO111MODULE := on

ifneq (,$(wildcard vendor))
# Always use the local vendor/ directory to satisfy the dependencies.
GOOPTS := $(GOOPTS) -mod=vendor
endif
endif
else
ifneq (,$(wildcard go.mod))
ifneq (,$(wildcard vendor))
$(warning This repository requires Go >= 1.11 because of Go modules)
$(warning Some recipes may not work as expected as the current Go runtime is '$(GO_VERSION_NUMBER)')
endif
else
# This repository isn't using Go modules (yet).
GOVENDOR := $(FIRST_GOPATH)/bin/govendor
endif
endif
PROMU := $(FIRST_GOPATH)/bin/promu
pkgs = ./...

Expand Down Expand Up @@ -150,58 +127,47 @@ common-check_license:
.PHONY: common-deps
common-deps:
@echo ">> getting dependencies"
ifdef GO111MODULE
GO111MODULE=$(GO111MODULE) $(GO) mod download
else
$(GO) get $(GOOPTS) -t ./...
endif
$(GO) mod download

.PHONY: update-go-deps
update-go-deps:
@echo ">> updating Go dependencies"
@for m in $$($(GO) list -mod=readonly -m -f '{{ if and (not .Indirect) (not .Main)}}{{.Path}}{{end}}' all); do \
$(GO) get -d $$m; \
done
GO111MODULE=$(GO111MODULE) $(GO) mod tidy
ifneq (,$(wildcard vendor))
GO111MODULE=$(GO111MODULE) $(GO) mod vendor
endif
$(GO) mod tidy

.PHONY: common-test-short
common-test-short: $(GOTEST_DIR)
@echo ">> running short tests"
GO111MODULE=$(GO111MODULE) $(GOTEST) -short $(GOOPTS) $(pkgs)
$(GOTEST) -short $(GOOPTS) $(pkgs)

.PHONY: common-test
common-test: $(GOTEST_DIR)
@echo ">> running all tests"
GO111MODULE=$(GO111MODULE) $(GOTEST) $(test-flags) $(GOOPTS) $(pkgs)
$(GOTEST) $(test-flags) $(GOOPTS) $(pkgs)

$(GOTEST_DIR):
@mkdir -p $@

.PHONY: common-format
common-format:
@echo ">> formatting code"
GO111MODULE=$(GO111MODULE) $(GO) fmt $(pkgs)
$(GO) fmt $(pkgs)

.PHONY: common-vet
common-vet:
@echo ">> vetting code"
GO111MODULE=$(GO111MODULE) $(GO) vet $(GOOPTS) $(pkgs)
$(GO) vet $(GOOPTS) $(pkgs)

.PHONY: common-lint
common-lint: $(GOLANGCI_LINT)
ifdef GOLANGCI_LINT
@echo ">> running golangci-lint"
ifdef GO111MODULE
# 'go list' needs to be executed before staticcheck to prepopulate the modules cache.
# Otherwise staticcheck might fail randomly for some reason not yet explained.
GO111MODULE=$(GO111MODULE) $(GO) list -e -compiled -test=true -export=false -deps=true -find=false -tags= -- ./... > /dev/null
GO111MODULE=$(GO111MODULE) $(GOLANGCI_LINT) run $(GOLANGCI_LINT_OPTS) $(pkgs)
else
$(GOLANGCI_LINT) run $(pkgs)
endif
$(GO) list -e -compiled -test=true -export=false -deps=true -find=false -tags= -- ./... > /dev/null
$(GOLANGCI_LINT) run $(GOLANGCI_LINT_OPTS) $(pkgs)
endif

.PHONY: common-yamllint
Expand All @@ -218,28 +184,15 @@ endif
common-staticcheck: lint

.PHONY: common-unused
common-unused: $(GOVENDOR)
ifdef GOVENDOR
@echo ">> running check for unused packages"
@$(GOVENDOR) list +unused | grep . && exit 1 || echo 'No unused packages'
else
ifdef GO111MODULE
common-unused:
@echo ">> running check for unused/missing packages in go.mod"
GO111MODULE=$(GO111MODULE) $(GO) mod tidy
ifeq (,$(wildcard vendor))
$(GO) mod tidy
@git diff --exit-code -- go.sum go.mod
else
@echo ">> running check for unused packages in vendor/"
GO111MODULE=$(GO111MODULE) $(GO) mod vendor
@git diff --exit-code -- go.sum go.mod vendor/
endif
endif
endif

.PHONY: common-build
common-build: promu
@echo ">> building binaries"
GO111MODULE=$(GO111MODULE) $(PROMU) build --prefix $(PREFIX) $(PROMU_BINARIES)
$(PROMU) build --prefix $(PREFIX) $(PROMU_BINARIES)

.PHONY: common-tarball
common-tarball: promu
Expand Down Expand Up @@ -295,12 +248,6 @@ $(GOLANGCI_LINT):
| sh -s -- -b $(FIRST_GOPATH)/bin $(GOLANGCI_LINT_VERSION)
endif

ifdef GOVENDOR
.PHONY: $(GOVENDOR)
$(GOVENDOR):
GOOS= GOARCH= $(GO) get -u github.com/kardianos/govendor
endif

.PHONY: precheck
precheck::

Expand Down
Loading

0 comments on commit 4a66a7b

Please sign in to comment.