Skip to content

[data views] Provide method of excluding data tiers when getting field list#167946

Merged
mattkime merged 15 commits intoelastic:mainfrom
mattkime:data_views_exclude_frozen
Jan 31, 2024
Merged

[data views] Provide method of excluding data tiers when getting field list#167946
mattkime merged 15 commits intoelastic:mainfrom
mattkime:data_views_exclude_frozen

Conversation

@mattkime
Copy link
Copy Markdown
Contributor

@mattkime mattkime commented Oct 4, 2023

Summary

This PR implements an Advanced setting (data_views:fields_excluded_data_tiers) that allows the exclusion of listed data tiers when getting a field list. The expected common use case would be excluding frozen indices to speed up slow field caps calls.

There is no serverless functionality since serverless doesn't have data tiers.

Bildschirmfoto 2024-03-13 um 08 47 18

Additional information

  • This exclusion applies to all uses of DataViews in Kibana (including Discover and Alerting Rules).
  • There's one trade-off that fields which only exist in frozen tiers will appear unmapped in Discover and Lens
  • In case there are many historical fields in a frozen tier , the exclusion will lead to faster response time and a reduction of network traffic

resolves #167741

@mattkime mattkime changed the title first pass at excluding fields from frozen indices. [data views] Provide method of excluding data teirs when getting field list Jan 11, 2024
@kertal kertal added the Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// label Jan 11, 2024
@mattkime mattkime changed the title [data views] Provide method of excluding data teirs when getting field list [data views] Provide method of excluding data tiers when getting field list Jan 11, 2024
@mattkime
Copy link
Copy Markdown
Contributor Author

/ci

Comment on lines +15 to +29
export const dataTiersUiSettingsConfig: Record<string, UiSettingsParams> = {
[DATA_VIEWS_FIELDS_EXCLUDED_TIERS]: {
name: i18n.translate('dataViews.advancedSettings.dataTiersName', {
defaultMessage: 'Data tiers excluded from field requests',
}),
value: '',
type: 'string',
description: i18n.translate('dataViews.advancedSettings.dataTiersText', {
defaultMessage:
'Exclude fields from specified tiers (such as data_frozen) for faster performance.',
}),
schema: schema.string(),
},
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ninoslavmiskovic FYI, this is the advanced setting

@kertal
Copy link
Copy Markdown
Member

kertal commented Jan 22, 2024

@mattkime qq: apart from tests, this is done, right?

@mattkime
Copy link
Copy Markdown
Contributor Author

@kertal Exactly!

@mattkime mattkime marked this pull request as ready for review January 22, 2024 22:22
@mattkime mattkime requested review from a team as code owners January 22, 2024 22:22
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@kertal
Copy link
Copy Markdown
Member

kertal commented Jan 22, 2024

great! 👍
Well, ideally we could test for different tiers. but what should already work is, exclude data_content, which then should return no fields at all, exclude data_frozen which should then return all fields... not very granular, but a possible start

Copy link
Copy Markdown
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code-only review. The code changes look good to me, just one minor piece of feedback so far. Including functional tests once we've figured out how would be great, although I'm also not opposed to merging with just unit tests and the tests @kertal suggested for now with additional functional tests as a followup if we think it could be a bit before we're able to add them.

@mattkime mattkime added Feature:Data Views Data Views code and UI - index patterns before 8.0 release_note:feature Makes this part of the condensed release notes labels Jan 30, 2024
Copy link
Copy Markdown
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally using the following sample data (thanks @kertal), and confirmed that adding data_cold to the exclusion list properly excludes cold_field from both the fields and fields_for_wildcard results:


PUT /test-cold
{
  "settings": {
    "index.routing.allocation.include._tier_preference": "data_cold"
  }
}

PUT /test-cold/_doc/1
{
  "cold_field": "test"
}

PUT /test-normal/_doc/1
{
  "normal_field": "test"
}

LGTM 👍 Would you mind adding a followup issue to add functional tests once the necessary QA functionality is merged?

value: '',
type: 'string',
description: i18n.translate('dataViews.advancedSettings.dataTiersText', {
defaultMessage:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth indicating the expected comma-separated format, or do we think users will know what to expect for this?

@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @mattkime

@kertal kertal self-requested a review January 31, 2024 09:07
Copy link
Copy Markdown
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested a-la-carte, excluding data_cold, work as expected, fields are showing up unmapped 👍 thx for bringing this over the finishing line in no time
Bildschirmfoto 2024-01-31 um 10 00 32

@teresaalvarezsoler
Copy link
Copy Markdown
Contributor

Is this something we are also considering for Unified Search when users fetch fields for filtering, queriying, etc.?

@kertal
Copy link
Copy Markdown
Member

kertal commented Feb 1, 2024

@teresaalvarezsoler yes, since AFAIK these fields are provided by data views, so this also applies to these fields (there might be exceptions)

jloleysens added a commit to jloleysens/kibana that referenced this pull request Feb 1, 2024
* main:
  use build hash in FTR tests
  [Security Solution] Fix moderate typo (elastic#175883)
  [Fleet] Fix conflicting dynamic template mappings for intermediate objects (elastic#175970)
  [Visualize] Prevent overwriting managed content (elastic#175274)
  [SLO] Add/edit form mark optional fields (elastic#175807)
  skip failing test suite (elastic#175984)
  [data views] Provide method of excluding data tiers when getting field list (elastic#167946)
  [Dataset quality] State management (elastic#174906)
  [Cloud Security] add is_internal config option for outputs (elastic#175546)
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
…d list (elastic#167946)

## Summary

This PR implements an advanced setting that allows the exclusion of
listed data tiers when getting a field list. The expected common use
case would be excluding frozen indices to speed up slow field caps
calls.

There is no serverless functionality since serverless doesn't have data
tiers.
fkanout pushed a commit to fkanout/kibana that referenced this pull request Mar 4, 2024
…d list (elastic#167946)

## Summary

This PR implements an advanced setting that allows the exclusion of
listed data tiers when getting a field list. The expected common use
case would be excluding frozen indices to speed up slow field caps
calls.

There is no serverless functionality since serverless doesn't have data
tiers.
@mattkime mattkime added backport:prev-minor and removed backport:skip This PR does not require backporting labels Apr 16, 2024
@mattkime mattkime added backport:skip This PR does not require backporting and removed backport:prev-minor v8.14.0 labels Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Data Views Data Views code and UI - index patterns before 8.0 release_note:feature Makes this part of the condensed release notes Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// v8.13.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DataViews] Provide functionality to exclude configured data tiers in Advanced Settings

8 participants