Hi ports@, This is an update for sysutils/node_exporter to its latest version 1.0.1 You can see the changelog here:
https://github.com/prometheus/node_exporter/blob/master/CHANGELOG.md I'm not sure if we should put the breaking changes announced on the changelog on www/faq/current.html (or at least a note telling users to look at the changelog). Guidance on this is appreciated. I removed the patches for collector/uname.go and collector/uname_openbsd.go as this PR, which comes with this new version, seems to cover them: https://github.com/prometheus/node_exporter/pull/1433 Tests pass for me on amd64 (they were failing before as it was trying to download stuff), and this port has no consumers. I've compared the output of a call to localhost:9100/metrics from the previous version and this one and I don't see major differences. More testing by node_exporter users appreciated. cc maintainer. Comments ? ok to commit ? diff d92a11f7fb6bc079232b6e99823bddfc01d1bc18 /usr/ports blob - 7e1e4c8558188d9e93dd9baeeb9bfe7b8c9d3fc4 file + sysutils/node_exporter/Makefile --- sysutils/node_exporter/Makefile +++ sysutils/node_exporter/Makefile @@ -7,7 +7,7 @@ COMMENT = prometheus exporter for hardware and OS met GH_ACCOUNT = prometheus GH_PROJECT = node_exporter -GH_TAGNAME = v0.18.1 +GH_TAGNAME = v1.0.1 CATEGORIES = sysutils blob - b61c0f2bc697309bc9fdc031aee6506d52433baa file + sysutils/node_exporter/distinfo --- sysutils/node_exporter/distinfo +++ sysutils/node_exporter/distinfo @@ -1,2 +1,2 @@ -SHA256 (node_exporter-0.18.1.tar.gz) = nd8YfEYvJoGrRRZBCtoObw8DCX22mGaGeVVZ6nGgdpQ= -SIZE (node_exporter-0.18.1.tar.gz) = 2110072 +SHA256 (node_exporter-1.0.1.tar.gz) = qEG/PiNjdoQL6eHY5sSjgZa+bzlXsJgtHHlwpeQWsK0= +SIZE (node_exporter-1.0.1.tar.gz) = 2792033 blob - 096c1a0feea8c217c9968da58ad4e95ab991be9b file + /dev/null --- sysutils/node_exporter/patches/patch-collector_uname_go +++ sysutils/node_exporter/patches/patch-collector_uname_go @@ -1,14 +0,0 @@ -$OpenBSD: patch-collector_uname_go,v 1.1 2019/10/16 06:50:09 claudio Exp $ - -Index: collector/uname.go ---- collector/uname.go.orig -+++ collector/uname.go -@@ -11,7 +11,7 @@ - // See the License for the specific language governing permissions and - // limitations under the License. - --// +build freebsd linux -+// +build freebsd linux openbsd - // +build !nouname - - package collector blob - f5c564f95be42246fae7d1e8630b16afc0850a60 file + /dev/null --- sysutils/node_exporter/patches/patch-collector_uname_openbsd_go +++ sysutils/node_exporter/patches/patch-collector_uname_openbsd_go @@ -1,63 +0,0 @@ -$OpenBSD: patch-collector_uname_openbsd_go,v 1.1 2019/10/16 06:50:09 claudio Exp $ - -Index: collector/uname_openbsd.go ---- collector/uname_openbsd.go.orig -+++ collector/uname_openbsd.go -@@ -0,0 +1,57 @@ -+// Copyright 2019 The Prometheus Authors -+// Licensed under the Apache License, Version 2.0 (the "License"); -+// you may not use this file except in compliance with the License. -+// You may obtain a copy of the License at -+// -+// http://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, -+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+// See the License for the specific language governing permissions and -+// limitations under the License. -+ -+// +build !nouname -+ -+package collector -+ -+import ( -+ "bytes" -+ "strings" -+ -+ "golang.org/x/sys/unix" -+) -+ -+func getUname() (uname, error) { -+ var utsname unix.Utsname -+ if err := unix.Uname(&utsname); err != nil { -+ return uname{}, err -+ } -+ -+ // We do a little bit of work here to emulate what happens in the Linux -+ // uname calls since FreeBSD uname doesn't have a Domainname. -+ nodename := string(utsname.Nodename[:bytes.IndexByte(utsname.Nodename[:], 0)]) -+ split := strings.SplitN(nodename, ".", 2) -+ -+ // We'll always have at least a single element in the array. We assume this -+ // is the hostname. -+ hostname := split[0] -+ -+ // If we have more than one element, we assume this is the domainname. -+ // Otherwise leave it to "(none)" like Linux. -+ domainname := "(none)" -+ if len(split) > 1 { -+ domainname = split[1] -+ } -+ -+ output := uname{ -+ SysName: string(utsname.Sysname[:bytes.IndexByte(utsname.Sysname[:], 0)]), -+ Release: string(utsname.Release[:bytes.IndexByte(utsname.Release[:], 0)]), -+ Version: string(utsname.Version[:bytes.IndexByte(utsname.Version[:], 0)]), -+ Machine: string(utsname.Machine[:bytes.IndexByte(utsname.Machine[:], 0)]), -+ NodeName: hostname, -+ DomainName: domainname, -+ } -+ -+ return output, nil -+} -- Paco Esteban. 0x5818130B8A6DBC03
