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 2 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 @@
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 {

Check warning on line 238 in cmd/algod/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/algod/main.go#L237-L238

Added lines #L237 - L238 were not covered by tests
// Try to enable remote telemetry now when URI is defined. Skip for DNS based telemetry.
err := log.EnableTelemetry(telemetryConfig)

Check warning on line 240 in cmd/algod/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/algod/main.go#L240

Added line #L240 was not covered by tests
// Error occurs only if URI is defined and we need to retry later
if err == nil {

Check warning on line 242 in cmd/algod/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/algod/main.go#L242

Added line #L242 was not covered by tests
// Remote telemetry enabled or empty static URI, stop retrying
return

Check warning on line 244 in cmd/algod/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/algod/main.go#L244

Added line #L244 was not covered by tests
}
fmt.Fprintln(os.Stdout, "error creating telemetry hook", err)

Check warning on line 246 in cmd/algod/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/algod/main.go#L246

Added line #L246 was not covered by tests
// Try to reenable every minute
time.Sleep(time.Minute)

Check warning on line 248 in cmd/algod/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/algod/main.go#L248

Added line #L248 was not covered by tests
}
}()
}
}

Expand Down
Loading