Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove openbsd amd64 cgo dependecies #1774

Merged
merged 6 commits into from
Dec 14, 2020
Merged

Conversation

ston1th
Copy link
Contributor

@ston1th ston1th commented Jul 2, 2020

I have rewritten all CGO dependencies for OpenBSD amd64
using pure go, be able to crosscompile node_exporter.

Signed-off-by: ston1th ston1th@giftfish.de

@ston1th ston1th force-pushed the openbsd_amd64 branch 2 times, most recently from ed2c6a8 to 6470c58 Compare July 2, 2020 10:43
@SuperQ
Copy link
Member

SuperQ commented Jul 31, 2020

Thanks for working on this.

The build is failing on this:

 >   node_exporter
# github.com/prometheus/node_exporter/collector
collector/interrupts_openbsd_amd64.go:109:26: cannot use itr (type interrupt) as type interrupt in assignment
collector/interrupts_openbsd.go:98:2: interruptLabelNames redeclared in this block
        previous declaration at collector/interrupts_openbsd_amd64.go:71:2
collector/interrupts_openbsd.go:101:31: (*interruptsCollector).Update redeclared in this block
        previous declaration at collector/interrupts_openbsd_amd64.go:74:6
collector/interrupts_openbsd.go:119:6: interrupt redeclared in this block
        previous declaration at collector/interrupts_openbsd_amd64.go:92:6
collector/interrupts_openbsd.go:125:6: getInterrupts redeclared in this block
        previous declaration at collector/interrupts_openbsd_amd64.go:98:45
collector/meminfo_openbsd.go:55:28: (*meminfoCollector).getMemInfo redeclared in this block
        previous declaration at collector/meminfo_openbsd_amd64.go:23:6
collector/netdev_openbsd.go:35:6: getNetDevStats redeclared in this block
        previous declaration at collector/netdev_openbsd_amd64.go:28:117
!! command failed: build -o /home/peon/.buildkite-agent/builds/openbsd-6-3-amd64-build-prometheus-io-1/prometheus/node-exporter-6470c58fd8ce2b1e43cf9f5ef49b48f136ad7209-2849-AlfBQuWB/src/github.com/prometheus/node_exporter/node_exporter -ldflags -X github.com/prometheus/common/version.Version=1.0.1 -X github.com/prometheus/common/version.Revision=non-git -X github.com/prometheus/common/version.Branch=non-git -X github.com/prometheus/common/version.BuildUser=peon@openbsd-6-3-amd64.build.prometheus.io -X github.com/prometheus/common/version.BuildDate=20200702-10:43:43  -extldflags '-static' -mod=vendor -a -tags 'netgostatic_build' github.com/prometheus/node_exporter: exit status 2

Copy link
Member

@discordianfish discordianfish left a comment

Choose a reason for hiding this comment

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

I don't have any real openbsd experience and I'm a bit worried about more code without tests..
But LGTM in general. We might want to look for additional maintainers of the *bsd bits eventually.

collector/cpu_openbsd_amd64.go Outdated Show resolved Hide resolved
@ston1th
Copy link
Contributor Author

ston1th commented Sep 2, 2020

Currently I have this version running on my servers (OpenBSD 6.7 amd64) and things look fine.
I tested the overall correctness of the metrics by using the packaged node_exporter from the OpenBSD ports tree and comparing it to this version.

All metrics looked the same except some .0x differences on cpu, network and memory metrics.

@ston1th
Copy link
Contributor Author

ston1th commented Sep 2, 2020

@SuperQ @discordianfish do not merge yet.

I just found occasional spikes in the node_memory_wired_bytes metric which should not happen. I need to look into this.

Edit: nevermind - I missunderstood this metric and this happens in both versions of node_exporter (this and from the ports tree).

@SuperQ
Copy link
Member

SuperQ commented Sep 23, 2020

CC @mischief

I have rewritten all CGO dependencies for OpenBSD amd64
using pure go, be able to crosscompile node_exporter.

Signed-off-by: ston1th <ston1th@giftfish.de>
Signed-off-by: ston1th <ston1th@giftfish.de>
Signed-off-by: ston1th <ston1th@giftfish.de>
Signed-off-by: ston1th <ston1th@giftfish.de>
Signed-off-by: ston1th <ston1th@giftfish.de>
new type: `netDevStats map[string]map[string]uint64`

Signed-off-by: ston1th <ston1th@giftfish.de>
@discordianfish
Copy link
Member

We really need a maintainer for all the BSD stuff.. @SuperQ you still willing to approve? It's been open for a while now :-/

@SuperQ
Copy link
Member

SuperQ commented Dec 14, 2020

Yea, sorry, I got behind on my review, cleanup.

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, Thanks.

@SuperQ SuperQ merged commit 3b8a7f6 into prometheus:master Dec 14, 2020
@SuperQ SuperQ mentioned this pull request Feb 5, 2021
SuperQ added a commit that referenced this pull request Feb 5, 2021
* Update Build
  - Update CircleCI orb.
  - Update CIrcleCI Machine image.
  - Use golang-builder 1.15.
* Update Go modules.
* Fixup fixtures for XFS bug.

