Skip to content

Commit

Permalink
Add ErrorLog plumbing to promhttp
Browse files Browse the repository at this point in the history
Fix the error logging of the promhttp handler by connecting it to the
promlog setup.
* Switch to go-kit/log.
* Cleanup CHANGELOG.

Fixes: #1886

Signed-off-by: Ben Kochie <superq@gmail.com>
  • Loading branch information
SuperQ committed Jun 3, 2021
1 parent 220aa5b commit 3bc9a93
Show file tree
Hide file tree
Showing 100 changed files with 155 additions and 145 deletions.
7 changes: 5 additions & 2 deletions 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

Expand Down
2 changes: 1 addition & 1 deletion collector/arp_linux.go
Expand Up @@ -22,7 +22,7 @@ import (
"os"
"strings"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down
2 changes: 1 addition & 1 deletion collector/bcache_linux.go
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions collector/bonding_linux.go
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion collector/boot_time_bsd.go
Expand Up @@ -17,7 +17,7 @@
package collector

import (
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down
2 changes: 1 addition & 1 deletion collector/boot_time_openbsd_amd64.go
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion collector/boot_time_solaris.go
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion collector/btrfs_linux.go
Expand Up @@ -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"
)
Expand Down
4 changes: 2 additions & 2 deletions collector/buddyinfo.go
Expand Up @@ -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"
)
Expand Down
4 changes: 2 additions & 2 deletions collector/collector.go
Expand Up @@ -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"
)
Expand Down
4 changes: 2 additions & 2 deletions collector/conntrack_linux.go
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion collector/cpu_darwin.go
Expand Up @@ -25,7 +25,7 @@ import (
"strconv"
"unsafe"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down
2 changes: 1 addition & 1 deletion collector/cpu_dragonfly.go
Expand Up @@ -20,7 +20,7 @@ import (
"strconv"
"unsafe"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down
4 changes: 2 additions & 2 deletions collector/cpu_freebsd.go
Expand Up @@ -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"
)
Expand Down
4 changes: 2 additions & 2 deletions collector/cpu_linux.go
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion collector/cpu_openbsd.go
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion collector/cpu_openbsd_amd64.go
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion collector/cpu_solaris.go
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion collector/cpufreq_linux.go
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion collector/cpufreq_solaris.go
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion collector/devstat_dragonfly.go
Expand Up @@ -19,7 +19,7 @@ import (
"errors"
"fmt"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down
2 changes: 1 addition & 1 deletion collector/devstat_freebsd.go
Expand Up @@ -21,7 +21,7 @@ import (
"sync"
"unsafe"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down
2 changes: 1 addition & 1 deletion collector/diskstats_darwin.go
Expand Up @@ -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"
)
Expand Down
4 changes: 2 additions & 2 deletions collector/diskstats_linux.go
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion collector/diskstats_openbsd.go
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion collector/diskstats_openbsd_amd64.go
Expand Up @@ -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"
)
Expand Down
4 changes: 2 additions & 2 deletions collector/drbd_linux.go
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion collector/edac_linux.go
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion collector/entropy_linux.go
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion collector/exec_bsd.go
Expand Up @@ -17,7 +17,7 @@
package collector

import (
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down
4 changes: 2 additions & 2 deletions collector/fibrechannel_linux.go
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion collector/filefd_linux.go
Expand Up @@ -22,7 +22,7 @@ import (
"os"
"strconv"

"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down
2 changes: 1 addition & 1 deletion collector/filesystem_bsd.go
Expand Up @@ -20,7 +20,7 @@ import (
"errors"
"unsafe"

"github.com/go-kit/kit/log/level"
"github.com/go-kit/log/level"
)

/*
Expand Down
4 changes: 2 additions & 2 deletions collector/filesystem_common.go
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion collector/filesystem_freebsd.go
Expand Up @@ -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"
)

Expand Down
4 changes: 2 additions & 2 deletions collector/filesystem_linux.go
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion collector/filesystem_linux_test.go
Expand Up @@ -14,7 +14,7 @@
package collector

import (
"github.com/go-kit/kit/log"
"github.com/go-kit/log"
"strings"
"testing"

Expand Down
2 changes: 1 addition & 1 deletion collector/filesystem_openbsd_amd64.go
Expand Up @@ -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"
)

Expand Down
4 changes: 2 additions & 2 deletions collector/hwmon_linux.go
Expand Up @@ -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"
)
Expand Down
4 changes: 2 additions & 2 deletions collector/infiniband_linux.go
Expand Up @@ -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"
)
Expand Down

0 comments on commit 3bc9a93

Please sign in to comment.