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

cmd/scollector: Set custom UserAgent and use facebookgo/httpcontrol for 60s RequestTimeout #1878

Merged
merged 3 commits into from
Aug 25, 2016

Conversation

gbrayut
Copy link
Contributor

@gbrayut gbrayut commented Aug 20, 2016

No description provided.

@gbrayut
Copy link
Contributor Author

gbrayut commented Aug 20, 2016

Not ready to merge yet, as I plan on testing on a few systems for a while first.

@gbrayut
Copy link
Contributor Author

gbrayut commented Aug 24, 2016

This is working now and ready for review. I am going to test it on a few systems to make sure the new 60s timeout doesn't cause any issues.

Fixes #1879

@gbrayut
Copy link
Contributor Author

gbrayut commented Aug 24, 2016

I added another commit that will set the UA for the collect package when used in tsdbrelay and bosun. I'll also test these on my VM.

@@ -47,6 +47,9 @@ var (
// Whether or not to use NTLM authentication
UseNtlm bool = false

// DefaultClient can be used to override the HTTP client that will be used to make requests.
DefaultClient *http.Client
Copy link
Contributor

Choose a reason for hiding this comment

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

This is kinda wierd to me. Collect already has an odd client with a ghetto timeout thing (that looks buggy to me). Can we just have a central utility that sets http.DefaultClient?

Something like util.SetupHttpClient(appName, msg, features...)?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather collect never had to know anything about http clients, and can just Get and Post to its heart's content.

@captncraig
Copy link
Contributor

In general, it looks pretty good. I'd just like to reduce some of the duplicated code if possible.

@gbrayut
Copy link
Contributor Author

gbrayut commented Aug 25, 2016

After speaking with Craig the new commits remove the client code from collect (just use collect.DefaultClient to override) and update the scollector/docs.go file. We decided against a util function, since bosun already requires a custom transport and we may need to add additional custom headers in scollector/tsdbrelay the future.

I'll test on a few systems then merge this to master.

@gbrayut gbrayut merged commit c1d4c83 into master Aug 25, 2016
@gbrayut gbrayut deleted the scollector branch August 25, 2016 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants