[Uptime] Update monitor saved object mappings#130433
[Uptime] Update monitor saved object mappings#130433shahzad31 merged 15 commits intoelastic:mainfrom
Conversation
| name: { | ||
| type: 'keyword', | ||
| type: 'text', | ||
| fielddata: true, |
There was a problem hiding this comment.
without settings this, it would raise this error
[2022-04-17T11:08:06.011+02:00][ERROR][http] ResponseError: all shards failed: search_phase_execution_exception: [illegal_argument_exception] Reason: Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [synthetics-monitor.name] in order to load field data by uninverting the inverted index. Note that this can use significant memory.
There was a problem hiding this comment.
Why do we not need fielddata for other properties, do you know?
There was a problem hiding this comment.
I'm actually reviewing this now. I can see the error is related to the sorting feature in the monitor management list, and text fields not being optimized for sorting. This error is actually present when attempting to sort on the other fields we enable sorting for, urls and type, but does not apepar until you attempt to sort by those fields.
I am currently resolving this issue using multi fields and ensuring that sorting always uses the .keyword property. I will push directly to the branch.
| type: 'keyword', | ||
| type: 'text', | ||
| }, | ||
| secrets: { |
There was a problem hiding this comment.
This is my fault, but can we remove this? There is no reason to have secrets indexed.
| name: { | ||
| type: 'keyword', | ||
| type: 'text', | ||
| fielddata: true, |
There was a problem hiding this comment.
Why do we not need fielddata for other properties, do you know?
| tags: { | ||
| type: 'keyword', | ||
| type: 'text', | ||
| }, |
There was a problem hiding this comment.
We might want to review upcoming feature requests for searching, and ensure that anything we want to search in the future has mappings.
One thing that comes to mind, for example, is location name.
That being said, we may end up simply converting Uptime saved objects to Synthetics saved objects in the future, and Uptime may never get full search and filter features
There was a problem hiding this comment.
We might want to review upcoming feature requests for searching, and ensure that anything we want to search in the future has mappings.
You can update the mappings after the fact.
For this release, I'd recommend omitting all fields that don't need to be searched in this release.
See https://docs.elastic.dev/kibana-dev-docs/tutorials/saved-objects#mappings for more details.
|
@elasticmachine merge upstream |
|
Pinging @elastic/uptime (Team:uptime) |
|
@elasticmachine merge upstream |
|
I noted this offline to @dominiqueclarke but aside from the sort not working between individual Here's a GIF of me "sorting" the monitors: When I added another |
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
|
Everything seems to be working as expected including sorting. |
lucasfcosta
left a comment
There was a problem hiding this comment.
I have reviewed the code as per @shahzad31's request (after reading this super helpful explanation) and it LGTM.
I haven't E2E this PR as per Shahzad's request considering this PR has already been tested.
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
* update mappings * PR feedback * update * update mappings * update mappings * port and hosts * adjust jest test * adjust mappings for sorting by url, name, and type * remove unused import * synthetics - do not make synthetics monitors exportable * adjust tests Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co> (cherry picked from commit a843db3)
…disable-server-side * 'main' of github.com:elastic/kibana: (103 commits) [Osquery] Update eslint config (elastic#129637) [Uptime] Update monitor saved object mappings (elastic#130433) Add links to metricbeat module docs (elastic#130519) Add link to troubleshooting guide in confirm data copy (elastic#130420) [Step 3] Cleanup charts plugin (elastic#130132) [Visualize] Adds a deprecation warning to the pie app (elastic#130447) [Maps] fix vector tile load errors not displayed in legend (elastic#130395) [CI] Split alerting-api-integration tests into separate cigroups (elastic#130414) [CI] Use spot instances for default cigroups in PR CI (elastic#130476) [functional-tests] TimePicker optimizations (elastic#130200) [kbn/pm] use stable module ids in dist (elastic#130497) [8.2.1][Security Solution][Session view] fix full screen session view margin (elastic#130496) Fix wrong config in comments (elastic#130378) Add deprecated telemetry (elastic#130458) Add eslint rule to support breaking up packages (elastic#130483) [Security Solution][Endpoint] Fix test stability and un-skip flaky tests (elastic#130176) Update object types for SharePoint Online external connector (elastic#130478) [Workplace Search] Fix broken feedback link (elastic#130475) Rename the term "execution" in config to "run" (elastic#130172) [Cloud Posture] use index with keyword mapping (elastic#130456) ... # Conflicts: # docs/user/reporting/index.asciidoc # x-pack/plugins/reporting/public/types.ts # x-pack/plugins/screenshotting/server/screenshots/index.test.ts # x-pack/plugins/screenshotting/server/screenshots/index.ts
* update mappings * PR feedback * update * update mappings * update mappings * port and hosts * adjust jest test * adjust mappings for sorting by url, name, and type * remove unused import * synthetics - do not make synthetics monitors exportable * adjust tests Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co> (cherry picked from commit a843db3)
* update mappings * PR feedback * update * update mappings * update mappings * port and hosts * adjust jest test * adjust mappings for sorting by url, name, and type * remove unused import * synthetics - do not make synthetics monitors exportable * adjust tests Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>

Summary
Fixes #129424
It updates the default field
name,urls, andtypemapping fromkeywordtotext, while adding.keywordfields to support sorting by each field.This also makes importableAndExportable false, since these saved objects contains secrets and import/export without decryption doesn't makes sense.
Testing
Enable Monitor ManagementTypecolumn heading. Ensure that monitors are sorted by typeURLcolumn heading. Ensure the monitors are sorted byurl. Note: There is a known bug where sorting does not work correctly for tcp and icmp monitors. Issue is pending.Namecolumn heading. Ensure the monitors are sorted by name.