-
Notifications
You must be signed in to change notification settings - Fork 306
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 preflight check on Elasticsearch before connecting #1026
Merged
andsel
merged 17 commits into
logstash-plugins:master
from
andsel:feature/add_elasticsearch_check_before_connecting
Oct 12, 2021
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
ec36553
Draft the idea of the checks done at the same time of the license check
andsel 9306b11
Fixed failing test and store last version in case of bad Elasticsearch
andsel 496a70b
Added unit test to validate the authenticity rules
andsel 4a60bd1
Remove WebMock stubbing to avoid interference with other tests
andsel 2e9cdee
Removed WebMock used to mock HTTP request response for Elasticsearch …
andsel d483a4a
Fixed bad spelled property
andsel 6ff1eed
Updated version
andsel 7255f02
Switched #healthcheck! Elasticsearch check to raise a ConfigurationError
andsel 61de6e2
Fixed failing tests
andsel e2d82e6
Apply product check only during registration phase
andsel 35902e0
Reused root URI string and avoided creation of Gem::Verson objects
andsel 710577f
Simplify check
andsel 8b4126e
Simplify if condition
andsel 1c2f467
Changed error message to something more useful
andsel e590e04
Changed the version to 11.2.0
andsel 83d644d
Removed disable of xpack.security
andsel e8d3d7d
Fixed error message
andsel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This makes me wonder if we could just make the
elasticsearch?
check everytime instead of HEAD'ing the/
?Right after we do HEAD then we request '/' in
es_version = get_es_version(url)
.With this change we'll be doing 4 requests to ES:
elasticsearch?
onregister_phase
We can just do 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 agree with you, I think that point 2 and 3 could be merged or at least do one one HTTP GET call to
/
.About the HTTP HEAD, that call could use a customized path from configuration (
healthcheck_path
) that some users could have customized. If we drop the HEAD call is like ignoring that setting and we should remove it.I'm ok with removing the HEAD call, because actually seems to be used just to ping the server for reachability and then it immediately send a GET.
We could split this work in 2 steps:
healthcheck_path
paramThere 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.
It's fine if there's only an issue instead to track the goal of reducing the number of network calls for a healthcheck.
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.
Opened #1043 to track this feature