-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Logs UI] Add ML job status callouts to results page #47642
Merged
weltenwort
merged 100 commits into
elastic:master
from
weltenwort:logs-ui-analysis-add-job-status-callouts
Oct 15, 2019
Merged
Changes from all commits
Commits
Show all changes
100 commits
Select commit
Hold shift + click to select a range
4adc91d
Amend outer page / panel structure
Kerry350 62c7a6b
Remove unused imports
Kerry350 9793f4c
Merge remote-tracking branch 'upstream/master' into 47201-adapt-log-e…
Kerry350 0cefd23
Add anomalies section and overall chart
Kerry350 b5f3bf8
Merge remote-tracking branch 'upstream/master' into 47201-adapt-log-e…
Kerry350 7524569
Add legend
Kerry350 4119a05
Rename dataSet to partition
weltenwort 8d887a8
Add max bucket anomaly score
weltenwort 6ff0634
Move job and setup status types to common
weltenwort 5eeefce
Move initial job status fetching into page content
weltenwort 43c2edf
Poll for job status on results page
weltenwort bb157fd
Merge branch '47201-adapt-log-entry-rate-data-vis' of github.com:Kerr…
Kerry350 7811629
Add table / expanded row charts
Kerry350 ae059f0
Add bucket span text
Kerry350 a3820b7
Add stat section to expanded rows
Kerry350 1e8678d
Amend annotations on overall graph
Kerry350 427105d
Add rule to account for EuiFlexItem edge case
Kerry350 123084b
Move functions that handle derivations of data to a new file
Kerry350 737a25d
Tweak data points fetched
Kerry350 ded5117
Style bars in grey for anomalies charts
Kerry350 94fdb76
Add severity scoring to annotations
Kerry350 25d6e54
Fix default
Kerry350 7be35d2
Remove decimal places from anomaly score representations
Kerry350 a3d81da
Show all partitions and overall anomaly score in annotation tooltip f…
Kerry350 2f7855e
Handle 'unknown' to workaround lack of '' suuport in tables
Kerry350 78750b3
Add stats section to overall anomalies section
Kerry350 7e72fe4
Base x-domain off the series so that certain buckets aren't omitted
Kerry350 cb3d525
Tweak colours and DRY up annotation rendering
Kerry350 9db1834
Add sorting to table
Kerry350 a0908da
Merge remote-tracking branch 'upstream/master' into 47201-adapt-log-e…
Kerry350 fd26252
Add "number of logs" to API results and render in UI stats
Kerry350 2569bc8
Track and render out-of-sync job configurations
weltenwort 1813c80
Adjust translation labels
weltenwort ced21c8
Add stopped state callout
weltenwort 992a7c5
Add more callout icons
weltenwort 5591652
Merge branch 'master' into logs-ui-analysis-add-job-status-callouts
weltenwort 87074d1
Fix api integration tests
weltenwort e453e07
Merge remote-tracking branch 'upstream/master' into 47201-adapt-log-e…
Kerry350 3e181b0
Use "pretty" numbers for "Number of logs" stats
Kerry350 d65af63
Merge branch 'master' into logs-ui-analysis-add-job-status-callouts
weltenwort ce095aa
Improve status message wording
weltenwort c92615d
Change recreate job button color back to default
weltenwort bb01766
Add toolbar text
Kerry350 6100b51
Format all y axis values to 3 digits
Kerry350 36c7cb9
Remove "Overall anomaly score" and change all wording / calculations …
Kerry350 af7833c
Merge branch '47201-adapt-log-entry-rate-data-vis' of github.com:Kerr…
Kerry350 3031b69
Sort anomaly maximum scores for the overall chart tooltip
Kerry350 fbe41af
Remove unused translations
Kerry350 5f85146
Use white text with badge in toolbar
Kerry350 4df0469
Merge branch 'master' into logs-ui-analysis-add-job-status-callouts
weltenwort af01a97
Merge remote-tracking branch 'upstream/master' into 47201-adapt-log-e…
Kerry350 f329127
Factor out a job recreation callout
weltenwort 6e7f872
Replace `filter()[0]` with `find()` call
weltenwort 40dbb59
Amend key
Kerry350 8e215d3
Use Math.round and introduce a formatAnomalyScore helper function
Kerry350 19ef762
Update x-pack/legacy/plugins/infra/public/pages/logs/analysis/section…
Kerry350 32833e6
Update x-pack/legacy/plugins/infra/public/pages/logs/analysis/section…
Kerry350 e732f5d
Format y-axis of log entry rate chart the same as anomalies charts
Kerry350 1548e14
Update x-pack/legacy/plugins/infra/public/pages/logs/analysis/section…
Kerry350 b1a743a
Merge branch '47201-adapt-log-entry-rate-data-vis' of github.com:Kerr…
Kerry350 b76bf02
Remove grow prop
Kerry350 1cb4143
Update x-pack/legacy/plugins/infra/common/http_api/log_analysis/resul…
Kerry350 cadd37f
Update x-pack/legacy/plugins/infra/common/http_api/log_analysis/resul…
Kerry350 79c4e21
Update x-pack/legacy/plugins/infra/server/routes/log_analysis/results…
Kerry350 63aca0b
Update x-pack/legacy/plugins/infra/public/pages/logs/analysis/page_re…
Kerry350 7bd5708
Update x-pack/legacy/plugins/infra/public/pages/logs/analysis/section…
Kerry350 ee60082
Update x-pack/legacy/plugins/infra/public/pages/logs/analysis/section…
Kerry350 157ddd8
Update x-pack/legacy/plugins/infra/server/routes/log_analysis/results…
Kerry350 e4ed1d1
Update x-pack/legacy/plugins/infra/public/pages/logs/analysis/section…
Kerry350 eb0b34a
Update x-pack/legacy/plugins/infra/public/pages/logs/analysis/section…
Kerry350 a685a43
Update x-pack/legacy/plugins/infra/public/pages/logs/analysis/section…
Kerry350 ad530c7
Update x-pack/legacy/plugins/infra/public/pages/logs/analysis/section…
Kerry350 4c3f3f0
Update x-pack/legacy/plugins/infra/public/pages/logs/analysis/section…
Kerry350 ad81285
Update x-pack/legacy/plugins/infra/public/pages/logs/analysis/section…
Kerry350 0ce5bf6
Update x-pack/legacy/plugins/infra/public/pages/logs/analysis/section…
Kerry350 1c587f1
Update x-pack/legacy/plugins/infra/public/pages/logs/analysis/section…
Kerry350 8b7535c
Update x-pack/legacy/plugins/infra/public/pages/logs/analysis/section…
Kerry350 b52d9c1
Update x-pack/legacy/plugins/infra/public/pages/logs/analysis/section…
Kerry350 4bdfcfb
Update x-pack/legacy/plugins/infra/server/lib/log_analysis/log_analys…
Kerry350 a32f8e5
Update x-pack/legacy/plugins/infra/server/lib/log_analysis/log_analys…
Kerry350 8e31a6c
Update x-pack/legacy/plugins/infra/server/routes/log_analysis/results…
Kerry350 721b7f8
Update x-pack/legacy/plugins/infra/server/routes/log_analysis/results…
Kerry350 914790e
Merge branch '47201-adapt-log-entry-rate-data-vis' of github.com:Kerr…
Kerry350 a491bff
Change path
Kerry350 f7787bd
Amend property name
Kerry350 305cdf4
Use proper default value argument
Kerry350 7f468b4
Use Kibana dateFormat setting for toolbar formatting
Kerry350 7fa26ed
Change logic for calculating severity score categories
Kerry350 d01e5f1
Add missing translations
Kerry350 a1493ce
Add interface to top of file
Kerry350 8197183
Add no-wrap to tooltip
Kerry350 5bcad0d
Use more idomatic code
Kerry350 a5d6e45
Use static value for series styles
Kerry350 abae288
Merge remote-tracking branch 'upstream/master' into 47201-adapt-log-e…
Kerry350 a688c3b
Merge branch '47201-adapt-log-entry-rate-data-vis' into logs-ui-analy…
weltenwort 2727c69
Move the callouts into the right location
weltenwort ae7de65
Fix linter warning
weltenwort 949ffa1
Add non-functional ML link button
weltenwort b4267a3
Merge branch 'master' into logs-ui-analysis-add-job-status-callouts
weltenwort 8828a9d
Fix merge mistake
weltenwort File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
x-pack/legacy/plugins/infra/public/components/logging/log_analysis_job_status/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export * from './log_analysis_job_problem_indicator'; |
29 changes: 29 additions & 0 deletions
29
.../public/components/logging/log_analysis_job_status/job_configuration_outdated_callout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import React from 'react'; | ||
|
||
import { RecreateJobCallout } from './recreate_job_callout'; | ||
|
||
export const JobConfigurationOutdatedCallout: React.FC<{ | ||
onRecreateMlJob: () => void; | ||
}> = ({ onRecreateMlJob }) => ( | ||
<RecreateJobCallout title={jobConfigurationOutdatedTitle} onRecreateMlJob={onRecreateMlJob}> | ||
<FormattedMessage | ||
id="xpack.infra.logs.analysis.jobConfigurationOutdatedCalloutMessage" | ||
defaultMessage="The ML job was created using a different source configuration. Recreate the job to apply the current configuration. This removes previously detected anomalies." | ||
/> | ||
</RecreateJobCallout> | ||
); | ||
|
||
const jobConfigurationOutdatedTitle = i18n.translate( | ||
'xpack.infra.logs.analysis.jobConfigurationOutdatedCalloutTitle', | ||
{ | ||
defaultMessage: 'ML job configuration outdated', | ||
} | ||
); |
29 changes: 29 additions & 0 deletions
29
...fra/public/components/logging/log_analysis_job_status/job_definition_outdated_callout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import React from 'react'; | ||
|
||
import { RecreateJobCallout } from './recreate_job_callout'; | ||
|
||
export const JobDefinitionOutdatedCallout: React.FC<{ | ||
onRecreateMlJob: () => void; | ||
}> = ({ onRecreateMlJob }) => ( | ||
<RecreateJobCallout title={jobDefinitionOutdatedTitle} onRecreateMlJob={onRecreateMlJob}> | ||
<FormattedMessage | ||
id="xpack.infra.logs.analysis.jobDefinitionOutdatedCalloutMessage" | ||
defaultMessage="A newer version of the ML job is available. Recreate the job to deploy the newer version. This removes previously detected anomalies." | ||
/> | ||
</RecreateJobCallout> | ||
); | ||
|
||
const jobDefinitionOutdatedTitle = i18n.translate( | ||
'xpack.infra.logs.analysis.jobDefinitionOutdatedCalloutTitle', | ||
{ | ||
defaultMessage: 'ML job definition outdated', | ||
} | ||
); |
24 changes: 24 additions & 0 deletions
24
...y/plugins/infra/public/components/logging/log_analysis_job_status/job_stopped_callout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { EuiCallOut } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
|
||
export const JobStoppedCallout: React.FC = () => ( | ||
<EuiCallOut color="primary" iconType="pause" title={jobStoppedTitle}> | ||
<FormattedMessage | ||
id="xpack.infra.logs.analysis.jobStoppedCalloutMessage" | ||
defaultMessage="The ML job has been stopped manually or due to a lack of resources. New log entries will not be processed until the job has been restarted." | ||
tagName="p" | ||
/> | ||
</EuiCallOut> | ||
); | ||
|
||
const jobStoppedTitle = i18n.translate('xpack.infra.logs.analysis.jobStoppedCalloutTitle', { | ||
defaultMessage: 'ML job stopped', | ||
}); |
29 changes: 29 additions & 0 deletions
29
.../public/components/logging/log_analysis_job_status/log_analysis_job_problem_indicator.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { JobStatus, SetupStatus } from '../../../../common/log_analysis'; | ||
import { JobConfigurationOutdatedCallout } from './job_configuration_outdated_callout'; | ||
import { JobDefinitionOutdatedCallout } from './job_definition_outdated_callout'; | ||
import { JobStoppedCallout } from './job_stopped_callout'; | ||
|
||
export const LogAnalysisJobProblemIndicator: React.FC<{ | ||
jobStatus: JobStatus; | ||
setupStatus: SetupStatus; | ||
onRecreateMlJobForReconfiguration: () => void; | ||
onRecreateMlJobForUpdate: () => void; | ||
}> = ({ jobStatus, setupStatus, onRecreateMlJobForReconfiguration, onRecreateMlJobForUpdate }) => { | ||
if (jobStatus === 'stopped') { | ||
return <JobStoppedCallout />; | ||
} else if (setupStatus === 'skippedButUpdatable') { | ||
return <JobDefinitionOutdatedCallout onRecreateMlJob={onRecreateMlJobForUpdate} />; | ||
} else if (setupStatus === 'skippedButReconfigurable') { | ||
return <JobConfigurationOutdatedCallout onRecreateMlJob={onRecreateMlJobForReconfiguration} />; | ||
} | ||
|
||
return null; // no problem to indicate | ||
}; |
24 changes: 24 additions & 0 deletions
24
.../plugins/infra/public/components/logging/log_analysis_job_status/recreate_job_callout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { EuiCallOut, EuiButton } from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
|
||
export const RecreateJobCallout: React.FC<{ | ||
onRecreateMlJob: () => void; | ||
title?: React.ReactNode; | ||
}> = ({ children, onRecreateMlJob, title }) => ( | ||
<EuiCallOut color="warning" iconType="alert" title={title}> | ||
<p>{children}</p> | ||
<EuiButton color="warning" onClick={onRecreateMlJob}> | ||
<FormattedMessage | ||
id="xpack.infra.logs.analysis.recreateJobButtonLabel" | ||
defaultMessage="Recreate ML job" | ||
/> | ||
</EuiButton> | ||
</EuiCallOut> | ||
); |
16 changes: 16 additions & 0 deletions
16
x-pack/legacy/plugins/infra/public/containers/logs/log_analysis/api/ml_api_types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import * as rt from 'io-ts'; | ||
|
||
export const jobCustomSettingsRT = rt.partial({ | ||
job_revision: rt.number, | ||
logs_source_config: rt.partial({ | ||
indexPattern: rt.string, | ||
timestampField: rt.string, | ||
bucketSpan: rt.number, | ||
}), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
x-pack/legacy/plugins/infra/public/containers/logs/log_analysis/api/ml_get_module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { fold } from 'fp-ts/lib/Either'; | ||
import { pipe } from 'fp-ts/lib/pipeable'; | ||
import { identity } from 'fp-ts/lib/function'; | ||
import * as rt from 'io-ts'; | ||
import { kfetch } from 'ui/kfetch'; | ||
|
||
import { throwErrors, createPlainError } from '../../../../../common/runtime_types'; | ||
import { jobCustomSettingsRT } from './ml_api_types'; | ||
|
||
export const callGetMlModuleAPI = async (moduleId: string) => { | ||
const response = await kfetch({ | ||
method: 'GET', | ||
pathname: `/api/ml/modules/get_module/${moduleId}`, | ||
}); | ||
|
||
return pipe( | ||
getMlModuleResponsePayloadRT.decode(response), | ||
fold(throwErrors(createPlainError), identity) | ||
); | ||
}; | ||
|
||
const jobDefinitionRT = rt.type({ | ||
id: rt.string, | ||
config: rt.type({ | ||
custom_settings: jobCustomSettingsRT, | ||
}), | ||
}); | ||
|
||
export type JobDefinition = rt.TypeOf<typeof jobDefinitionRT>; | ||
|
||
const getMlModuleResponsePayloadRT = rt.type({ | ||
id: rt.string, | ||
jobs: rt.array(jobDefinitionRT), | ||
}); | ||
|
||
export type GetMlModuleResponsePayload = rt.TypeOf<typeof getMlModuleResponsePayloadRT>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