-
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.
Browse files
Browse the repository at this point in the history
…90827) * add anomaly threshold configuration to settings * hide panel if not ml capable * send threshold value to query * update license * update api integration to expect anomalyThreshold to exist * add some tests to the anomaly queries * change type to number * api validate in source update and config for anamolyThreshold and tests Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
fa8adf1
commit 277fe42
Showing
29 changed files
with
441 additions
and
28 deletions.
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
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
85 changes: 85 additions & 0 deletions
85
x-pack/plugins/infra/public/components/source_configuration/ml_configuration_panel.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,85 @@ | ||
/* | ||
* 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 { EuiTitle } from '@elastic/eui'; | ||
import { EuiSpacer } from '@elastic/eui'; | ||
import { EuiFormRow } from '@elastic/eui'; | ||
import { EuiRange } from '@elastic/eui'; | ||
import { EuiDescribedFormGroup } from '@elastic/eui'; | ||
import { EuiForm } from '@elastic/eui'; | ||
import React from 'react'; | ||
import { FormattedMessage } from 'react-intl'; | ||
import { InputRangeFieldProps } from './input_fields'; | ||
|
||
interface MLConfigurationPanelProps { | ||
isLoading: boolean; | ||
readOnly: boolean; | ||
anomalyThresholdFieldProps: InputRangeFieldProps; | ||
} | ||
|
||
export const MLConfigurationPanel = ({ | ||
isLoading, | ||
readOnly, | ||
anomalyThresholdFieldProps, | ||
}: MLConfigurationPanelProps) => { | ||
return ( | ||
<EuiForm> | ||
<EuiTitle size="s"> | ||
<h3> | ||
<FormattedMessage | ||
id="xpack.infra.sourceConfiguration.mlSectionTitle" | ||
defaultMessage="Machine Learning" | ||
/> | ||
</h3> | ||
</EuiTitle> | ||
<EuiSpacer size="m" /> | ||
<EuiDescribedFormGroup | ||
title={ | ||
<h4> | ||
<FormattedMessage | ||
id="xpack.infra.sourceConfiguration.anomalyThresholdTitle" | ||
defaultMessage="Anomaly Severity Threshold" | ||
/> | ||
</h4> | ||
} | ||
description={ | ||
<FormattedMessage | ||
id="xpack.infra.sourceConfiguration.anomalyThresholdDescription" | ||
defaultMessage="Sets the minimum severity score required to show anomalies in the Metrics application." | ||
/> | ||
} | ||
> | ||
<EuiFormRow | ||
error={anomalyThresholdFieldProps.error} | ||
fullWidth | ||
isInvalid={anomalyThresholdFieldProps.isInvalid} | ||
label={ | ||
<FormattedMessage | ||
id="xpack.infra.sourceConfiguration.anomalyThresholdLabel" | ||
defaultMessage="Minimum severity score" | ||
/> | ||
} | ||
> | ||
<EuiRange | ||
min={0} | ||
max={100} | ||
data-test-subj="anomalyThresholdInput" | ||
showInput | ||
showTicks | ||
showRange | ||
tickInterval={20} | ||
aria-label="Minimum severity score" | ||
disabled={isLoading} | ||
readOnly={readOnly} | ||
isLoading={isLoading} | ||
{...anomalyThresholdFieldProps} | ||
/> | ||
</EuiFormRow> | ||
</EuiDescribedFormGroup> | ||
</EuiForm> | ||
); | ||
}; |
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
Oops, something went wrong.