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

Move TelemetryURL to SRV Record #374

Merged
merged 30 commits into from Oct 16, 2019

Conversation

@winder
Copy link
Member

winder commented Oct 7, 2019

Summary

Lookup telemetry URL via SRV records.

Test Plan

Created telemetry.devnet.algodev.network SRV record and have been using that for testing.

@winder winder requested review from tsachiherman and algobolson Oct 7, 2019
@winder winder changed the title Move Move TelemetryURL to SRV Record Oct 7, 2019
winder added 4 commits Oct 7, 2019
Copy link
Contributor

tsachiherman left a comment

Change the function ReadFromBootstrap into GetSRVRecords, and have it receive the following parameters:
bootstrapID, fallbackDNSResoverAddress, serviceName and log.

Instead of creating a sub-domain with a SRV record, you want to create a SRV record with a different service name on the same domain.

cmd/algod/main.go Outdated Show resolved Hide resolved
cmd/algod/main.go Show resolved Hide resolved
logging/telemetryhook.go Outdated Show resolved Hide resolved
logging/telemetryhook.go Outdated Show resolved Hide resolved
logging/telemetryhook.go Outdated Show resolved Hide resolved
@winder winder requested a review from tsachiherman Oct 10, 2019
@winder

This comment has been minimized.

Copy link
Member Author

winder commented Oct 10, 2019

@tsachiherman I think I addressed all of the feedback, added the following:

  • signal to async telemetry hook event loop on telemetry uri change instead of ticker.
  • service with a shutdown signal to manage the telemetry update loop, used by algod/algoh.
  • shutdown signal added to the heartbeat event loop
Copy link
Contributor

tsachiherman left a comment

Few more comments. see below.

tools/network/bootstrap.go Outdated Show resolved Hide resolved
tools/network/telemetryURIUpdateService.go Outdated Show resolved Hide resolved
tools/network/telemetryURIUpdateService.go Outdated Show resolved Hide resolved
Copy link
Contributor

tsachiherman left a comment

looks good. thanks for the changes.

@@ -165,6 +169,10 @@ func createElasticHook(cfg TelemetryConfig) (hook logrus.Hook, err error) {
}
hostName := cfg.getHostName()
hook, err = elogrus.NewElasticHook(client, hostName, cfg.MinLogLevel, cfg.ChainID)

if err == nil && hook == nil {

This comment has been minimized.

Copy link
@tsachiherman

tsachiherman Oct 15, 2019

Contributor

That's pretty untypical for go; usually the object and the error are mutually exclusive.
If this is the case, don't return the hook if you know that its nil. return nil instead.

This comment has been minimized.

Copy link
@winder

winder Oct 15, 2019

Author Member

I think that this doesn't actually happen and I was confused initially because nil, nil is returned when initialized with an empty telemetry string. I'll remove this and make sure that is really the case.

winder added 5 commits Oct 16, 2019
Copy link
Contributor

tsachiherman left a comment

LGTM

@winder winder merged commit 01dfd6e into algorand:master Oct 16, 2019
2 checks passed
2 checks passed
Travis CI - Pull Request Build Passed
Details
license/cla Contributor License Agreement is signed.
Details
@winder winder deleted the winder:will/srv branch Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.