Skip to content

Check BSD's mib which accounts for swap size#1149

Merged
discordianfish merged 5 commits intoprometheus:masterfrom
iori-yja:fix-swap-memory-bsd
Nov 17, 2018
Merged

Check BSD's mib which accounts for swap size#1149
discordianfish merged 5 commits intoprometheus:masterfrom
iori-yja:fix-swap-memory-bsd

Conversation

@iori-yja
Copy link
Contributor

@iori-yja iori-yja commented Nov 9, 2018

Discussion was here:
#1127

iori-yja and others added 3 commits November 2, 2018 18:32
Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if vm.swap_size is not correct either? what about other BSDs?

would it make sense to check for the specific kind of error that switching to _size can fix (not found, I suppose?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this collector only supports Dragonfly and FreeBSD. They are relatively similar to each other comparing to other BSD variants, and in this case, that mib is the only difference. If there is _total, implicitly it is supposed to be FreeBSD otherwise Dragonfly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, meminfo for OpenBSD is supported by another code. https://github.com/prometheus/node_exporter/blob/master/collector/meminfo_openbsd.go

@discordianfish
Copy link
Member

Hrmm buildkite fails on freebsd with:

 >   node_exporter
# github.com/prometheus/node_exporter/collector
collector/boot_time_bsd.go:23:41: undefined: bsdSysctl

Doesn't look related to this PR though. Can you try rebasing, maybe this was broken in master?

Signed-off-by: iori-yja <fivo.11235813@gmail.com>
Signed-off-by: iori-yja <fivo.11235813@gmail.com>
@iori-yja iori-yja force-pushed the fix-swap-memory-bsd branch from adca1a0 to d6e61df Compare November 16, 2018 06:11
@iori-yja
Copy link
Contributor Author

Hrmm buildkite fails on freebsd with:

 >   node_exporter
# github.com/prometheus/node_exporter/collector
collector/boot_time_bsd.go:23:41: undefined: bsdSysctl

Doesn't look related to this PR though. Can you try rebasing, maybe this was broken in master?

This is weird... but anyway I've rebased to current origin/master just now.

@discordianfish
Copy link
Member

Nice, that fixed it. LGTM!

@discordianfish discordianfish merged commit 17fee80 into prometheus:master Nov 17, 2018
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
* Change Dfly's CPU counting frequency, see: prometheus#1129

Signed-off-by: iori-yja <fivio.11235813@gmail.com>

* Convert Dfly's CPU unit into second

Signed-off-by: iori-yja <fivio.11235813@gmail.com>

* Check BSD's mib which accounts for swap size; see prometheus#1127

Signed-off-by: iori-yja <fivo.11235813@gmail.com>

* fix swap check code

Signed-off-by: iori-yja <fivo.11235813@gmail.com>
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
* Change Dfly's CPU counting frequency, see: prometheus#1129

Signed-off-by: iori-yja <fivio.11235813@gmail.com>

* Convert Dfly's CPU unit into second

Signed-off-by: iori-yja <fivio.11235813@gmail.com>

* Check BSD's mib which accounts for swap size; see prometheus#1127

Signed-off-by: iori-yja <fivo.11235813@gmail.com>

* fix swap check code

Signed-off-by: iori-yja <fivo.11235813@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants