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/bosun: Shorten-only http proxy #1590

Merged
merged 1 commit into from
Feb 12, 2016

Conversation

mathpl
Copy link
Contributor

@mathpl mathpl commented Feb 12, 2016

This adds shortenProxy as option in bosun.toml to add a proxy only to requests out to googleapis' shortener api. The alternative is making use of the default http client's http.ProxyFromEnvironment but it results in all http calls to use it. That includes calls to OpenTSDB which isn't a something we want.

@captncraig
Copy link
Contributor

Silly question: what problem does this solve?

@mathpl
Copy link
Contributor Author

mathpl commented Feb 12, 2016

Our outbound proxies are on a different network than where OpentTSDB is. In our case we simply cannot use the same for both sets of calls. I also think going through a proxy to fetch data from OpenTSDB is generally unneeded in most deployments, unlike reaching out to googleapis.

@gbrayut
Copy link
Contributor

gbrayut commented Feb 12, 2016

yeah... Internet calls vs Intranet calls makes sense. I'd change the name to InternetProxy so it can be reused if we ever add any other APIs, but otherwise sounds fine to me.

if *flagQuiet {
c.Quiet = true
}
go func() { slog.Fatal(web.Listen(c.HTTPListen, *flagDev, c.TSDBHost)) }()
go func() { slog.Fatal(web.Listen(c.HTTPListen, *flagDev, c.TSDBHost, shortenProxy)) }()
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't love the idea of yet another argument to Listen. How about a package variable in web that you set when reading the config above here?

@mathpl mathpl force-pushed the feature/shorten_only_proxy branch 2 times, most recently from 3098748 to 9768b90 Compare February 12, 2016 22:32
@mathpl mathpl force-pushed the feature/shorten_only_proxy branch from 9768b90 to 5e9cdec Compare February 12, 2016 22:38
@mathpl
Copy link
Contributor Author

mathpl commented Feb 12, 2016

How about this?

@captncraig
Copy link
Contributor

Thanks for those changes. I like it.

@gbrayut
Copy link
Contributor

gbrayut commented Feb 12, 2016

LGTM

captncraig pushed a commit that referenced this pull request Feb 12, 2016
@captncraig captncraig merged commit f223616 into bosun-monitor:master Feb 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants