diff --git a/cmd/algod/main.go b/cmd/algod/main.go index 306435ad94..ff197b91df 100644 --- a/cmd/algod/main.go +++ b/cmd/algod/main.go @@ -232,10 +232,22 @@ func run() int { telemetryConfig.SessionGUID = *sessionGUID } } - err = log.EnableTelemetry(telemetryConfig) - if err != nil { - fmt.Fprintln(os.Stdout, "error creating telemetry hook", err) - } + + // Remote telemetry init loop + go func() { + for { + // Try to enable remote telemetry now when URI is defined. Skip for DNS based telemetry. + err := log.EnableTelemetry(telemetryConfig) + // Error occurs only if URI is defined and we need to retry later + if err == nil { + // Remote telemetry enabled or empty static URI, stop retrying + return + } + fmt.Fprintln(os.Stdout, "error creating telemetry hook", err) + // Try to reenable every minute + time.Sleep(time.Minute) + } + }() } }