mirror of
https://github.com/prometheus/node_exporter.git
synced 2025-08-20 18:33:52 -07:00
Compare commits
6 commits
Author | SHA1 | Date | |
---|---|---|---|
|
f1e0e8360a | ||
|
400c397993 | ||
|
31e0145786 | ||
|
e824cde4e8 | ||
|
2d4cb7a630 | ||
|
b663d9de65 |
|
@ -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:
|
||||||
|
|
4
.github/workflows/container_description.yml
vendored
4
.github/workflows/container_description.yml
vendored
|
@ -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
|
||||||
|
|
2
.github/workflows/golangci-lint.yml
vendored
2
.github/workflows/golangci-lint.yml
vendored
|
@ -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
|
||||||
|
|
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -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
|
||||||
|
|
|
@ -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 :=
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue