Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

algod: Add static EnableTelemetry retry #6183

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions cmd/algod/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want this to go on indefinitely?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm inclined to say yes. It's only once per minute. If that sends like too much, maybe double the time each time, up to, say, 10 minutes?

}
}()
}
}

Expand Down
Loading