Changes:
* [CHANGE] Improve filter flag names. #1743
* [CHANGE] Add btrfs and powersupplyclass to list of exporters enabled by default #1897
* [FEATURE] Add fibre channel collector #1786
* [FEATURE] Expose cpu bugs and flags as info metrics. #1788
* [FEATURE] Add network_route collector #1811
* [FEATURE] Add zoneinfo collector #1922
* [ENHANCEMENT] Add more InfiniBand counters #1694
* [ENHANCEMENT] Add flag to aggr ipvs metrics to avoid high cardinality metrics #1709
* [ENHANCEMENT] Adding backlog/current queue length to qdisc collector #1732
* [ENHANCEMENT] Include TCP OutRsts in netstat metrics #1733
* [ENHANCEMENT] Add pool size to entropy collector #1753
* [ENHANCEMENT] Remove CGO dependencies for OpenBSD amd64 #1774
* [ENHANCEMENT] bcache: add writeback_rate_debug stats #1658
* [ENHANCEMENT] Add check state for mdadm arrays via node_md_state metric #1810
* [ENHANCEMENT] Expose XFS inode statistics #1870
* [ENHANCEMENT] Expose zfs zpool state #1878
* [ENHANCEMENT] Added an ability to pass collector.supervisord.url via SUPERVISORD_URL environment variable #1947
* [BUGFIX] filesystem_freebsd: Fix label values #1728
* [BUGFIX] Fix various procfs parsing errors #1735
* [BUGFIX] Handle no data from powersupplyclass #1747
* [BUGFIX] udp_queues_linux.go: s/upd/udp/ in two error strings #1769
* [BUGFIX] Fix node_scrape_collector_success behaviour #1816
* [BUGFIX] Fix NodeRAIDDegraded to not use a string rule expressions #1827
* [BUGFIX] fix: node_md_disks state label from fail to failed #1862
* [BUGFIX] Handle EPERM for syscall in timex collector #1938
* [BUGFIX] bcache: fix typo #1943
* [BUGFIX] Fix XFS read/write stats (prometheus/procfs#343)

Signed-off-by: Ben Kochie <superq@gmail.com>
SuperQ added a commit that referenced this pull request Feb 5, 2021
* Update Build
  - Update CircleCI orb.
  - Update CIrcleCI Machine image.
  - Use golang-builder 1.15.
* Update Go modules.
* Fixup fixtures for XFS bug.

NOTE: We have improved some of the flag naming conventions (PR #1743). The old names are
      deprecated and will be removed in 2.0. They will continue to work for backwards
      compatibility.

* [CHANGE] Improve filter flag names #1743
* [CHANGE] Add btrfs and powersupplyclass to list of exporters enabled by default #1897
* [FEATURE] Add fibre channel collector #1786
* [FEATURE] Expose cpu bugs and flags as info metrics. #1788
* [FEATURE] Add network_route collector #1811
* [FEATURE] Add zoneinfo collector #1922
* [ENHANCEMENT] Add more InfiniBand counters #1694
* [ENHANCEMENT] Add flag to aggr ipvs metrics to avoid high cardinality metrics #1709
* [ENHANCEMENT] Adding backlog/current queue length to qdisc collector #1732
* [ENHANCEMENT] Include TCP OutRsts in netstat metrics #1733
* [ENHANCEMENT] Add pool size to entropy collector #1753
* [ENHANCEMENT] Remove CGO dependencies for OpenBSD amd64 #1774
* [ENHANCEMENT] bcache: add writeback_rate_debug stats #1658
* [ENHANCEMENT] Add check state for mdadm arrays via node_md_state metric #1810
* [ENHANCEMENT] Expose XFS inode statistics #1870
* [ENHANCEMENT] Expose zfs zpool state #1878
* [ENHANCEMENT] Added an ability to pass collector.supervisord.url via SUPERVISORD_URL environment variable #1947
* [BUGFIX] filesystem_freebsd: Fix label values #1728
* [BUGFIX] Fix various procfs parsing errors #1735
* [BUGFIX] Handle no data from powersupplyclass #1747
* [BUGFIX] udp_queues_linux.go: change upd to udp in two error strings #1769
* [BUGFIX] Fix node_scrape_collector_success behaviour #1816
* [BUGFIX] Fix NodeRAIDDegraded to not use a string rule expressions #1827
* [BUGFIX] Fix node_md_disks state label from fail to failed #1862
* [BUGFIX] Handle EPERM for syscall in timex collector #1938
* [BUGFIX] bcache: fix typo in a metric name #1943
* [BUGFIX] Fix XFS read/write stats (prometheus/procfs#343)

Signed-off-by: Ben Kochie <superq@gmail.com>
@ston1th ston1th deleted the openbsd_amd64 branch February 27, 2021 22:34
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
* Update Build
  - Update CircleCI orb.
  - Update CIrcleCI Machine image.
  - Use golang-builder 1.15.
* Update Go modules.
* Fixup fixtures for XFS bug.

NOTE: We have improved some of the flag naming conventions (PR prometheus#1743). The old names are
      deprecated and will be removed in 2.0. They will continue to work for backwards
      compatibility.

* [CHANGE] Improve filter flag names prometheus#1743
* [CHANGE] Add btrfs and powersupplyclass to list of exporters enabled by default prometheus#1897
* [FEATURE] Add fibre channel collector prometheus#1786
* [FEATURE] Expose cpu bugs and flags as info metrics. prometheus#1788
* [FEATURE] Add network_route collector prometheus#1811
* [FEATURE] Add zoneinfo collector prometheus#1922
* [ENHANCEMENT] Add more InfiniBand counters prometheus#1694
* [ENHANCEMENT] Add flag to aggr ipvs metrics to avoid high cardinality metrics prometheus#1709
* [ENHANCEMENT] Adding backlog/current queue length to qdisc collector prometheus#1732
* [ENHANCEMENT] Include TCP OutRsts in netstat metrics prometheus#1733
* [ENHANCEMENT] Add pool size to entropy collector prometheus#1753
* [ENHANCEMENT] Remove CGO dependencies for OpenBSD amd64 prometheus#1774
* [ENHANCEMENT] bcache: add writeback_rate_debug stats prometheus#1658
* [ENHANCEMENT] Add check state for mdadm arrays via node_md_state metric prometheus#1810
* [ENHANCEMENT] Expose XFS inode statistics prometheus#1870
* [ENHANCEMENT] Expose zfs zpool state prometheus#1878
* [ENHANCEMENT] Added an ability to pass collector.supervisord.url via SUPERVISORD_URL environment variable prometheus#1947
* [BUGFIX] filesystem_freebsd: Fix label values prometheus#1728
* [BUGFIX] Fix various procfs parsing errors prometheus#1735
* [BUGFIX] Handle no data from powersupplyclass prometheus#1747
* [BUGFIX] udp_queues_linux.go: change upd to udp in two error strings prometheus#1769
* [BUGFIX] Fix node_scrape_collector_success behaviour prometheus#1816
* [BUGFIX] Fix NodeRAIDDegraded to not use a string rule expressions prometheus#1827
* [BUGFIX] Fix node_md_disks state label from fail to failed prometheus#1862
* [BUGFIX] Handle EPERM for syscall in timex collector prometheus#1938
* [BUGFIX] bcache: fix typo in a metric name prometheus#1943
* [BUGFIX] Fix XFS read/write stats (prometheus/procfs#343)

Signed-off-by: Ben Kochie <superq@gmail.com>
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
* Update Build
  - Update CircleCI orb.
  - Update CIrcleCI Machine image.
  - Use golang-builder 1.15.
* Update Go modules.
* Fixup fixtures for XFS bug.

NOTE: We have improved some of the flag naming conventions (PR prometheus#1743). The old names are
      deprecated and will be removed in 2.0. They will continue to work for backwards
      compatibility.

* [CHANGE] Improve filter flag names prometheus#1743
* [CHANGE] Add btrfs and powersupplyclass to list of exporters enabled by default prometheus#1897
* [FEATURE] Add fibre channel collector prometheus#1786
* [FEATURE] Expose cpu bugs and flags as info metrics. prometheus#1788
* [FEATURE] Add network_route collector prometheus#1811
* [FEATURE] Add zoneinfo collector prometheus#1922
* [ENHANCEMENT] Add more InfiniBand counters prometheus#1694
* [ENHANCEMENT] Add flag to aggr ipvs metrics to avoid high cardinality metrics prometheus#1709
* [ENHANCEMENT] Adding backlog/current queue length to qdisc collector prometheus#1732
* [ENHANCEMENT] Include TCP OutRsts in netstat metrics prometheus#1733
* [ENHANCEMENT] Add pool size to entropy collector prometheus#1753
* [ENHANCEMENT] Remove CGO dependencies for OpenBSD amd64 prometheus#1774
* [ENHANCEMENT] bcache: add writeback_rate_debug stats prometheus#1658
* [ENHANCEMENT] Add check state for mdadm arrays via node_md_state metric prometheus#1810
* [ENHANCEMENT] Expose XFS inode statistics prometheus#1870
* [ENHANCEMENT] Expose zfs zpool state prometheus#1878
* [ENHANCEMENT] Added an ability to pass collector.supervisord.url via SUPERVISORD_URL environment variable prometheus#1947
* [BUGFIX] filesystem_freebsd: Fix label values prometheus#1728
* [BUGFIX] Fix various procfs parsing errors prometheus#1735
* [BUGFIX] Handle no data from powersupplyclass prometheus#1747
* [BUGFIX] udp_queues_linux.go: change upd to udp in two error strings prometheus#1769
* [BUGFIX] Fix node_scrape_collector_success behaviour prometheus#1816
* [BUGFIX] Fix NodeRAIDDegraded to not use a string rule expressions prometheus#1827
* [BUGFIX] Fix node_md_disks state label from fail to failed prometheus#1862
* [BUGFIX] Handle EPERM for syscall in timex collector prometheus#1938
* [BUGFIX] bcache: fix typo in a metric name prometheus#1943
* [BUGFIX] Fix XFS read/write stats (prometheus/procfs#343)

Signed-off-by: Ben Kochie <superq@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.

3 participants