-
Notifications
You must be signed in to change notification settings - Fork 119
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
add option to specify a proxied path prefix #115
Conversation
This is useful if you have mapped the ELS root path to something else than / (e.g. to provide auth). Would be great to get that into the next release @aphyr ! |
@@ -36,7 +37,7 @@ class Riemann::Tools::Elasticsearch | |||
end | |||
|
|||
def health_url | |||
"http://#{options[:es_host]}:#{options[:es_port]}/_cluster/health" | |||
"http://#{options[:es_host]}:#{options[:es_port]}/#{options[:path_prefix]}/_cluster/health" |
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.
Is a double slash (//) gonna work? Looks like the default is an empty string, so I want to make sure we don't break existing users.
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.
Normally they work, but better either test or parse it to single? Not sure
how to communicate the prefix format in a good way to the user...
On May 29, 2015 8:30 PM, "Kyle Kingsbury" [email protected] wrote:
In bin/riemann-elasticsearch
#115 (comment):@@ -36,7 +37,7 @@ class Riemann::Tools::Elasticsearch
enddef health_url
- "http://#{options[:es_host]}:#{options[:es_port]}/_cluster/health"
- "http://#{options[:es_host]}:#{options[:es_port]}/#{options[:path_prefix]}/_cluster/health"
Is a double slash (//) gonna work? Looks like the default is an empty
string, so I want to make sure we don't break existing users.—
Reply to this email directly or view it on GitHub
https://github.com/aphyr/riemann-tools/pull/115/files#r31351629.
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.
Ah, that too--I actually meant that by default, this is gonna hit //_cluster/health
, not /_cluster/health
.
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.
Yeah, feel free to remove one!
On May 29, 2015 9:19 PM, "Kyle Kingsbury" [email protected] wrote:
In bin/riemann-elasticsearch
#115 (comment):@@ -36,7 +37,7 @@ class Riemann::Tools::Elasticsearch
enddef health_url
- "http://#{options[:es_host]}:#{options[:es_port]}/_cluster/health"
- "http://#{options[:es_host]}:#{options[:es_port]}/#{options[:path_prefix]}/_cluster/health"
Ah, that too--I actually meant that by default, this is gonna hit
//_cluster/health, not /_cluster/health.—
Reply to this email directly or view it on GitHub
https://github.com/aphyr/riemann-tools/pull/115/files#r31356169.
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.
Er, well, if we remove one, then... do we enforce path prefixes contain a trailing slash, or?
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.
Well,
We could remove any leading and trailing slash, and put it there ourselves,
so we get consistent behavior?
On May 31, 2015 4:04 AM, "Kyle Kingsbury" [email protected] wrote:
In bin/riemann-elasticsearch
#115 (comment):@@ -36,7 +37,7 @@ class Riemann::Tools::Elasticsearch
enddef health_url
- "http://#{options[:es_host]}:#{options[:es_port]}/_cluster/health"
- "http://#{options[:es_host]}:#{options[:es_port]}/#{options[:path_prefix]}/_cluster/health"
Er, well, if we remove one, then... do we enforce path prefixes contain a
trailing slash, or?—
Reply to this email directly or view it on GitHub
https://github.com/aphyr/riemann-tools/pull/115/files#r31386100.
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.
Yep! Good call, but leave exactly one trailing slash if the prefix is non-empty, and drop one of the slashes from the URL. That way when the string is empty we get only one /
, and when it's present, things work out correctly.
Cool, thanks Peter! :D |
add option to specify a proxied path prefix
No description provided.