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

[ML] AIOps: Fixes runtime mappings in pattern analysis #188530

Conversation

jgowdyelastic
Copy link
Member

@jgowdyelastic jgowdyelastic commented Jul 17, 2024

Runtime mappings need to be passed to the categorization request factory function and the field validation function.
Initially they were excluded because we only allow pattern analysis on text fields and it is not possible to create a text runtime field.
However it is possible to apply a filter which uses a runtime field and doing so causes pattern analysis to fail.

@walterra I have not investigated log rate analysis' behaviour, in this PR I have just updated the call to createCategoryRequest to pass undefined

To test, create a runtime mapping in the data view. Use this in the query bar or in a filter in Discover and ML's Log Pattern Analysis page.

@jgowdyelastic jgowdyelastic self-assigned this Jul 17, 2024
@jgowdyelastic jgowdyelastic added release_note:fix :ml Feature:ML/AIOps ML AIOps features: Change Point Detection, Log Pattern Analysis, Log Rate Analysis v8.16.0 labels Jul 17, 2024
@jgowdyelastic jgowdyelastic marked this pull request as ready for review July 17, 2024 11:56
@jgowdyelastic jgowdyelastic requested a review from a team as a code owner July 17, 2024 11:56
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

Copy link
Contributor

@walterra walterra left a comment

Choose a reason for hiding this comment

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

Code LGTM, also tested with on the log pattern analysis page in the ML plugin. I added a note to the log rate analysis meta issue that we have to follow up there to consider runtime fields too: #187683

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Tested and LGTM

@darnautov I did a quick test with change point detection, and doesn't look like we support queries / filters on runtime mappings there either?

@jgowdyelastic jgowdyelastic enabled auto-merge (squash) July 19, 2024 13:07
@jgowdyelastic jgowdyelastic merged commit afe3b0f into elastic:main Jul 19, 2024
20 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
aiops 554.7KB 554.9KB +163.0B

History

cc @jgowdyelastic

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 19, 2024
Runtime mappings need to be passed to the categorization request factory
function and the field validation function.
Initially they were excluded because we only allow pattern analysis on
text fields and it is not possible to create a text runtime field.
However it is possible to apply a filter which uses a runtime field and
doing so causes pattern analysis to fail.

@walterra I have not investigated log rate analysis' behaviour, in this
PR I have just updated the call to `createCategoryRequest` to pass
`undefined`

To test, create a runtime mapping in the data view. Use this in the
query bar or in a filter in Discover and ML's Log Pattern Analysis page.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit afe3b0f)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.15

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jul 19, 2024
… (#188759)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[ML] AIOps Fixing runtime mappings in pattern analysis
(#188530)](#188530)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"James
Gowdy","email":"jgowdy@elastic.co"},"sourceCommit":{"committedDate":"2024-07-19T14:38:19Z","message":"[ML]
AIOps Fixing runtime mappings in pattern analysis (#188530)\n\nRuntime
mappings need to be passed to the categorization request
factory\r\nfunction and the field validation function.\r\nInitially they
were excluded because we only allow pattern analysis on\r\ntext fields
and it is not possible to create a text runtime field.\r\nHowever it is
possible to apply a filter which uses a runtime field and\r\ndoing so
causes pattern analysis to fail.\r\n\r\n@walterra I have not
investigated log rate analysis' behaviour, in this\r\nPR I have just
updated the call to `createCategoryRequest` to
pass\r\n`undefined`\r\n\r\nTo test, create a runtime mapping in the data
view. Use this in the\r\nquery bar or in a filter in Discover and ML's
Log Pattern Analysis page.\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"afe3b0f42c5d22d84a5cf06ca37462c6918e3bc5","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","Feature:ML/AIOps","v8.15.0","v8.16.0"],"title":"[ML]
AIOps Fixing runtime mappings in pattern
analysis","number":188530,"url":"#188530
AIOps Fixing runtime mappings in pattern analysis (#188530)\n\nRuntime
mappings need to be passed to the categorization request
factory\r\nfunction and the field validation function.\r\nInitially they
were excluded because we only allow pattern analysis on\r\ntext fields
and it is not possible to create a text runtime field.\r\nHowever it is
possible to apply a filter which uses a runtime field and\r\ndoing so
causes pattern analysis to fail.\r\n\r\n@walterra I have not
investigated log rate analysis' behaviour, in this\r\nPR I have just
updated the call to `createCategoryRequest` to
pass\r\n`undefined`\r\n\r\nTo test, create a runtime mapping in the data
view. Use this in the\r\nquery bar or in a filter in Discover and ML's
Log Pattern Analysis page.\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"afe3b0f42c5d22d84a5cf06ca37462c6918e3bc5"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"#188530
AIOps Fixing runtime mappings in pattern analysis (#188530)\n\nRuntime
mappings need to be passed to the categorization request
factory\r\nfunction and the field validation function.\r\nInitially they
were excluded because we only allow pattern analysis on\r\ntext fields
and it is not possible to create a text runtime field.\r\nHowever it is
possible to apply a filter which uses a runtime field and\r\ndoing so
causes pattern analysis to fail.\r\n\r\n@walterra I have not
investigated log rate analysis' behaviour, in this\r\nPR I have just
updated the call to `createCategoryRequest` to
pass\r\n`undefined`\r\n\r\nTo test, create a runtime mapping in the data
view. Use this in the\r\nquery bar or in a filter in Discover and ML's
Log Pattern Analysis page.\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"afe3b0f42c5d22d84a5cf06ca37462c6918e3bc5"}}]}]
BACKPORT-->

Co-authored-by: James Gowdy <jgowdy@elastic.co>
@peteharverson peteharverson changed the title [ML] AIOps Fixing runtime mappings in pattern analysis [ML] AIOps: Fixing runtime mappings in pattern analysis Jul 23, 2024
@szabosteve szabosteve changed the title [ML] AIOps: Fixing runtime mappings in pattern analysis [ML] AIOps: Fixes runtime mappings in pattern analysis Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:ML/AIOps ML AIOps features: Change Point Detection, Log Pattern Analysis, Log Rate Analysis :ml release_note:fix v8.15.0 v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants