X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/711711827bb0c3564836707bb7d4453c60c6a98c..93cfe7c262708fb09eda5aad1839c832816d4591:/services/keepstore/config.go diff --git a/services/keepstore/config.go b/services/keepstore/config.go index 1f8c7e31a2..43a2191111 100644 --- a/services/keepstore/config.go +++ b/services/keepstore/config.go @@ -13,7 +13,8 @@ import ( "time" "git.curoverse.com/arvados.git/sdk/go/arvados" - "github.com/Sirupsen/logrus" + "github.com/prometheus/client_golang/prometheus" + "github.com/sirupsen/logrus" ) type Config struct { @@ -46,8 +47,7 @@ type Config struct { systemAuthToken string debugLogf func(string, ...interface{}) - ManagementToken string `doc: The secret key that must be provided by monitoring services -wishing to access the health check endpoint (/_health).` + ManagementToken string } var ( @@ -82,7 +82,7 @@ func DefaultConfig() *Config { // Start should be called exactly once: after setting all public // fields, and before using the config. -func (cfg *Config) Start() error { +func (cfg *Config) Start(reg *prometheus.Registry) error { if cfg.Debug { log.Level = logrus.DebugLevel cfg.debugLogf = log.Printf @@ -144,8 +144,9 @@ func (cfg *Config) Start() error { return fmt.Errorf("no volumes found") } } + vm := newVolumeMetricsVecs(reg) for _, v := range cfg.Volumes { - if err := v.Start(); err != nil { + if err := v.Start(vm); err != nil { return fmt.Errorf("volume %s: %s", v, err) } log.Printf("Using volume %v (writable=%v)", v, v.Writable()) @@ -166,7 +167,7 @@ func (vl *VolumeList) UnmarshalJSON(data []byte) error { for _, factory := range VolumeTypes { t := factory().Type() if _, ok := typeMap[t]; ok { - log.Fatal("volume type %+q is claimed by multiple VolumeTypes") + log.Fatalf("volume type %+q is claimed by multiple VolumeTypes", t) } typeMap[t] = factory }