-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into kertal-pr-2020-06-08-improve-discover-hist…
…ogram-test
- Loading branch information
Showing
414 changed files
with
2,618 additions
and
1,239 deletions.
There are no files selected for viewing
12 changes: 6 additions & 6 deletions
12
...mponents/create_index_pattern_wizard/components/header/__snapshots__/header.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
43 changes: 43 additions & 0 deletions
43
x-pack/plugins/apm/public/components/app/Settings/anomaly_detection/legacy_jobs_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,43 @@ | ||
/* | ||
* 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 { EuiCallOut, EuiButton } from '@elastic/eui'; | ||
import React from 'react'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { useApmPluginContext } from '../../../../hooks/useApmPluginContext'; | ||
|
||
export function LegacyJobsCallout() { | ||
const { core } = useApmPluginContext(); | ||
return ( | ||
<EuiCallOut | ||
title={i18n.translate( | ||
'xpack.apm.settings.anomaly_detection.legacy_jobs.title', | ||
{ defaultMessage: 'Legacy ML jobs are no longer used in APM app' } | ||
)} | ||
iconType="iInCircle" | ||
> | ||
<p> | ||
{i18n.translate( | ||
'xpack.apm.settings.anomaly_detection.legacy_jobs.body', | ||
{ | ||
defaultMessage: | ||
'We have discovered legacy Machine Learning jobs from our previous integration which are no longer being used in the APM app', | ||
} | ||
)} | ||
</p> | ||
<EuiButton | ||
href={core.http.basePath.prepend( | ||
'/app/ml#/jobs?mlManagement=(jobId:high_mean_response_time)' | ||
)} | ||
> | ||
{i18n.translate( | ||
'xpack.apm.settings.anomaly_detection.legacy_jobs.button', | ||
{ defaultMessage: 'Review jobs' } | ||
)} | ||
</EuiButton> | ||
</EuiCallOut> | ||
); | ||
} |
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,8 @@ | ||
/* | ||
* 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 const ML_MODULE_ID_APM_TRANSACTION = 'apm_transaction'; | ||
export const APM_ML_JOB_GROUP = 'apm'; |
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
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
22 changes: 22 additions & 0 deletions
22
x-pack/plugins/apm/server/lib/anomaly_detection/get_ml_jobs_by_group.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,22 @@ | ||
/* | ||
* 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 { Setup } from '../helpers/setup_request'; | ||
import { APM_ML_JOB_GROUP } from './constants'; | ||
|
||
// returns ml jobs containing "apm" group | ||
// workaround: the ML api returns 404 when no jobs are found. This is handled so instead of throwing an empty response is returned | ||
export async function getMlJobsWithAPMGroup(ml: NonNullable<Setup['ml']>) { | ||
try { | ||
return await ml.anomalyDetectors.jobs(APM_ML_JOB_GROUP); | ||
} catch (e) { | ||
if (e.statusCode === 404) { | ||
return { count: 0, jobs: [] }; | ||
} | ||
|
||
throw e; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
x-pack/plugins/apm/server/lib/anomaly_detection/has_legacy_jobs.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,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 { Setup } from '../helpers/setup_request'; | ||
import { getMlJobsWithAPMGroup } from './get_ml_jobs_by_group'; | ||
|
||
// Determine whether there are any legacy ml jobs. | ||
// A legacy ML job has a job id that ends with "high_mean_response_time" and created_by=ml-module-apm-transaction | ||
export async function hasLegacyJobs(setup: Setup) { | ||
const { ml } = setup; | ||
|
||
if (!ml) { | ||
return false; | ||
} | ||
|
||
const response = await getMlJobsWithAPMGroup(ml); | ||
return response.jobs.some( | ||
(job) => | ||
job.job_id.endsWith('high_mean_response_time') && | ||
job.custom_settings?.created_by === 'ml-module-apm-transaction' | ||
); | ||
} |
Oops, something went wrong.