Compare commits

...

6 commits

Author SHA1 Message Date
Ben Kochie f1e0e8360a
Release v1.8.2 (#3055)
* fix pressure metric collection fails on systems that do not expose a full CPU stat #3051 (#3054)

Signed-off-by: joey <zchengjoey@gmail.com>
Signed-off-by: Ben Kochie <superq@gmail.com>

* Release v1.8.2

* [BUGFIX] Fix CPU pressure metric collection #3054

Signed-off-by: Ben Kochie <superq@gmail.com>

---------

Signed-off-by: joey <zchengjoey@gmail.com>
Signed-off-by: Ben Kochie <superq@gmail.com>
Co-authored-by: chengjoey <30427474+chengjoey@users.noreply.github.com>
2024-07-14 13:52:11 +02:00
Ben Kochie 400c397993 Release v1.8.1 (#3018)
* [BUGFIX] Fix CPU seconds on Solaris #2963
* [BUGFIX] Sign Darwin/MacOS binaries #3008
* [BUGFIX] Fix pressure collector nil reference #3016

Signed-off-by: Ben Kochie <superq@gmail.com>
2024-05-21 20:34:32 +02:00
Ben Kochie 31e0145786 Fix pressure collector nil reference (#3016)
Check that the PSI metrics are returned in order to avoid nil pointer
dereference.
* Update fixutre to match real-world samples.

Fixes: https://github.com/prometheus/node_exporter/issues/3015

Signed-off-by: Ben Kochie <superq@gmail.com>
2024-05-21 20:34:32 +02:00
Pranshu Srivastava e824cde4e8 collector/cpu: s/cpu_ticks*/cpu_nsec* for solaris (#2963)
Replace all cpu_ticks_* with cpu_nsec_*, since the former was off my a
magnitude of 10e6, and showed incorrect values for
node_cpu_seconds_total.

Fixes: #1837

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2024-05-21 20:34:32 +02:00
Alper Polat 2d4cb7a630 Sign node exporter darwin binary with rcodesign (#3008)
* Sign node exporter darwin binary with rcodesign

Prevents SIGKILL issues on macs

Signed-off-by: Alper Polat <gitperr@gmail.com>

* Be explicit about checking for the binary

Co-authored-by: Ben Kochie <superq@gmail.com>
Signed-off-by: Alper Polat <101826653+gitperr@users.noreply.github.com>

* Also attempt to sign darwin-amd64

Signed-off-by: Alper Polat <gitperr@gmail.com>

---------

Signed-off-by: Alper Polat <gitperr@gmail.com>
Signed-off-by: Alper Polat <101826653+gitperr@users.noreply.github.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
2024-05-21 20:34:32 +02:00
PrometheusBot b663d9de65 Update common Prometheus files (#3009)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2024-05-21 20:34:32 +02:00
9 changed files with 39 additions and 10 deletions

View file

@ -49,6 +49,16 @@ jobs:
- run: docker run --privileged linuxkit/binfmt:af88a591f9cc896a52ce596b9cf7ca26a061ef97 - run: docker run --privileged linuxkit/binfmt:af88a591f9cc896a52ce596b9cf7ca26a061ef97
- run: promu crossbuild -v --parallelism $CIRCLE_NODE_TOTAL --parallelism-thread $CIRCLE_NODE_INDEX - 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 - run: promu --config .promu-cgo.yml crossbuild -v --parallelism $CIRCLE_NODE_TOTAL --parallelism-thread $CIRCLE_NODE_INDEX
# sign the darwin build so it doesn't get SIGKILLed on start, see: https://github.com/prometheus/node_exporter/issues/2539
- run:
command: |
if [[ -f "$(pwd)/.build/darwin-arm64/node_exporter" ]]; then
promu codesign "$(pwd)/.build/darwin-arm64/node_exporter"
fi
if [[ -f "$(pwd)/.build/darwin-amd64/node_exporter" ]]; then
promu codesign "$(pwd)/.build/darwin-amd64/node_exporter"
fi
- persist_to_workspace: - persist_to_workspace:
root: . root: .
paths: paths:

View file

@ -17,7 +17,7 @@ jobs:
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks. if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
steps: steps:
- name: git checkout - name: git checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Set docker hub repo name - name: Set docker hub repo name
run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV
- name: Push README to Dockerhub - name: Push README to Dockerhub
@ -37,7 +37,7 @@ jobs:
if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks. if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks.
steps: steps:
- name: git checkout - name: git checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Set quay.io org name - name: Set quay.io org name
run: echo "DOCKER_REPO=$(echo quay.io/${GITHUB_REPOSITORY_OWNER} | tr -d '-')" >> $GITHUB_ENV run: echo "DOCKER_REPO=$(echo quay.io/${GITHUB_REPOSITORY_OWNER} | tr -d '-')" >> $GITHUB_ENV
- name: Set quay.io repo name - name: Set quay.io repo name

View file

@ -33,6 +33,6 @@ jobs:
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
if: github.repository == 'prometheus/snmp_exporter' if: github.repository == 'prometheus/snmp_exporter'
- name: Lint - name: Lint
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0 uses: golangci/golangci-lint-action@9d1e0624a798bb64f6c3cea93db47765312263dc # v5.1.0
with: with:
version: v1.56.2 version: v1.56.2

View file

@ -5,6 +5,16 @@
* [ENHANCEMENT] * [ENHANCEMENT]
* [BUGFIX] * [BUGFIX]
## 1.8.2 / 2024-06-19
* [BUGFIX] Fix CPU pressure metric collection #3054
## 1.8.1 / 2024-05-16
* [BUGFIX] Fix CPU seconds on Solaris #2963
* [BUGFIX] Sign Darwin/MacOS binaries #3008
* [BUGFIX] Fix pressure collector nil reference #3016
## 1.8.0 / 2024-04-24 ## 1.8.0 / 2024-04-24
* [CHANGE] exec_bsd: Fix labels for `vm.stats.sys.v_syscall` sysctl #2895 * [CHANGE] exec_bsd: Fix labels for `vm.stats.sys.v_syscall` sysctl #2895

View file

@ -55,7 +55,7 @@ ifneq ($(shell command -v gotestsum 2> /dev/null),)
endif endif
endif endif
PROMU_VERSION ?= 0.15.0 PROMU_VERSION ?= 0.17.0
PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz
SKIP_GOLANGCI_LINT := SKIP_GOLANGCI_LINT :=

View file

@ -1 +1 @@
1.8.0 1.8.2

View file

@ -60,17 +60,17 @@ func (c *cpuCollector) Update(ch chan<- prometheus.Metric) error {
} }
for k, v := range map[string]string{ for k, v := range map[string]string{
"idle": "cpu_ticks_idle", "idle": "cpu_nsec_idle",
"kernel": "cpu_ticks_kernel", "kernel": "cpu_nsec_kernel",
"user": "cpu_ticks_user", "user": "cpu_nsec_user",
"wait": "cpu_ticks_wait", "wait": "cpu_nsec_wait",
} { } {
kstatValue, err := ksCPU.GetNamed(v) kstatValue, err := ksCPU.GetNamed(v)
if err != nil { if err != nil {
return err return err
} }
ch <- c.cpu.mustNewConstMetric(float64(kstatValue.UintVal), strconv.Itoa(cpu), k) ch <- c.cpu.mustNewConstMetric(float64(kstatValue.UintVal)/1e9, strconv.Itoa(cpu), k)
} }
} }
return nil return nil

View file

@ -1 +1,2 @@
some avg10=0.00 avg60=0.00 avg300=0.00 total=14036781 some avg10=0.00 avg60=0.00 avg300=0.00 total=14036781
full avg10=0.00 avg60=0.00 avg300=0.00 total=0

View file

@ -102,6 +102,14 @@ func (c *pressureStatsCollector) Update(ch chan<- prometheus.Metric) error {
} }
return fmt.Errorf("failed to retrieve pressure stats: %w", err) return fmt.Errorf("failed to retrieve pressure stats: %w", err)
} }
if vals.Some == nil {
level.Debug(c.logger).Log("msg", "pressure information returned no 'some' data")
return ErrNoData
}
if vals.Full == nil && res != "cpu" {
level.Debug(c.logger).Log("msg", "pressure information returned no 'full' data")
return ErrNoData
}
switch res { switch res {
case "cpu": case "cpu":
ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, float64(vals.Some.Total)/1000.0/1000.0) ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, float64(vals.Some.Total)/1000.0/1000.0)