Browse Source

Add ErrorLog plumbing to promhttp

Fix the error logging of the promhttp handler by connecting it to the
promlog setup.
* Switch to go-kit/log.
* Cleanup CHANGELOG.

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

Signed-off-by: Ben Kochie <superq@gmail.com>
pull/1887/head
Ben Kochie 4 years ago
parent
commit
3bc9a93c20
No known key found for this signature in database
GPG Key ID: C646B23C9E3245F1
  1. 7
      CHANGELOG.md
  2. 2
      collector/arp_linux.go
  3. 2
      collector/bcache_linux.go
  4. 4
      collector/bonding_linux.go
  5. 2
      collector/boot_time_bsd.go
  6. 2
      collector/boot_time_openbsd_amd64.go
  7. 2
      collector/boot_time_solaris.go
  8. 2
      collector/btrfs_linux.go
  9. 4
      collector/buddyinfo.go
  10. 4
      collector/collector.go
  11. 4
      collector/conntrack_linux.go
  12. 2
      collector/cpu_darwin.go
  13. 2
      collector/cpu_dragonfly.go
  14. 4
      collector/cpu_freebsd.go
  15. 4
      collector/cpu_linux.go
  16. 2
      collector/cpu_openbsd.go
  17. 2
      collector/cpu_openbsd_amd64.go
  18. 2
      collector/cpu_solaris.go
  19. 2
      collector/cpufreq_linux.go
  20. 2
      collector/cpufreq_solaris.go
  21. 2
      collector/devstat_dragonfly.go
  22. 2
      collector/devstat_freebsd.go
  23. 2
      collector/diskstats_darwin.go
  24. 4
      collector/diskstats_linux.go
  25. 2
      collector/diskstats_openbsd.go
  26. 2
      collector/diskstats_openbsd_amd64.go
  27. 4
      collector/drbd_linux.go
  28. 2
      collector/edac_linux.go
  29. 2
      collector/entropy_linux.go
  30. 2
      collector/exec_bsd.go
  31. 4
      collector/fibrechannel_linux.go
  32. 2
      collector/filefd_linux.go
  33. 2
      collector/filesystem_bsd.go
  34. 4
      collector/filesystem_common.go
  35. 2
      collector/filesystem_freebsd.go
  36. 4
      collector/filesystem_linux.go
  37. 2
      collector/filesystem_linux_test.go
  38. 2
      collector/filesystem_openbsd_amd64.go
  39. 4
      collector/hwmon_linux.go
  40. 4
      collector/infiniband_linux.go
  41. 2
      collector/interrupts_common.go
  42. 4
      collector/ipvs_linux.go
  43. 2
      collector/ipvs_linux_test.go
  44. 2
      collector/ksmd_linux.go
  45. 4
      collector/loadavg.go
  46. 2
      collector/logind_linux.go
  47. 4
      collector/mdadm_linux.go
  48. 4
      collector/meminfo.go
  49. 2
      collector/meminfo_numa_linux.go
  50. 2
      collector/memory_bsd.go
  51. 4
      collector/mountstats_linux.go
  52. 4
      collector/netclass_linux.go
  53. 4
      collector/netdev_bsd.go
  54. 4
      collector/netdev_common.go
  55. 4
      collector/netdev_darwin.go
  56. 4
      collector/netdev_linux.go
  57. 2
      collector/netdev_linux_test.go
  58. 4
      collector/netdev_openbsd.go
  59. 4
      collector/netdev_openbsd_amd64.go
  60. 2
      collector/netstat_linux.go
  61. 2
      collector/network_route_linux.go
  62. 4
      collector/nfs_linux.go
  63. 4
      collector/nfsd_linux.go
  64. 2
      collector/ntp.go
  65. 4
      collector/perf_linux.go
  66. 2
      collector/perf_linux_test.go
  67. 2
      collector/powersupplyclass.go
  68. 4
      collector/pressure_linux.go
  69. 4
      collector/processes_linux.go
  70. 2
      collector/processes_linux_test.go
  71. 2
      collector/qdisc_linux.go
  72. 4
      collector/rapl_linux.go
  73. 4
      collector/runit.go
  74. 4
      collector/schedstat_linux.go
  75. 4
      collector/sockstat_linux.go
  76. 2
      collector/softnet_linux.go
  77. 2
      collector/stat_linux.go
  78. 4
      collector/supervisord.go
  79. 4
      collector/systemd_linux.go
  80. 2
      collector/systemd_linux_test.go
  81. 2
      collector/tcpstat_linux.go
  82. 4
      collector/textfile.go
  83. 2
      collector/textfile_test.go
  84. 2
      collector/thermal_zone_linux.go
  85. 4
      collector/time.go
  86. 4
      collector/timex.go
  87. 4
      collector/udp_queues_linux.go
  88. 2
      collector/uname.go
  89. 2
      collector/vmstat_linux.go
  90. 4
      collector/wifi_linux.go
  91. 2
      collector/xfs_linux.go
  92. 4
      collector/zfs.go
  93. 2
      collector/zfs_freebsd.go
  94. 2
      collector/zfs_linux.go
  95. 2
      collector/zfs_solaris.go
  96. 2
      collector/zoneinfo_linux.go
  97. 4
      go.mod
  98. 7
      go.sum
  99. 6
      node_exporter.go
  100. 2
      scripts/errcheck_excludes.txt

