Skip to content

Commit

Permalink
Merge prometheus upstream release 1.7.0
Browse files Browse the repository at this point in the history
BREAKING CHANGE:

* following are metric names that have changed (only those
  previously used in project https://github.com/shatteredsilicon/grafana-dashboards)

  - node_boot_time -> node_boot_time_seconds
  - node_context_switches -> node_context_switches_total
  - node_time -> node_time_seconds
  - node_forks -> node_forks_total
  - node_intr -> node_intr_total
  - node_cpu -> node_cpu_seconds_total
  - node_disk_bytes_read -> node_disk_read_bytes_total
  - node_disk_bytes_written -> node_disk_written_bytes_total
  - node_disk_io_time_ms -> node_disk_io_time_seconds_total * 1000
  - node_disk_reads_completed -> node_disk_reads_completed_total
  - node_disk_reads_merged -> node_disk_reads_merged_total
  - node_disk_read_time_ms -> node_disk_read_time_seconds_total * 1000
  - node_disk_writes_completed -> node_disk_writes_completed_total
  - node_disk_writes_merged -> node_disk_writes_merged_total
  - node_disk_write_time_ms -> node_disk_write_time_seconds_total * 1000
  - node_filesystem_free -> node_filesystem_free_bytes
  - node_filesystem_size -> node_filesystem_size_bytes
  - node_memory_Buffers -> node_memory_Buffers_bytes
  - node_memory_Cached -> node_memory_Cached_bytes
  - node_memory_Mapped -> node_memory_Mapped_bytes
  - node_memory_MemAvailable -> node_memory_MemAvailable_bytes
  - node_memory_MemFree -> node_memory_MemFree_bytes
  - node_memory_MemTotal -> node_memory_MemTotal_bytes
  - node_memory_SwapCached -> node_memory_SwapCached_bytes
  - node_memory_SwapFree -> node_memory_SwapFree_bytes
  - node_memory_SwapTotal -> node_memory_SwapTotal_bytes
  - node_network_receive_bytes -> node_network_receive_bytes_total
  - node_network_receive_drop -> node_network_receive_drop_total
  - node_network_receive_errs -> node_network_receive_errs_total
  - node_network_receive_multicast -> node_network_receive_multicast_total
  - node_network_receive_packets -> node_network_receive_packets_total
  - node_network_transmit_bytes -> node_network_transmit_bytes_total
  - node_network_transmit_drop -> node_network_transmit_drop_total
  - node_network_transmit_errs -> node_network_transmit_errs_total
  - node_network_transmit_multicast -> node_network_transmit_multicast_total
  - node_network_transmit_packets -> node_network_transmit_packets_total
  • Loading branch information
oblitorum committed Apr 10, 2024
2 parents 0fb8848 + 7333465 commit 89cd49a
Show file tree
Hide file tree
Showing 528 changed files with 38,178 additions and 6,373 deletions.
129 changes: 129 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
---
version: 2.1
orbs:
prometheus: prometheus/[email protected]
executors:
# Whenever the Go version is updated here, .promu.yml and .promu-cgo.yml
# should also be updated.
golang:
docker:
- image: cimg/go:1.21
arm:
machine:
image: ubuntu-2204:current
resource_class: arm.medium

jobs:
test:
executor: golang
steps:
- prometheus/setup_environment
- run: go mod download
- run: make
- prometheus/store_artifact:
file: node_exporter
test-arm:
executor: arm
steps:
- checkout
- run: uname -a
- run: make test-e2e
test_mixins:
executor: golang
steps:
- checkout
- run: go install github.com/google/go-jsonnet/cmd/jsonnet@latest
- run: go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest
- run: go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest
- run: make promtool
- run: make -C docs/node-mixin clean
- run: make -C docs/node-mixin jb_install
- run: make -C docs/node-mixin
- run: git diff --exit-code
build:
machine:
image: ubuntu-2204:current
parallelism: 3
steps:
- prometheus/setup_environment
- run: docker run --privileged linuxkit/binfmt:af88a591f9cc896a52ce596b9cf7ca26a061ef97
- run: promu crossbuild -v --parallelism $CIRCLE_NODE_TOTAL --parallelism-thread $CIRCLE_NODE_INDEX
- run: promu --config .promu-cgo.yml crossbuild -v --parallelism $CIRCLE_NODE_TOTAL --parallelism-thread $CIRCLE_NODE_INDEX
- persist_to_workspace:
root: .
paths:
- .build
- store_artifacts:
path: .build
destination: /build
test_docker:
machine:
image: ubuntu-2204:current
environment:
DOCKER_TEST_IMAGE_NAME: quay.io/prometheus/golang-builder:1.18-base
REPO_PATH: github.com/prometheus/node_exporter
steps:
- prometheus/setup_environment
- attach_workspace:
at: .
- run:
command: |
if [ -n "$CIRCLE_TAG" ]; then
make docker DOCKER_IMAGE_TAG=$CIRCLE_TAG
else
make docker
fi
- run: docker images
- run: docker run --rm -t -v "$(pwd):/app" "${DOCKER_TEST_IMAGE_NAME}" -i "${REPO_PATH}" -T
- run:
command: |
if [ -n "$CIRCLE_TAG" ]; then
make test-docker DOCKER_IMAGE_TAG=$CIRCLE_TAG
else
make test-docker
fi
workflows:
version: 2
node_exporter:
jobs:
- test:
filters:
tags:
only: /.*/
- test-arm:
filters:
tags:
only: /.*/
- build:
filters:
tags:
only: /.*/
- test_docker:
requires:
- test
- build
filters:
tags:
only: /.*/
- test_mixins:
filters:
tags:
only: /.*/
- prometheus/publish_master:
context: org-context
requires:
- test
- build
filters:
branches:
only: master
- prometheus/publish_release:
context: org-context
requires:
- test
- build
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
.tarballs/

!.build/linux-amd64
!.build/linux-armv7
!.build/linux-arm64
!.build/linux-ppc64le
!.build/linux-s390x
15 changes: 9 additions & 6 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<!--
Please note: GitHub issues should only be used for feature requests and
bug reports. For general discussions, please refer to one of:
- #prometheus on freenode
- the Prometheus Users list: https://groups.google.com/forum/#!forum/prometheus-users
bug reports. For general discussions, please refer to one of the community channels
described in https://prometheus.io/community/.
Before filing a bug report, note that running node_exporter in Docker is
not recommended, for the reasons detailed in the README:
https://github.com/prometheus/node_exporter#using-docker
https://github.com/prometheus/node_exporter#docker
Finally, also note that node_exporter is focused on *NIX kernels, and the
WMI exporter should be used instead on Windows.
Expand All @@ -19,9 +17,14 @@
-->
### Host operating system: output of `uname -a`

### node_exporter version: output of `node_exporter -version`
### node_exporter version: output of `node_exporter --version`
<!-- If building from source, run `make` first. -->

### node_exporter command line flags
<!-- Please list all of the command line flags -->

### node_exporter log output

### Are you running node_exporter in Docker?
<!-- Please note the warning above. -->

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"
32 changes: 32 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
# This action is synced from https://github.com/prometheus/prometheus
name: golangci-lint
on:
push:
paths:
- "go.sum"
- "go.mod"
- "**.go"
- "scripts/errcheck_excludes.txt"
- ".github/workflows/golangci-lint.yml"
- ".golangci.yml"
pull_request:

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: install Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: 1.20.x
- name: Install snmp_exporter/generator dependencies
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@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
with:
version: v1.54.2
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ dependencies-stamp
/.idea
*.iml

vendor/
# Test files extracted from ttar
collector/fixtures/sys/
collector/fixtures/udev/

/vendor
33 changes: 33 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
linters:
enable:
- misspell
- revive
disable:
# Disable soon to deprecated[1] linters that lead to false
# positives when build tags disable certain files[2]
# 1: https://github.com/golangci/golangci-lint/issues/1841
# 2: https://github.com/prometheus/node_exporter/issues/1545
- deadcode
- unused
- structcheck
- varcheck

issues:
exclude-rules:
- path: _test.go
linters:
- errcheck

linters-settings:
errcheck:
exclude-functions:
# Used in HTTP handlers, any error is handled by the server itself.
- (net/http.ResponseWriter).Write
# Never check for logger errors.
- (github.com/go-kit/log.Logger).Log
revive:
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
- name: unused-parameter
severity: warning
disabled: true
27 changes: 27 additions & 0 deletions .promu-cgo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
go:
# Whenever the Go version is updated here, .circle/config.yml and
# .promu.yml should also be updated.
version: 1.21
cgo: true
repository:
path: github.com/prometheus/node_exporter
build:
binaries:
- name: node_exporter
flags: -a -tags 'netgo osusergo static_build'
ldflags: |
-X github.com/prometheus/common/version.Version={{.Version}}
-X github.com/prometheus/common/version.Revision={{.Revision}}
-X github.com/prometheus/common/version.Branch={{.Branch}}
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
tarball:
files:
- LICENSE
- NOTICE
crossbuild:
platforms:
- darwin/amd64
- darwin/arm64
- netbsd/amd64
- netbsd/386
20 changes: 5 additions & 15 deletions .promu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ go:
repository:
path: github.com/prometheus/node_exporter
build:
flags: -a -tags 'netgo static_build'
binaries:
- name: node_exporter
flags: -a -tags 'netgo osusergo static_build'
ldflags: |
-s
-w
Expand All @@ -18,17 +20,5 @@ tarball:
- NOTICE
crossbuild:
platforms:
- linux/amd64
- linux/386
- darwin/amd64
- darwin/386
- windows/amd64
- windows/386
- netbsd/amd64
- netbsd/386
- linux/arm
- linux/arm64
- netbsd/arm
# Temporarily deactivated as this does not currently build with promu.
#- linux/mips64
#- linux/mips64le
- linux
- openbsd/amd64
23 changes: 23 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
extends: default

rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
commas: disable
comments: disable
comments-indentation: disable
document-start: disable
indentation:
spaces: consistent
indent-sequences: consistent
key-duplicates:
ignore: |
config/testdata/section_key_dup.bad.yml
line-length: disable
truthy:
check-keys: false
Loading

0 comments on commit 89cd49a

Please sign in to comment.