8 "git.curoverse.com/arvados.git/sdk/go/arvados"
9 "git.curoverse.com/arvados.git/sdk/go/health"
10 "git.curoverse.com/arvados.git/sdk/go/httpserver"
11 log "github.com/Sirupsen/logrus"
17 configFile := flag.String("config", arvados.DefaultConfigFile, "`path` to arvados configuration file")
18 getVersion := flag.Bool("version", false, "Print version information and exit.")
21 // Print version information if requested
23 fmt.Printf("arvados-health %s\n", version)
27 log.SetFormatter(&log.JSONFormatter{
28 TimestampFormat: "2006-01-02T15:04:05.000000000Z07:00",
30 log.Printf("arvados-health %s started", version)
32 cfg, err := arvados.GetConfig(*configFile)
36 clusterCfg, err := cfg.GetCluster("")
40 nodeCfg, err := clusterCfg.GetThisSystemNode()
45 log := log.WithField("Service", "Health")
46 srv := &httpserver.Server{
47 Addr: nodeCfg.Health.Listen,
49 Handler: &health.Aggregator{
51 Log: func(req *http.Request, err error) {
52 log.WithField("RemoteAddr", req.RemoteAddr).
53 WithField("Path", req.URL.Path).
60 if err := srv.Start(); err != nil {
63 log.WithField("Listen", srv.Addr).Info("listening")
64 if err := srv.Wait(); err != nil {