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

add option to specify a proxied path prefix #115

Merged
merged 2 commits into from
Jul 14, 2015

Conversation

peterneubauer
Copy link

No description provided.

@peterneubauer
Copy link
Author

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"
Copy link
Collaborator

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.

Copy link
Author

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
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"

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.

Copy link
Collaborator

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.

Copy link
Author

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
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"

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.

Copy link
Collaborator

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?

Copy link
Author

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
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"

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.

Copy link
Collaborator

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.

@aphyr
Copy link
Collaborator

aphyr commented Jul 14, 2015

Cool, thanks Peter! :D

aphyr added a commit that referenced this pull request Jul 14, 2015
add option to specify a proxied path prefix
@aphyr aphyr merged commit 27b9d48 into riemann:master Jul 14, 2015
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.

2 participants