mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-30 02:38:17 +08:00
[FIX] fix the bug
This commit is contained in:
parent
4a56a092d4
commit
6b0fb1bda3
@ -22,23 +22,11 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/goodrain/rainbond/cmd/node/option"
|
||||
"github.com/goodrain/rainbond/cmd/node/server"
|
||||
"github.com/prometheus/node_exporter/collector"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// This instance is only used to check collector creation and logging.
|
||||
nc, err := collector.NewNodeCollector()
|
||||
if err != nil {
|
||||
logrus.Fatalf("Couldn't create collector: %s", err)
|
||||
}
|
||||
logrus.Infof("Enabled collectors:")
|
||||
for n := range nc.Collectors {
|
||||
logrus.Infof(" - %s", n)
|
||||
}
|
||||
|
||||
option.Init()
|
||||
if err := server.Run(option.Config); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "error: %v\n", err)
|
||||
|
@ -27,6 +27,7 @@ import (
|
||||
kingpin "gopkg.in/alecthomas/kingpin.v2"
|
||||
|
||||
"github.com/goodrain/rainbond/pkg/node/utils"
|
||||
"github.com/prometheus/node_exporter/collector"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
client "github.com/coreos/etcd/clientv3"
|
||||
@ -58,6 +59,15 @@ func Init() error {
|
||||
return err
|
||||
}
|
||||
kingpin.Parse()
|
||||
// This instance is only used to check collector creation and logging.
|
||||
nc, err := collector.NewNodeCollector()
|
||||
if err != nil {
|
||||
logrus.Fatalf("Couldn't create collector: %s", err)
|
||||
}
|
||||
logrus.Infof("Enabled collectors:")
|
||||
for n := range nc.Collectors {
|
||||
logrus.Infof(" - %s", n)
|
||||
}
|
||||
// if err := Config.watch(); err != nil {
|
||||
// return err
|
||||
// }
|
||||
|
Loading…
Reference in New Issue
Block a user