mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-11-23 20:36:21 +01:00
Build cleanly under windows.
Removes unused signal handlers left over from signal based collection
and block the non windows-relevant collectors loadavg and interrupts.
Signal based collection removed in 1c17481a42
.
This commit is contained in:
parent
96ecc3d715
commit
ab9ee574fb
@ -14,6 +14,7 @@
|
|||||||
// +build !nointerrupts
|
// +build !nointerrupts
|
||||||
// +build !darwin
|
// +build !darwin
|
||||||
// +build !freebsd
|
// +build !freebsd
|
||||||
|
// +build !windows
|
||||||
|
|
||||||
package collector
|
package collector
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
// +build !noloadavg
|
// +build !noloadavg
|
||||||
|
// +build !windows
|
||||||
|
|
||||||
package collector
|
package collector
|
||||||
|
|
||||||
|
@ -18,12 +18,9 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
_ "net/http/pprof"
|
_ "net/http/pprof"
|
||||||
"os"
|
|
||||||
"os/signal"
|
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"syscall"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
@ -154,9 +151,6 @@ func main() {
|
|||||||
nodeCollector := NodeCollector{collectors: collectors}
|
nodeCollector := NodeCollector{collectors: collectors}
|
||||||
prometheus.MustRegister(nodeCollector)
|
prometheus.MustRegister(nodeCollector)
|
||||||
|
|
||||||
sigUsr1 := make(chan os.Signal)
|
|
||||||
signal.Notify(sigUsr1, syscall.SIGUSR1)
|
|
||||||
|
|
||||||
handler := prometheus.Handler()
|
handler := prometheus.Handler()
|
||||||
|
|
||||||
http.Handle(*metricsPath, handler)
|
http.Handle(*metricsPath, handler)
|
||||||
|
Loading…
Reference in New Issue
Block a user