mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[ML] AIOps: Using no minimum time range by default for pattern analysis (#191192)
Changing the default selection from `1 week` to `No minimum`. For indices with very large doc counts, it is safer not to query a week's worth of data by default, but rather use the time range selected in the time picker.
This commit is contained in:
parent
38f4aa0776
commit
525d9f6899
4 changed files with 16 additions and 6 deletions
|
@ -158,7 +158,12 @@ export const PatternAnalysisSettings: FC<PatternAnalysisSettingsProps> = ({
|
|||
values={{ minimumTimeRangeOption, categoryCount }}
|
||||
/>
|
||||
</>
|
||||
) : null}
|
||||
) : (
|
||||
<FormattedMessage
|
||||
id="xpack.aiops.logCategorization.embeddableMenu.totalPatternsMessage2"
|
||||
defaultMessage="No additional time will be added to the range you specified with the time selector."
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
}
|
||||
>
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import type { unitOfTime } from 'moment';
|
||||
|
||||
export const DEFAULT_MINIMUM_TIME_RANGE_OPTION: MinimumTimeRangeOption = 'No minimum';
|
||||
|
||||
export type MinimumTimeRangeOption = 'No minimum' | '1 week' | '1 month' | '3 months' | '6 months';
|
||||
|
||||
type MinimumTimeRange = Record<
|
||||
|
@ -17,7 +19,7 @@ type MinimumTimeRange = Record<
|
|||
export const MINIMUM_TIME_RANGE: MinimumTimeRange = {
|
||||
'No minimum': {
|
||||
label: i18n.translate('xpack.aiops.logCategorization.minimumTimeRange.noMin', {
|
||||
defaultMessage: 'No minimum',
|
||||
defaultMessage: 'Use range specified in time selector',
|
||||
}),
|
||||
factor: 0,
|
||||
unit: 'w',
|
||||
|
|
|
@ -15,7 +15,7 @@ import { useStorage } from '@kbn/ml-local-storage';
|
|||
import type { MappingRuntimeFields } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import { useAiopsAppContext } from '../../../hooks/use_aiops_app_context';
|
||||
import type { MinimumTimeRangeOption } from './minimum_time_range';
|
||||
import { MINIMUM_TIME_RANGE } from './minimum_time_range';
|
||||
import { DEFAULT_MINIMUM_TIME_RANGE_OPTION, MINIMUM_TIME_RANGE } from './minimum_time_range';
|
||||
import type { AiOpsKey, AiOpsStorageMapped } from '../../../types/storage';
|
||||
import { AIOPS_PATTERN_ANALYSIS_MINIMUM_TIME_RANGE_PREFERENCE } from '../../../types/storage';
|
||||
|
||||
|
@ -85,7 +85,7 @@ export function useMinimumTimeRange() {
|
|||
const [minimumTimeRangeOption, setMinimumTimeRangeOption] = useStorage<
|
||||
AiOpsKey,
|
||||
AiOpsStorageMapped<typeof AIOPS_PATTERN_ANALYSIS_MINIMUM_TIME_RANGE_PREFERENCE>
|
||||
>(AIOPS_PATTERN_ANALYSIS_MINIMUM_TIME_RANGE_PREFERENCE, '1 week');
|
||||
>(AIOPS_PATTERN_ANALYSIS_MINIMUM_TIME_RANGE_PREFERENCE, DEFAULT_MINIMUM_TIME_RANGE_OPTION);
|
||||
|
||||
const cancelRequest = useCallback(() => {
|
||||
abortController.current.abort();
|
||||
|
|
|
@ -38,7 +38,10 @@ import {
|
|||
DEFAULT_PROBABILITY,
|
||||
RANDOM_SAMPLER_OPTION,
|
||||
} from '../../components/log_categorization/sampling_menu/random_sampler';
|
||||
import type { MinimumTimeRangeOption } from '../../components/log_categorization/log_categorization_for_embeddable/minimum_time_range';
|
||||
import {
|
||||
DEFAULT_MINIMUM_TIME_RANGE_OPTION,
|
||||
type MinimumTimeRangeOption,
|
||||
} from '../../components/log_categorization/log_categorization_for_embeddable/minimum_time_range';
|
||||
import { getMessageField } from '../../components/log_categorization/utils';
|
||||
import { FieldSelector } from '../../components/log_categorization/log_categorization_for_embeddable/field_selector';
|
||||
import { SamplingPanel } from '../../components/log_categorization/sampling_menu/sampling_panel';
|
||||
|
@ -67,7 +70,7 @@ export const PatternAnalysisEmbeddableInitializer: FC<PatternAnalysisInitializer
|
|||
const [formInput, setFormInput] = useState<PatternAnalysisEmbeddableRuntimeState>(
|
||||
pick(
|
||||
initialInput ?? {
|
||||
minimumTimeRangeOption: '1 week',
|
||||
minimumTimeRangeOption: DEFAULT_MINIMUM_TIME_RANGE_OPTION,
|
||||
randomSamplerMode: RANDOM_SAMPLER_OPTION.ON_AUTOMATIC,
|
||||
randomSamplerProbability: DEFAULT_PROBABILITY,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue