-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Only request wildcard expansion for hidden indices if supported #20938
Only request wildcard expansion for hidden indices if supported #20938
Conversation
Pinging @elastic/integrations-services (Team:Services) |
Pinging @elastic/stack-monitoring (Stack monitoring) |
51d0743
to
b69c255
Compare
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.
LGTM, comments are not blockers.
var BulkStatsAvailableVersion = common.MustNewVersion("8.0.0") | ||
//ExpandWildcardsHiddenAvailableVersion is the version since when the "expand_wildcards" query parameter to | ||
// the Indices Stats API can accept "hidden" as a value. | ||
ExpandWildcardsHiddenAvailableVersion = common.MustNewVersion("7.9.0") |
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.
In #18703 an integration test was added and it was being executed against Elasticsearch 7.7.0, why did this test didn't fail?
Should we add some other test for the expand wildcards case?
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.
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.
Fixed constant in 1d6ceae.
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.
Added unit test cases in 08d22a5.
ew := u.Query().Get(expandWildcardsParam) | ||
if !strings.HasSuffix(ew, hiddenSuffix) { |
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.
The path comes from a constant, do we need to do these checks to see if some suffix is already present?
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, I guess you're right. I was thinking of a different problem (#16044) but that's not applicable here. I will remove the checks.
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.
Removed in 854671e.
@jsoriano Thanks for the excellent review. I have addressed all your feedback. Please re-review when you get a chance. Thanks! |
Failing test seems related. |
…ne-2.0 * upstream/master: [Metricbeat][test] Disable ec2 flaky test (elastic#20959) Check if tracer is active before starting a transaction (elastic#20852) [Elastic Agent] Add support for variable replacement from providers (elastic#20839) Only request wildcard expansion for hidden indices if supported (elastic#20938) [Ingest Manager] New agent structure (symlinks) (elastic#20400) [Ingest Manager] Print a message confirming shutdown (elastic#20948) Skip flaky test on unix input (elastic#20942) [Ingest Manager] Align introspect-inspect naming in code (elastic#20952) [Filebeat][zeek] Map new x509 fields for ssl module (elastic#20927) [CI] fix regression with variable name (elastic#20930) [Autodiscover] Handle input-not-finished errors in config reload (elastic#20915) [Ingest Manager] Remove Success from fleet contract (elastic#20449)
…-faster * upstream/master: [Metricbeat][test] Disable ec2 flaky test (elastic#20959) Check if tracer is active before starting a transaction (elastic#20852) [Elastic Agent] Add support for variable replacement from providers (elastic#20839) Only request wildcard expansion for hidden indices if supported (elastic#20938) [Ingest Manager] New agent structure (symlinks) (elastic#20400) [Ingest Manager] Print a message confirming shutdown (elastic#20948) Skip flaky test on unix input (elastic#20942) [Ingest Manager] Align introspect-inspect naming in code (elastic#20952) [Filebeat][zeek] Map new x509 fields for ssl module (elastic#20927)
…s if supported (#20938) (#20962) * Only request wildcard expansion for hidden indices if supported (#20938) * Refactoring: inverting logic to make room for another case * Expand hidden indices wildcards if monitored ES supports that option * Adding CHANGELOG entry * Fixing formatting * Avoid unnecessary setting * Removing unnecessary suffix existence checks * Fixing feature version * Add test cases to unit test * Updating test # Conflicts: # metricbeat/module/elasticsearch/index/index_test.go * Fixing CHANGELOG
…) (#20963) * Refactoring: inverting logic to make room for another case * Expand hidden indices wildcards if monitored ES supports that option * Adding CHANGELOG entry * Fixing formatting * Avoid unnecessary setting * Removing unnecessary suffix existence checks * Fixing feature version * Add test cases to unit test * Updating test # Conflicts: # metricbeat/module/elasticsearch/index/index_test.go
…tic#20938) * Refactoring: inverting logic to make room for another case * Expand hidden indices wildcards if monitored ES supports that option * Adding CHANGELOG entry * Fixing formatting * Avoid unnecessary setting * Removing unnecessary suffix existence checks * Fixing feature version * Add test cases to unit test * Updating test
…s if supported (elastic#20938) (elastic#20962) * Only request wildcard expansion for hidden indices if supported (elastic#20938) * Refactoring: inverting logic to make room for another case * Expand hidden indices wildcards if monitored ES supports that option * Adding CHANGELOG entry * Fixing formatting * Avoid unnecessary setting * Removing unnecessary suffix existence checks * Fixing feature version * Add test cases to unit test * Updating test # Conflicts: # metricbeat/module/elasticsearch/index/index_test.go * Fixing CHANGELOG
What does this PR do?
This PR teaches the
elasticsearch/index
metricset to check the version of the Elasticsearch cluster it's monitoring and, depending on that, ask the cluster to expand wildcards for hidden indices or not.Why is it important?
In #18703 we enhanced the
elasticsearch/index
metricset to ask the monitored Elasticsearch cluster to expand wildcards for hidden indices. This enhancement was released in Metricbeat 7.9.0.Unfortunately this enhancement a backwards-incompatible change, as wildcard expansion for hidden indices is only supported starting Elasticsearch 7.9.0. So if a Metricbeat >= 7.90 tries to monitor an Elasticsearch cluster < 7.9.0, the
elasticsearch/index
metricset is not able to collect metrics and throws the following error:Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.