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
Conversation
…e the telemetry hook.
…and it's now initialized to an empty string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@tsachiherman I think I addressed all of the feedback, added the following:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few more comments. see below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. thanks for the changes.
logging/telemetryhook.go
Outdated
@@ -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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary
Lookup telemetry URL via SRV records.
Test Plan
Created telemetry.devnet.algodev.network SRV record and have been using that for testing.