Skip to content
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

[Dataset Quality] Add fix it flow for field limit #195561

Conversation

achyutjhunjhunwala
Copy link
Contributor

@achyutjhunjhunwala achyutjhunjhunwala commented Oct 9, 2024

Summary

Closes #190330

This PR implements the logic to support

  • One click increasing of Field Limit for Field Limit Issues (applicable on for Integrations). For Non Integrations, only text is displayed as to how they can do it.
  • The One click increase updates the linked custom component template as well as the last backing Index
  • If Last Backing Index update fails due to any reason, it provides user an option to trigger a Rollover manually.

Demo

Not possible, to many things to display 😆

What's Pending ?

Tests

  • API tests
    • Settings API
    • Rollover API
    • Apply New limit API
  • FTR tests
    • Displaying of various issues for integrations and non integrations
    • Fix it Flow Good case, without Rollover
    • Fix it Flow Good case, with Rollover
    • Manual Mitigation - Click on Component Template shold navigate to proper logic based on Integration / Non
    • Manual Mitigation - Ingest Pipeline
    • Link for official Documentation

How to setup a local environment

We will be setting up 2 different data streams, one with integration and one without. Please follow the steps in the exact order

  1. Start Local ES and Local Kibana
  2. Install Nginx Integration 1st
  3. Ingest data as per script here - https://gist.github.com/achyutjhunjhunwala/03ea29190c6594544f584d2f0efa71e5
  4. Set the Limit for the 2 datasets
PUT logs-synth.3-default/_settings
{
    "mapping.total_fields.limit": 36
}

// Set the limit for Nginx
PUT logs-nginx.access-default/_settings
{
    "mapping.total_fields.limit": 52
}
  1. Now uncomment line number 59 from the synthtrace script to enable cloud.project.id field and run the scenario again
  2. Do a Rollover
POST logs-synth.3-default/_rollover
POST logs-nginx.access-default/_rollover
  1. Get last backing index for both dataset
GET _data_stream/logs-synth.3-default/
GET _data_stream/logs-nginx.access-default
  1. Increase the Limit by 1 but for last backing index
PUT .ds-logs-synth.3-default-2024.10.10-000002/_settings
{
    "mapping.total_fields.limit": 37
}

PUT .ds-logs-nginx.access-default-2024.10.10-000002/_settings
{
    "mapping.total_fields.limit": 53
}
  1. Run the same Synthtrace scenario again.

This setup will give you 3 fields for testings

  1. cloud.availability_zone - Which will show the character limit isue
  2. cloud.project - Which will show an obsolete error which happened in the past and now does not exists due to field limit
  3. cloud.project.id - A current field limit issue

Copy link
Contributor

@ElenaStoeva ElenaStoeva left a comment

Choose a reason for hiding this comment

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

Index Management locator changes lgtm. Code review only.

@achyutjhunjhunwala achyutjhunjhunwala removed the request for review from tonyghiani October 24, 2024 09:05
@elasticmachine
Copy link
Contributor

elasticmachine commented Oct 24, 2024

💛 Build succeeded, but was flaky

  • Buildkite Build
  • Commit: 2e79d84
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-195561-2e79d84663e0

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #1 / DeleteAttachmentConfirmationModal calls onConfirm

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
datasetQuality 230 240 +10

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/index-management-shared-types 126 124 -2
indexManagement 247 245 -2
total -4

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
datasetQuality 229.8KB 249.1KB +19.3KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
indexManagement 45.8KB 46.1KB +253.0B
Unknown metric groups

API count

id before after diff
@kbn/index-management-shared-types 126 124 -2
indexManagement 252 250 -2
total -4

History

cc @achyutjhunjhunwala

@achyutjhunjhunwala
Copy link
Contributor Author

@elastic/appex-qa FYI only,

I will be on long leave soon and this is a major work getting merged. I have manually tested this PR against the MKI cluster.

Serverless image used from the PR

Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-195561-2e79d84663e0

