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

[8.6][ML Inference] New API to fetch ML inference errors #142799

Merged

Conversation

demjened
Copy link
Contributor

@demjened demjened commented Oct 5, 2022

Summary

This PR adds a new endpoint for fetching aggregated ML inference errors from the target index. It returns the error message, affected document count, and the last error's timestamp for each distinct error.

Endpoint

GET /internal/enterprise_search/indices/{indexName}/ml_inference/errors

Sample response

{
    "errors": [
        {
            "message": "Processor 'inference' in pipeline 'ml-inference-my-ner-pipeline' failed with message 'Trained model [philschmid__distilroberta-base-ner-conll2003] is not deployed.'",
            "doc_count": 21,
            "timestamp": "2022-10-05T13:50:36.619Z"
        },
        {
            "message": "Processor 'inference' in pipeline 'ml-inference-my-text-embedding-pipeline' failed with message 'Input field [text_field] does not exist in the source document'",
            "doc_count": 21,
            "timestamp": "2022-10-05T13:50:36.619Z"
        }
    ]
}

Checklist

demjened and others added 30 commits September 13, 2022 13:47
@demjened demjened force-pushed the demjened/api-fetch-ml-inference-errors branch from ec53fe6 to 60360fe Compare October 5, 2022 21:18
@demjened demjened force-pushed the demjened/api-fetch-ml-inference-errors branch from 8d5c1f9 to d7b98f5 Compare October 5, 2022 22:12
@demjened demjened added backport:skip This commit does not require backporting Team:EnterpriseSearch v8.6.0 labels Oct 5, 2022
@demjened demjened changed the title [WIP][8.6][ML Inference] New API to fetch ML inference errors [8.6][ML Inference] New API to fetch ML inference errors Oct 5, 2022
@demjened demjened marked this pull request as ready for review October 5, 2022 22:24
@demjened demjened requested a review from a team October 5, 2022 22:24
@demjened demjened added the release_note:feature Makes this part of the condensed release notes label Oct 5, 2022
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

  • 💔 Build #78546 failed ec53fe6e2b53bf484c1768efeed4dd0da2225fb1

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


import { ElasticsearchClient } from '@kbn/core/server';

export interface MlInferenceError {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be defined in the common/types folder so we can import it from the frontend when calling this API.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll refactor this in the frontend follow-up PR.


import { ElasticsearchClient } from '@kbn/core/server';

export interface MlInferenceError {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'll refactor this in the frontend follow-up PR.

@TattdCodeMonkey TattdCodeMonkey added release_note:skip Skip the PR/issue when compiling release notes and removed release_note:feature Makes this part of the condensed release notes labels Oct 6, 2022
@TattdCodeMonkey TattdCodeMonkey merged commit c723fd8 into elastic:main Oct 6, 2022
const searchResult = await esClient.search<
unknown,
{
errors: AggregationsMultiBucketAggregateBase<ErrorAggregationBucket>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is there a semicolon at the end of this line? 🤔

Copy link
Member

Choose a reason for hiding this comment

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

It is a type declaration, so it follows the same pattern similar to the line 21

WafaaNasr pushed a commit to WafaaNasr/kibana that referenced this pull request Oct 11, 2022
)

* Add ML inference PL creation flow

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Add exists check, clean up code a bit

* Fix dest name

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Separate concerns

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Remove i18n due to linter error, fix src field ref

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Add/update unit tests

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Refactor error handling

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Add sub-pipeline to parent ML PL

* Add unit tests and docs

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Refactor error handling

* Wrap logic into higher level function

* Add route test

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* API to fetch inference errors

* Minor style changes

* Add unit tests

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: kibanamachine <[email protected]>
WafaaNasr pushed a commit to WafaaNasr/kibana that referenced this pull request Oct 14, 2022
)

* Add ML inference PL creation flow

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Add exists check, clean up code a bit

* Fix dest name

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Separate concerns

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Remove i18n due to linter error, fix src field ref

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Add/update unit tests

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Refactor error handling

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Add sub-pipeline to parent ML PL

* Add unit tests and docs

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Refactor error handling

* Wrap logic into higher level function

* Add route test

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* API to fetch inference errors

* Minor style changes

* Add unit tests

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: kibanamachine <[email protected]>
@demjened demjened deleted the demjened/api-fetch-ml-inference-errors branch October 14, 2022 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:EnterpriseSearch v8.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants