Only request wildcard expansion for hidden indices if supported#20938
Only request wildcard expansion for hidden indices if supported#20938ycombinator merged 9 commits intoelastic:masterfrom ycombinator:indices-stats-hidden-bc
Conversation
|
Pinging @elastic/integrations-services (Team:Services) |
|
Pinging @elastic/stack-monitoring (Stack monitoring) |
jsoriano
left a comment
There was a problem hiding this comment.
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.
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.
| ew := u.Query().Get(expandWildcardsParam) | ||
| if !strings.HasSuffix(ew, hiddenSuffix) { |
There was a problem hiding this comment.
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.
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.
|
@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/indexmetricset 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/indexmetricset 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/indexmetricset 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.asciidocorCHANGELOG-developer.next.asciidoc.