FTR Tests passed successfully - Using both editor and admin user ✔️

Config Used - config ./x-pack/test_serverless/functional/test_suites/observability/config.ts --include ./x-pack/test_serverless/functional/test_suites/observability/dataset_quality/index.ts

image

Deployment Agnostic Tests passed successfully ✔️

Config Used - --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts --include ./x-pack/test/api_integration/deployment_agnostic/apis/observability/dataset_quality/index.ts

image

@achyutjhunjhunwala achyutjhunjhunwala merged commit 3ece950 into elastic:main Oct 25, 2024
25 checks passed
@achyutjhunjhunwala achyutjhunjhunwala deleted the add-fix-it-flow-for-field-limit branch October 25, 2024 09:20
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11515474718

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 195561

Questions ?

Please refer to the Backport tool documentation

@achyutjhunjhunwala
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

achyutjhunjhunwala added a commit to achyutjhunjhunwala/kibana that referenced this pull request Oct 25, 2024
## Summary

Closes - elastic#190330

This PR implements the logic to support

- One click increasing of Field Limit for Field Limit Issues (applicable
on for Integrations). For Non Integrations, only text is displayed as to
how they can do it.
- The One click increase updates the linked custom component template as
well as the last backing Index
- If Last Backing Index update fails due to any reason, it provides user
an option to trigger a Rollover manually.

## Demo

Not possible, to many things to display 😆

## What's Pending ?

Tests

- [x] API tests
    - [x] Settings API
    - [x] Rollover API
    - [x] Apply New limit API
- [x] FTR tests
- [x] Displaying of various issues for integrations and non integrations
    - [x] Fix it Flow Good case, without Rollover
    - [x] Fix it Flow Good case, with Rollover
- [x] Manual Mitigation - Click on Component Template shold navigate to
proper logic based on Integration / Non
    - [x] Manual Mitigation - Ingest Pipeline
    - [x] Link for official Documentation

 ## How to setup a local environment

We will be setting up 2 different data streams, one with integration and
one without. Please follow the steps in the exact order

1. Start Local ES and Local Kibana
2. Install Nginx Integration 1st
3. Ingest data as per script here -
https://gist.github.com/achyutjhunjhunwala/03ea29190c6594544f584d2f0efa71e5
4. Set the Limit for the 2 datasets

```
PUT logs-synth.3-default/_settings
{
    "mapping.total_fields.limit": 36
}

// Set the limit for Nginx
PUT logs-nginx.access-default/_settings
{
    "mapping.total_fields.limit": 52
}
```

5. Now uncomment line number 59 from the synthtrace script to enable
cloud.project.id field and run the scenario again
6. Do a Rollover

```
POST logs-synth.3-default/_rollover
POST logs-nginx.access-default/_rollover
```

7. Get last backing index for both dataset

```
GET _data_stream/logs-synth.3-default/
GET _data_stream/logs-nginx.access-default
```

8. Increase the Limit by 1 but for last backing index

```
PUT .ds-logs-synth.3-default-2024.10.10-000002/_settings
{
    "mapping.total_fields.limit": 37
}

PUT .ds-logs-nginx.access-default-2024.10.10-000002/_settings
{
    "mapping.total_fields.limit": 53
}
```

9. Run the same Synthtrace scenario again.

This setup will give you 3 fields for testings

1. cloud.availability_zone - Which will show the character limit isue
2. cloud.project - Which will show an obsolete error which happened in
the past and now does not exists due to field limit
3. cloud.project.id - A current field limit issue

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani01@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 3ece950)

