forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] Log pattern analysis non time series check (elastic#160021)
Adds the check for non-time series data views to the Log Pattern Analysis. As all three AIOPs features now have the same check, I moved it to a common component. Part of elastic#159355
- Loading branch information
1 parent
2422c01
commit 851b641
Showing
8 changed files
with
75 additions
and
67 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
x-pack/plugins/aiops/public/application/utils/time_series_dataview_check.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,50 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { EuiCallOut } from '@elastic/eui'; | ||
|
||
import type { DataView } from '@kbn/data-views-plugin/common'; | ||
import { i18n } from '@kbn/i18n'; | ||
|
||
export function timeSeriesDataViewWarning( | ||
dataView: DataView, | ||
feature: 'change_point_detection' | 'log_categorization' | 'explain_log_rate_spikes' | ||
) { | ||
if (dataView.isTimeBased()) { | ||
return null; | ||
} | ||
|
||
let description = ''; | ||
if (feature === 'change_point_detection') { | ||
description = i18n.translate('xpack.aiops.changePointTimeSeriesWarning.description', { | ||
defaultMessage: 'Change point detection only runs over time-based indices.', | ||
}); | ||
} else if (feature === 'log_categorization') { | ||
description = i18n.translate('xpack.aiops.logCategorizationTimeSeriesWarning.description', { | ||
defaultMessage: 'Log pattern analysis only runs over time-based indices.', | ||
}); | ||
} else if (feature === 'explain_log_rate_spikes') { | ||
description = i18n.translate('xpack.aiops.logRateSpikesTimeSeriesWarning.description', { | ||
defaultMessage: 'Log rate spikes only runs over time-based indices.', | ||
}); | ||
} | ||
|
||
return ( | ||
<EuiCallOut | ||
title={i18n.translate('xpack.aiops.dataViewNotBasedOnTimeSeriesWarning.title', { | ||
defaultMessage: 'The data view "{dataViewTitle}" is not based on a time series.', | ||
values: { dataViewTitle: dataView.getName() }, | ||
})} | ||
color="danger" | ||
iconType="warning" | ||
> | ||
<p>{description}</p> | ||
</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
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
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