|
|
|
@ -18,6 +18,7 @@ import (
|
|
|
|
|
"net/http" |
|
|
|
|
_ "net/http/pprof" |
|
|
|
|
"os" |
|
|
|
|
"os/user" |
|
|
|
|
"sort" |
|
|
|
|
|
|
|
|
|
"github.com/prometheus/common/promlog" |
|
|
|
@ -176,6 +177,9 @@ func main() {
|
|
|
|
|
} |
|
|
|
|
level.Info(logger).Log("msg", "Starting node_exporter", "version", version.Info()) |
|
|
|
|
level.Info(logger).Log("msg", "Build context", "build_context", version.BuildContext()) |
|
|
|
|
if user, err := user.Current(); err == nil && user.Uid == "0" { |
|
|
|
|
level.Warn(logger).Log("msg", "Node Exporter is running as root user. This exporter is designed to run as unpriviledged user, root is not required.") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
http.Handle(*metricsPath, newHandler(!*disableExporterMetrics, *maxRequests, logger)) |
|
|
|
|
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { |
|
|
|
|