use _real_ cert-path to get node ID for metrics (#1058)

apparently, the presence of an "Identity" attribute in a config struct
does not imply that anything will fill it in or use it.

i tested all of these executables manually and individually this time.
This commit is contained in:
paul cannon 2019-01-16 15:43:29 -05:00 committed by GitHub
parent a2333c4809
commit 681d77c41a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -128,7 +128,7 @@ func cmdRun(cmd *cobra.Command, args []string) (err error) {
if err != nil {
return errs.New("Error creating tables for master database on satellite: %+v", err)
}
if err := process.InitMetricsWithCertPath(ctx, nil, runCfg.Identity.CertPath); err != nil {
if err := process.InitMetricsWithCertPath(ctx, nil, runCfg.Server.Identity.CertPath); err != nil {
zap.S().Errorf("Failed to initialize telemetry batcher: %+v", err)
}

View File

@ -120,7 +120,7 @@ func cmdRun(cmd *cobra.Command, args []string) (err error) {
zap.S().Info("Operator wallet: ", operatorConfig.Wallet)
}
ctx := process.Ctx(cmd)
if err := process.InitMetricsWithCertPath(ctx, nil, runCfg.Identity.CertPath); err != nil {
if err := process.InitMetricsWithCertPath(ctx, nil, runCfg.Server.Identity.CertPath); err != nil {
zap.S().Error("Failed to initialize telemetry batcher:", err)
}

View File

@ -47,14 +47,14 @@ func cmdRun(cmd *cobra.Command, args []string) (err error) {
return err
}
if err := process.InitMetricsWithCertPath(ctx, nil, cfg.Identity.CertPath); err != nil {
zap.S().Errorf("Failed to initialize telemetry batcher: %v", err)
}
_, err = metainfo.ListBuckets(ctx, storj.BucketListOptions{Direction: storj.After})
if err != nil {
return fmt.Errorf("Failed to contact Satellite.\n"+
"Perhaps your configuration is invalid?\n%s", err)
}
if err := process.InitMetricsWithCertPath(ctx, nil, cfg.Identity.CertPath); err != nil {
zap.S().Errorf("Failed to initialize telemetry batcher: %v", err)
}
return cfg.Run(ctx)
}