7
CHANGELOG.md

@ -1,13 +1,16 @@
## master / unreleased
* [CHANGE] Rename flags `collector.filesystem.ignored-mount-points` and `collector.filesystem.ignored-fs-types` to match other collectors
* [CHANGE]
* [FEATURE]
* [ENHANCEMENT]
* [BUGFIX]
Note: Ignoring invalid network speed will be the default in 2.x
NOTE: Ignoring invalid network speed will be the default in 2.x
NOTE: Filesystem collector flags have been renamed. `--collector.filesystem.ignored-mount-points` is now `--collector.filesystem.mount-points-exclude` and `--collector.filesystem.ignored-fs-types` is now `--collector.filesystem.fs-types-exclude`. The old flags will be removed in 2.x.
* [CHANGE] Rename filesystem collector flags to match other collectors #2012
* [FEATURE] Add flag to ignore network speed if it is unknown #1989
* [BUGFIX] Add ErrorLog plumbing to promhttp #1887
## 1.1.2 / 2021-03-05

2
collector/arp_linux.go

@ -22,7 +22,7 @@ import (
"os"
"strings"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

2
collector/bcache_linux.go

@ -18,7 +18,7 @@ package collector
import (
"fmt"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs/bcache"
"gopkg.in/alecthomas/kingpin.v2"

4
collector/bonding_linux.go

@ -23,8 +23,8 @@ import (
"path/filepath"
"strings"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
)

2
collector/boot_time_bsd.go

@ -17,7 +17,7 @@
package collector
import (
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

2
collector/boot_time_openbsd_amd64.go

@ -16,7 +16,7 @@
package collector
import (
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/sys/unix"
"unsafe"

2
collector/boot_time_solaris.go

@ -17,7 +17,7 @@
package collector
import (
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/siebenmann/go-kstat"
)

2
collector/btrfs_linux.go

@ -18,7 +18,7 @@ package collector
import (
"fmt"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs/btrfs"
)

4
collector/buddyinfo.go

@ -20,8 +20,8 @@ import (
"fmt"
"strconv"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs"
)

4
collector/collector.go

@ -20,8 +20,8 @@ import (
"sync"
"time"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
kingpin "gopkg.in/alecthomas/kingpin.v2"
)

4
collector/conntrack_linux.go

@ -20,8 +20,8 @@ import (
"fmt"
"os"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
)

2
collector/cpu_darwin.go

@ -25,7 +25,7 @@ import (
"strconv"
"unsafe"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

2
collector/cpu_dragonfly.go

@ -20,7 +20,7 @@ import (
"strconv"
"unsafe"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

4
collector/cpu_freebsd.go

@ -21,8 +21,8 @@ import (
"strconv"
"unsafe"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/sys/unix"
)

4
collector/cpu_linux.go

@ -22,8 +22,8 @@ import (
"strconv"
"sync"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs"
"gopkg.in/alecthomas/kingpin.v2"

2
collector/cpu_openbsd.go

@ -20,7 +20,7 @@ import (
"strconv"
"unsafe"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/sys/unix"
)

2
collector/cpu_openbsd_amd64.go

@ -19,7 +19,7 @@ import (
"strconv"
"unsafe"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/sys/unix"
)

2
collector/cpu_solaris.go

@ -19,7 +19,7 @@ package collector
import (
"strconv"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
kstat "github.com/siebenmann/go-kstat"
)

2
collector/cpufreq_linux.go

@ -18,7 +18,7 @@ package collector
import (
"fmt"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs/sysfs"
)

2
collector/cpufreq_solaris.go

@ -20,7 +20,7 @@ import (
"fmt"
"strconv"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
kstat "github.com/siebenmann/go-kstat"
)

2
collector/devstat_dragonfly.go

@ -19,7 +19,7 @@ import (
"errors"
"fmt"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

2
collector/devstat_freebsd.go

@ -21,7 +21,7 @@ import (
"sync"
"unsafe"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

2
collector/diskstats_darwin.go

@ -18,7 +18,7 @@ package collector
import (
"fmt"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/lufia/iostat"
"github.com/prometheus/client_golang/prometheus"
)

4
collector/diskstats_linux.go

@ -24,8 +24,8 @@ import (
"strconv"
"strings"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"gopkg.in/alecthomas/kingpin.v2"
)

2
collector/diskstats_openbsd.go

@ -19,7 +19,7 @@ package collector
import (
"unsafe"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/sys/unix"
)

2
collector/diskstats_openbsd_amd64.go

@ -18,7 +18,7 @@ package collector
import (
"unsafe"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/sys/unix"
)

4
collector/drbd_linux.go

@ -23,8 +23,8 @@ import (
"strconv"
"strings"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
)

2
collector/edac_linux.go

@ -20,7 +20,7 @@ import (
"path/filepath"
"regexp"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

2
collector/entropy_linux.go

@ -18,7 +18,7 @@ package collector
import (
"fmt"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs"
)

2
collector/exec_bsd.go

@ -17,7 +17,7 @@
package collector
import (
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

4
collector/fibrechannel_linux.go

@ -20,8 +20,8 @@ import (
"fmt"
"os"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs/sysfs"
)

2
collector/filefd_linux.go

@ -22,7 +22,7 @@ import (
"os"
"strconv"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

2
collector/filesystem_bsd.go

@ -20,7 +20,7 @@ import (
"errors"
"unsafe"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log/level"
)
/*

4
collector/filesystem_common.go

@ -20,8 +20,8 @@ import (
"errors"
"regexp"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"gopkg.in/alecthomas/kingpin.v2"
)

2
collector/filesystem_freebsd.go

@ -16,7 +16,7 @@
package collector
import (
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log/level"
"golang.org/x/sys/unix"
)

4
collector/filesystem_linux.go

@ -25,8 +25,8 @@ import (
"sync"
"time"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"golang.org/x/sys/unix"
"gopkg.in/alecthomas/kingpin.v2"
)

2
collector/filesystem_linux_test.go

@ -14,7 +14,7 @@
package collector
import (
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"strings"
"testing"

2
collector/filesystem_openbsd_amd64.go

@ -17,7 +17,7 @@
package collector
import (
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log/level"
"golang.org/x/sys/unix"
)

4
collector/hwmon_linux.go

@ -24,8 +24,8 @@ import (
"strconv"
"strings"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/sys/unix"
)

4
collector/infiniband_linux.go

@ -22,8 +22,8 @@ import (
"os"
"strconv"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs/sysfs"
)

2
collector/interrupts_common.go

@ -17,7 +17,7 @@
package collector
import (
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

4
collector/ipvs_linux.go

@ -23,8 +23,8 @@ import (
"strconv"
"strings"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs"
kingpin "gopkg.in/alecthomas/kingpin.v2"

2
collector/ipvs_linux_test.go

@ -22,7 +22,7 @@ import (
"strings"
"testing"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"

2
collector/ksmd_linux.go

@ -19,7 +19,7 @@ import (
"fmt"
"path/filepath"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

4
collector/loadavg.go

@ -19,8 +19,8 @@ package collector
import (
"fmt"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
)

2
collector/logind_linux.go

@ -20,7 +20,7 @@ import (
"os"
"strconv"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/godbus/dbus"
"github.com/prometheus/client_golang/prometheus"
)

4
collector/mdadm_linux.go

@ -20,8 +20,8 @@ import (
"fmt"
"os"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs"
)

4
collector/meminfo.go

@ -20,8 +20,8 @@ import (
"fmt"
"strings"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
)

2
collector/meminfo_numa_linux.go

@ -25,7 +25,7 @@ import (
"strconv"
"strings"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

2
collector/memory_bsd.go

@ -19,7 +19,7 @@ package collector
import (
"fmt"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/sys/unix"
)

4
collector/mountstats_linux.go

@ -18,8 +18,8 @@ package collector
import (
"fmt"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs"
)

4
collector/netclass_linux.go

@ -22,8 +22,8 @@ import (
"os"
"regexp"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs/sysfs"
"gopkg.in/alecthomas/kingpin.v2"

4
collector/netdev_bsd.go

@ -19,8 +19,8 @@ package collector
import (
"errors"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
)
/*

4
collector/netdev_common.go

@ -20,8 +20,8 @@ import (
"errors"
"fmt"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"gopkg.in/alecthomas/kingpin.v2"
)

4
collector/netdev_darwin.go

@ -21,8 +21,8 @@ import (
"fmt"
"net"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"golang.org/x/sys/unix"
)

4
collector/netdev_linux.go

@ -24,8 +24,8 @@ import (
"strconv"
"strings"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
)
var (

2
collector/netdev_linux_test.go

@ -17,7 +17,7 @@ import (
"os"
"testing"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
)
func TestNetDevStatsIgnore(t *testing.T) {

4
collector/netdev_openbsd.go

@ -19,8 +19,8 @@ package collector
import (
"errors"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
)
/*

4
collector/netdev_openbsd_amd64.go

@ -16,8 +16,8 @@
package collector
import (
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"golang.org/x/sys/unix"
"unsafe"

2
collector/netstat_linux.go

@ -25,7 +25,7 @@ import (
"strconv"
"strings"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"gopkg.in/alecthomas/kingpin.v2"
)

2
collector/network_route_linux.go

@ -21,7 +21,7 @@ import (
"net"
"strconv"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/jsimonetti/rtnetlink"
"github.com/prometheus/client_golang/prometheus"
)

4
collector/nfs_linux.go

@ -21,8 +21,8 @@ import (
"os"
"reflect"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs/nfs"
)

4
collector/nfsd_linux.go

@ -20,8 +20,8 @@ import (
"fmt"
"os"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs/nfs"
)

2
collector/ntp.go

@ -22,7 +22,7 @@ import (
"time"
"github.com/beevik/ntp"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"gopkg.in/alecthomas/kingpin.v2"
)

4
collector/perf_linux.go

@ -21,8 +21,8 @@ import (
"strconv"
"strings"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/hodgesds/perf-utils"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/sys/unix"

2
collector/perf_linux_test.go

@ -22,7 +22,7 @@ import (
"strings"
"testing"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

2
collector/powersupplyclass.go

@ -23,7 +23,7 @@ import (
"regexp"
"strings"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs/sysfs"
"gopkg.in/alecthomas/kingpin.v2"

4
collector/pressure_linux.go

@ -21,8 +21,8 @@ import (
"os"
"syscall"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs"
)

4
collector/processes_linux.go

@ -22,8 +22,8 @@ import (
"strings"
"syscall"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs"
)

2
collector/processes_linux_test.go

@ -18,7 +18,7 @@ package collector
import (
"testing"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/procfs"
kingpin "gopkg.in/alecthomas/kingpin.v2"
)

2
collector/qdisc_linux.go

@ -21,7 +21,7 @@ import (
"path/filepath"
"github.com/ema/qdisc"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"gopkg.in/alecthomas/kingpin.v2"
)

4
collector/rapl_linux.go

@ -21,8 +21,8 @@ import (
"os"
"strconv"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs/sysfs"
)

4
collector/runit.go

@ -16,8 +16,8 @@
package collector
import (
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/soundcloud/go-runit/runit"
"gopkg.in/alecthomas/kingpin.v2"

4
collector/schedstat_linux.go

@ -20,8 +20,8 @@ import (
"fmt"
"os"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs"
)

4
collector/sockstat_linux.go

@ -20,8 +20,8 @@ import (
"fmt"
"os"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs"
)

2
collector/softnet_linux.go

@ -19,7 +19,7 @@ import (
"fmt"
"strconv"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs"
)

2
collector/stat_linux.go

@ -18,7 +18,7 @@ package collector
import (
"fmt"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs"
)

4
collector/supervisord.go

@ -23,8 +23,8 @@ import (
"net/url"
"time"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/mattn/go-xmlrpc"
"github.com/prometheus/client_golang/prometheus"
"gopkg.in/alecthomas/kingpin.v2"

4
collector/systemd_linux.go

@ -26,8 +26,8 @@ import (
"time"
"github.com/coreos/go-systemd/dbus"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
kingpin "gopkg.in/alecthomas/kingpin.v2"
)

2
collector/systemd_linux_test.go

@ -14,7 +14,7 @@
package collector
import (
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"regexp"
"testing"

2
collector/tcpstat_linux.go

@ -23,7 +23,7 @@ import (
"strconv"
"strings"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

4
collector/textfile.go

@ -24,8 +24,8 @@ import (
"strings"
"time"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
dto "github.com/prometheus/client_model/go"
"github.com/prometheus/common/expfmt"

2
collector/textfile_test.go

@ -20,7 +20,7 @@ import (
"net/http/httptest"
"testing"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/promlog"

2
collector/thermal_zone_linux.go

@ -18,7 +18,7 @@ package collector
import (
"fmt"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs/sysfs"
)

4
collector/time.go

@ -18,8 +18,8 @@ package collector
import (
"time"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
)

4
collector/timex.go

@ -21,8 +21,8 @@ import (
"fmt"
"os"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/sys/unix"
)

4
collector/udp_queues_linux.go

@ -20,8 +20,8 @@ import (
"fmt"
"os"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs"
)

2
collector/uname.go

@ -17,7 +17,7 @@
package collector
import (
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

2
collector/vmstat_linux.go

@ -23,7 +23,7 @@ import (
"strconv"
"strings"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"gopkg.in/alecthomas/kingpin.v2"
)

4
collector/wifi_linux.go

@ -23,8 +23,8 @@ import (
"os"
"path/filepath"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/mdlayher/wifi"
"github.com/prometheus/client_golang/prometheus"
"gopkg.in/alecthomas/kingpin.v2"

2
collector/xfs_linux.go

@ -18,7 +18,7 @@ package collector
import (
"fmt"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs/xfs"
)

4
collector/zfs.go

@ -20,8 +20,8 @@ import (
"errors"
"strings"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
)

2
collector/zfs_freebsd.go

@ -18,7 +18,7 @@ package collector
import (
"fmt"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

2
collector/zfs_linux.go

@ -24,7 +24,7 @@ import (
"strconv"
"strings"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
)

2
collector/zfs_solaris.go

@ -19,7 +19,7 @@ package collector
import (
"strings"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/siebenmann/go-kstat"
)

2
collector/zoneinfo_linux.go

@ -17,7 +17,7 @@ import (
"fmt"
"reflect"
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs"

4
go.mod

@ -4,7 +4,7 @@ require (
github.com/beevik/ntp v0.3.0
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
github.com/ema/qdisc v0.0.0-20200603082823-62d0308e3e00
github.com/go-kit/kit v0.10.0
github.com/go-kit/log v0.1.0
github.com/godbus/dbus v0.0.0-20190402143921-271e53dc4968
github.com/hodgesds/perf-utils v0.2.5
github.com/jsimonetti/rtnetlink v0.0.0-20210122163228-8d122574c736
@ -14,7 +14,7 @@ require (
github.com/mdlayher/wifi v0.0.0-20200527114002-84f0b9457fdd
github.com/prometheus/client_golang v1.9.0
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.15.0
github.com/prometheus/common v0.26.0
github.com/prometheus/exporter-toolkit v0.5.1
github.com/prometheus/procfs v0.6.0
github.com/siebenmann/go-kstat v0.0.0-20200303194639-4e8294f9e9d5

7
go.sum

@ -68,6 +68,8 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo=
github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o=
github.com/go-kit/log v0.1.0 h1:DGJh0Sm43HbOeYDNnVZFl8BvcYVvjD5bqYJvp0REbwQ=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4=
@ -268,8 +270,9 @@ github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/common v0.15.0 h1:4fgOnadei3EZvgRwxJ7RMpG1k1pOZth5Pc13tyspaKM=
github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
github.com/prometheus/exporter-toolkit v0.5.1 h1:9eqgis5er9xN613ZSADjypCJaDGj9ZlcWBvsIHa8/3c=
github.com/prometheus/exporter-toolkit v0.5.1/go.mod h1:OCkM4805mmisBhLmVFw858QYi3v0wKdY6/UxrT0pZVg=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
@ -373,6 +376,7 @@ golang.org/x/net v0.0.0-20201216054612-986b41b23924/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20201224014010-6772e930b67b h1:iFwSg7t5GZmB/Q5TjiEAsdoLDrdJRC1RiF2WhuV29Qw=
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421 h1:Wo7BWFiOk0QRFMLYMqJGFMd9CgUAcGx7V+qEg/h5IBI=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@ -445,6 +449,7 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=

6
node_exporter.go

@ -15,6 +15,7 @@ package main
import (
"fmt"
stdlog "log"
"net/http"
_ "net/http/pprof"
"os"
@ -24,8 +25,8 @@ import (
"github.com/prometheus/common/promlog"
"github.com/prometheus/common/promlog/flag"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/version"
@ -122,6 +123,7 @@ func (h *handler) innerHandler(filters ...string) (http.Handler, error) {
handler := promhttp.HandlerFor(
prometheus.Gatherers{h.exporterMetricsRegistry, r},
promhttp.HandlerOpts{
ErrorLog: stdlog.New(log.NewStdlibAdapter(level.Error(h.logger)), "", 0),
ErrorHandling: promhttp.ContinueOnError,
MaxRequestsInFlight: h.maxRequests,
Registry: h.exporterMetricsRegistry,

2
scripts/errcheck_excludes.txt

@ -1,4 +1,4 @@
// Used in HTTP handlers, any error is handled by the server itself.
(net/http.ResponseWriter).Write
// Never check for logger errors.
(github.com/go-kit/kit/log.Logger).Log
(github.com/go-kit/log.Logger).Log

Loading…
Cancel
Save