-
Notifications
You must be signed in to change notification settings - Fork 474
[Fleet] Make Elasticsearch scope setting a select #5451
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
[Fleet] Make Elasticsearch scope setting a select #5451
Conversation
🌐 Coverage report
|
/test |
@elastic/infra-monitoring-ui Could we please get your eyes on this change? This is an update to the Elasticsearch integration using the new select variable described in elastic/package-spec#453. In particular, we'd appreciate your input on the following:
|
@weltenwort can we please have your eyes on this? |
@@ -45,7 +45,7 @@ | |||
"data_stream": { | |||
"namespace": "default", | |||
"type": "metrics", | |||
"dataset": "elasticsearch.enrich" | |||
"dataset": "elasticsearch.stack_monitoring.enrich" |
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.
These sample events were generated before we specified an override for the dataset and I suppose elastic-package now validates the field.
The slowlogs failures should be related to that new validation: the spec expects the raw datastream name elasticsearch.slowlog
but log4j configuration specifies an override outside of the package scope, causing a disconnect
@@ -0,0 +1,5 @@ | |||
input: logfile |
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.
Do we need to split the tests ? system tests are already expensive to run in this package given the number of data streams, will this create an additional test loop with a service up
setup/teardown ?
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.
We are not sure about this. The concern we had was that replacing elasticsearch.index_search_slowlog
and elasticsearch.index_indexing_slowlog
with elasticsearch.slowlog
in log4j2
will change the testing behaviour, as everything would point to one dataset instead of two.
Hey @klacabane Thanks for catching this! This looks like an issue with the support in Kibana, which I will tackle first thing tomorrow morning. I will ping you on this PR when this is fixed 🙏 |
## Summary This PR is a followup fix to #152550. As discovered in elastic/integrations#5451 (comment), there is currently an issue where the select is invalid upon first render because no default `value` exists, yet the first option appears to be selected. The fix introduced in this PR replaces the EUISelect with a more flexible EUIComboBox component, with a placeholder with text `Select an option` when no value is selected. In addition, this new component allows the selection to be cleared, which can be useful for non required variables. If the package specifies a default value, it should be selected by default. Otherwise, the placeholder will render. Note that the field will not be valid upon first render if the variable is required and no default value is provided. <img width="1728" alt="Screenshot 2023-03-29 at 17 47 28" src="https://user-images.githubusercontent.com/23701614/228596370-d6b14c03-4a09-4f68-a137-95bb7ca7e78f.png"> <img width="1728" alt="Screenshot 2023-03-29 at 17 47 35" src="https://user-images.githubusercontent.com/23701614/228596387-dc99e4b2-5d9d-4218-baf1-010bf527b028.png"> <img width="1728" alt="Screenshot 2023-03-29 at 17 47 44" src="https://user-images.githubusercontent.com/23701614/228596415-9f1f73af-a9f5-4a88-a700-999213500c4e.png"> ### Repro steps 1. Run package-registry with version 1.5.0 of Elasticsearch integration from elastic/integrations#5451: 1. In integrations repo, check out the branch in elastic/integrations#5451 2. In `packages/elasticsearch/changelog.yml`, change `version: 1.5.0-next` to `version: 1.5.0` 3. In `packages/elasticsearch/manifest.yml`, change the version to 1.5.0 4. In the shell, `cd packages/elasticsearch` if not there already and `elastic-package build -v` 5. Run the package registry: `elastic-package stack up -v -d --services package-registry` 6. Check that it is running correctly and that you can see version 1.5.0 of Elasticsearch at https://localhost:8080/search?package=elasticsearch 2. Run Kibana in dev on this branch: 1. In your `kibana.dev.yml`, add `xpack.fleet.registryUrl: https://localhost:8080` if not there (⚠️ https, not http) 2. Before running `yarn start`, run `export NODE_EXTRA_CA_CERTS=$HOME/.elastic-package/profiles/default/certs/kibana/ca-cert.pem` in the same shell. This is to set up the certificate needed to access EPR with https. 3. In Kibana, add the Elasticsearch integration (should be version 1.5.0). Check that the `Scope` setting is controlled by a select. Note: in the latest version, this integration now provides a default value, which should be set to `node`. ### Checklist - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
/test |
1 similar comment
/test |
Hey @klacabane just a note that the Kibana fix has been merged - you should be able to test manually again. I'm looking at these test failures. |
Separate system tests for slowlog datastream to check independently logs from index_indexing_slowlog and index_search_slowlog files. Updated log4j2.properties files to keep dataset field with the required pattern.
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, thank you for the change and taking care of test failures
Package elasticsearch - 1.6.0 containing this change is available at https://epr.elastic.co/search?package=elasticsearch |
1 similar comment
Package elasticsearch - 1.6.0 containing this change is available at https://epr.elastic.co/search?package=elasticsearch |
What does this PR do?
This PR changes the field type of the
scope
setting for the Elasticsearch integration fromtext
toselect
. Theselect
type is new and defined in the following PRs:Checklist
changelog.yml
file.Author's Checklist
scope
select variable works as expected.scope
is approved.How to test this PR locally
scope
option works as desired.Related issues
Screenshots
Cf. screenshots in elastic/kibana#152550