# Conflicts:
#	x-pack/test_serverless/functional/test_suites/observability/dataset_quality/degraded_field_flyout.ts
achyutjhunjhunwala added a commit that referenced this pull request Oct 25, 2024
…97817)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Dataset Quality] Add fix it flow for field limit
(#195561)](#195561)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Achyut
Jhunjhunwala","email":"achyut.jhunjhunwala@elastic.co"},"sourceCommit":{"committedDate":"2024-10-25T09:20:26Z","message":"[Dataset
Quality] Add fix it flow for field limit (#195561)\n\n##
Summary\r\n\r\nCloses -
https://github.com/elastic/kibana/issues/190330\r\n\r\nThis PR
implements the logic to support \r\n\r\n- One click increasing of Field
Limit for Field Limit Issues (applicable\r\non for Integrations). For
Non Integrations, only text is displayed as to\r\nhow they can do
it.\r\n- The One click increase updates the linked custom component
template as\r\nwell as the last backing Index\r\n- If Last Backing Index
update fails due to any reason, it provides user\r\nan option to trigger
a Rollover manually.\r\n\r\n## Demo\r\n\r\nNot possible, to many things
to display 😆 \r\n\r\n## What's Pending ?\r\n\r\nTests\r\n\r\n- [x] API
tests\r\n - [x] Settings API\r\n - [x] Rollover API\r\n - [x] Apply New
limit API\r\n- [x] FTR tests\r\n- [x] Displaying of various issues for
integrations and non integrations\r\n - [x] Fix it Flow Good case,
without Rollover\r\n - [x] Fix it Flow Good case, with Rollover\r\n- [x]
Manual Mitigation - Click on Component Template shold navigate
to\r\nproper logic based on Integration / Non\r\n - [x] Manual
Mitigation - Ingest Pipeline\r\n - [x] Link for official
Documentation\r\n \r\n ## How to setup a local environment\r\n \r\nWe
will be setting up 2 different data streams, one with integration
and\r\none without. Please follow the steps in the exact order\r\n
\r\n1. Start Local ES and Local Kibana\r\n2. Install Nginx Integration
1st\r\n3. Ingest data as per script here
-\r\nhttps://gist.github.com/achyutjhunjhunwala/03ea29190c6594544f584d2f0efa71e5\r\n4.
Set the Limit for the 2 datasets\r\n\r\n```\r\nPUT
logs-synth.3-default/_settings\r\n{\r\n \"mapping.total_fields.limit\":
36\r\n}\r\n\r\n// Set the limit for Nginx\r\nPUT
logs-nginx.access-default/_settings\r\n{\r\n
\"mapping.total_fields.limit\": 52\r\n}\r\n```\r\n\r\n5. Now uncomment
line number 59 from the synthtrace script to enable\r\ncloud.project.id
field and run the scenario again\r\n6. Do a Rollover\r\n\r\n```\r\nPOST
logs-synth.3-default/_rollover\r\nPOST
logs-nginx.access-default/_rollover\r\n```\r\n\r\n7. Get last backing
index for both dataset\r\n\r\n```\r\nGET
_data_stream/logs-synth.3-default/\r\nGET
_data_stream/logs-nginx.access-default\r\n```\r\n\r\n8. Increase the
Limit by 1 but for last backing index\r\n\r\n```\r\nPUT
.ds-logs-synth.3-default-2024.10.10-000002/_settings\r\n{\r\n
\"mapping.total_fields.limit\": 37\r\n}\r\n\r\nPUT
.ds-logs-nginx.access-default-2024.10.10-000002/_settings\r\n{\r\n
\"mapping.total_fields.limit\": 53\r\n}\r\n```\r\n\r\n9. Run the same
Synthtrace scenario again.\r\n\r\nThis setup will give you 3 fields for
testings\r\n\r\n1. cloud.availability_zone - Which will show the
character limit isue\r\n2. cloud.project - Which will show an obsolete
error which happened in\r\nthe past and now does not exists due to field
limit\r\n3. cloud.project.id - A current field limit
issue\r\n\r\n---------\r\n\r\nCo-authored-by: Marco Antonio Ghiani
<marcoantonio.ghiani01@gmail.com>\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"3ece9501560ae18bb6c5993db7cc889a6675857c","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["v9.0.0","release_note:feature","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-logs","Feature:Dataset
Health"],"number":195561,"url":"https://github.com/elastic/kibana/pull/195561","mergeCommit":{"message":"[Dataset
Quality] Add fix it flow for field limit (#195561)\n\n##
Summary\r\n\r\nCloses -
https://github.com/elastic/kibana/issues/190330\r\n\r\nThis PR
implements the logic to support \r\n\r\n- One click increasing of Field
Limit for Field Limit Issues (applicable\r\non for Integrations). For
Non Integrations, only text is displayed as to\r\nhow they can do
it.\r\n- The One click increase updates the linked custom component
template as\r\nwell as the last backing Index\r\n- If Last Backing Index
update fails due to any reason, it provides user\r\nan option to trigger
a Rollover manually.\r\n\r\n## Demo\r\n\r\nNot possible, to many things
to display 😆 \r\n\r\n## What's Pending ?\r\n\r\nTests\r\n\r\n- [x] API
tests\r\n - [x] Settings API\r\n - [x] Rollover API\r\n - [x] Apply New
limit API\r\n- [x] FTR tests\r\n- [x] Displaying of various issues for
integrations and non integrations\r\n - [x] Fix it Flow Good case,
without Rollover\r\n - [x] Fix it Flow Good case, with Rollover\r\n- [x]
Manual Mitigation - Click on Component Template shold navigate
to\r\nproper logic based on Integration / Non\r\n - [x] Manual
Mitigation - Ingest Pipeline\r\n - [x] Link for official
Documentation\r\n \r\n ## How to setup a local environment\r\n \r\nWe
will be setting up 2 different data streams, one with integration
and\r\none without. Please follow the steps in the exact order\r\n
\r\n1. Start Local ES and Local Kibana\r\n2. Install Nginx Integration
1st\r\n3. Ingest data as per script here
-\r\nhttps://gist.github.com/achyutjhunjhunwala/03ea29190c6594544f584d2f0efa71e5\r\n4.
Set the Limit for the 2 datasets\r\n\r\n```\r\nPUT
logs-synth.3-default/_settings\r\n{\r\n \"mapping.total_fields.limit\":
36\r\n}\r\n\r\n// Set the limit for Nginx\r\nPUT
logs-nginx.access-default/_settings\r\n{\r\n
\"mapping.total_fields.limit\": 52\r\n}\r\n```\r\n\r\n5. Now uncomment
line number 59 from the synthtrace script to enable\r\ncloud.project.id
field and run the scenario again\r\n6. Do a Rollover\r\n\r\n```\r\nPOST
logs-synth.3-default/_rollover\r\nPOST
logs-nginx.access-default/_rollover\r\n```\r\n\r\n7. Get last backing
index for both dataset\r\n\r\n```\r\nGET
_data_stream/logs-synth.3-default/\r\nGET
_data_stream/logs-nginx.access-default\r\n```\r\n\r\n8. Increase the
Limit by 1 but for last backing index\r\n\r\n```\r\nPUT
.ds-logs-synth.3-default-2024.10.10-000002/_settings\r\n{\r\n
\"mapping.total_fields.limit\": 37\r\n}\r\n\r\nPUT
.ds-logs-nginx.access-default-2024.10.10-000002/_settings\r\n{\r\n
\"mapping.total_fields.limit\": 53\r\n}\r\n```\r\n\r\n9. Run the same
Synthtrace scenario again.\r\n\r\nThis setup will give you 3 fields for
testings\r\n\r\n1. cloud.availability_zone - Which will show the
character limit isue\r\n2. cloud.project - Which will show an obsolete
error which happened in\r\nthe past and now does not exists due to field
limit\r\n3. cloud.project.id - A current field limit
issue\r\n\r\n---------\r\n\r\nCo-authored-by: Marco Antonio Ghiani
<marcoantonio.ghiani01@gmail.com>\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"3ece9501560ae18bb6c5993db7cc889a6675857c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195561","number":195561,"mergeCommit":{"message":"[Dataset
Quality] Add fix it flow for field limit (#195561)\n\n##
Summary\r\n\r\nCloses -
https://github.com/elastic/kibana/issues/190330\r\n\r\nThis PR
implements the logic to support \r\n\r\n- One click increasing of Field
Limit for Field Limit Issues (applicable\r\non for Integrations). For
Non Integrations, only text is displayed as to\r\nhow they can do
it.\r\n- The One click increase updates the linked custom component
template as\r\nwell as the last backing Index\r\n- If Last Backing Index
update fails due to any reason, it provides user\r\nan option to trigger
a Rollover manually.\r\n\r\n## Demo\r\n\r\nNot possible, to many things
to display 😆 \r\n\r\n## What's Pending ?\r\n\r\nTests\r\n\r\n- [x] API
tests\r\n - [x] Settings API\r\n - [x] Rollover API\r\n - [x] Apply New
limit API\r\n- [x] FTR tests\r\n- [x] Displaying of various issues for
integrations and non integrations\r\n - [x] Fix it Flow Good case,
without Rollover\r\n - [x] Fix it Flow Good case, with Rollover\r\n- [x]
Manual Mitigation - Click on Component Template shold navigate
to\r\nproper logic based on Integration / Non\r\n - [x] Manual
Mitigation - Ingest Pipeline\r\n - [x] Link for official
Documentation\r\n \r\n ## How to setup a local environment\r\n \r\nWe
will be setting up 2 different data streams, one with integration
and\r\none without. Please follow the steps in the exact order\r\n
\r\n1. Start Local ES and Local Kibana\r\n2. Install Nginx Integration
1st\r\n3. Ingest data as per script here
-\r\nhttps://gist.github.com/achyutjhunjhunwala/03ea29190c6594544f584d2f0efa71e5\r\n4.
Set the Limit for the 2 datasets\r\n\r\n```\r\nPUT
logs-synth.3-default/_settings\r\n{\r\n \"mapping.total_fields.limit\":
36\r\n}\r\n\r\n// Set the limit for Nginx\r\nPUT
logs-nginx.access-default/_settings\r\n{\r\n
\"mapping.total_fields.limit\": 52\r\n}\r\n```\r\n\r\n5. Now uncomment
line number 59 from the synthtrace script to enable\r\ncloud.project.id
field and run the scenario again\r\n6. Do a Rollover\r\n\r\n```\r\nPOST
logs-synth.3-default/_rollover\r\nPOST
logs-nginx.access-default/_rollover\r\n```\r\n\r\n7. Get last backing
index for both dataset\r\n\r\n```\r\nGET
_data_stream/logs-synth.3-default/\r\nGET
_data_stream/logs-nginx.access-default\r\n```\r\n\r\n8. Increase the
Limit by 1 but for last backing index\r\n\r\n```\r\nPUT
.ds-logs-synth.3-default-2024.10.10-000002/_settings\r\n{\r\n
\"mapping.total_fields.limit\": 37\r\n}\r\n\r\nPUT
.ds-logs-nginx.access-default-2024.10.10-000002/_settings\r\n{\r\n
\"mapping.total_fields.limit\": 53\r\n}\r\n```\r\n\r\n9. Run the same
Synthtrace scenario again.\r\n\r\nThis setup will give you 3 fields for
testings\r\n\r\n1. cloud.availability_zone - Which will show the
character limit isue\r\n2. cloud.project - Which will show an obsolete
error which happened in\r\nthe past and now does not exists due to field
limit\r\n3. cloud.project.id - A current field limit
issue\r\n\r\n---------\r\n\r\nCo-authored-by: Marco Antonio Ghiani
<marcoantonio.ghiani01@gmail.com>\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"3ece9501560ae18bb6c5993db7cc889a6675857c"}}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) ci:project-deploy-observability Create an Observability project Feature:Dataset Health release_note:feature Makes this part of the condensed release notes Team:obs-ux-logs Observability Logs User Experience Team v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dataset Quality] Provide field limit mitigation option with rollover
7 participants