[ML] AIOps: Move code from plugins/aiops/common to packages. (#179178)

## Summary

This moves code from `plugins/aiops/common` to packages. The `aiops`
plugin will from now on have only a `server` and `public` directory.
This is in preparation for additional AIOps related public APIs and to
avoid cyclic dependency problems for other consuming plugins.

- Package `@kbn/aiops-utils` was renamed to `@kbn/aiops-common`.
- For each AIOps feature a package was created:
`@kbn/aiops-change-point-detection`, `@kbn/aiops-log-pattern-analysis`
and `@kbn/aiops-log-rate-analysis`.

### Checklist

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
This commit is contained in:
Walter Rafelsberger 2024-03-28 18:40:36 +01:00 committed by GitHub
parent 79a1b26d84
commit bb33a8e78b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
206 changed files with 524 additions and 366 deletions

5
.github/CODEOWNERS vendored
View file

@ -12,10 +12,13 @@ x-pack/test/alerting_api_integration/common/plugins/actions_simulators @elastic/
packages/kbn-actions-types @elastic/response-ops
src/plugins/advanced_settings @elastic/appex-sharedux @elastic/kibana-management
src/plugins/ai_assistant_management/selection @elastic/obs-knowledge-team
x-pack/packages/ml/aiops_change_point_detection @elastic/ml-ui
x-pack/packages/ml/aiops_common @elastic/ml-ui
x-pack/packages/ml/aiops_components @elastic/ml-ui
x-pack/packages/ml/aiops_log_pattern_analysis @elastic/ml-ui
x-pack/packages/ml/aiops_log_rate_analysis @elastic/ml-ui
x-pack/plugins/aiops @elastic/ml-ui
x-pack/packages/ml/aiops_test_utils @elastic/ml-ui
x-pack/packages/ml/aiops_utils @elastic/ml-ui
x-pack/test/alerting_api_integration/packages/helpers @elastic/response-ops
x-pack/test/alerting_api_integration/common/plugins/alerts @elastic/response-ops
x-pack/examples/alerting_example @elastic/response-ops

View file

@ -140,10 +140,13 @@
"@kbn/actions-types": "link:packages/kbn-actions-types",
"@kbn/advanced-settings-plugin": "link:src/plugins/advanced_settings",
"@kbn/ai-assistant-management-plugin": "link:src/plugins/ai_assistant_management/selection",
"@kbn/aiops-change-point-detection": "link:x-pack/packages/ml/aiops_change_point_detection",
"@kbn/aiops-common": "link:x-pack/packages/ml/aiops_common",
"@kbn/aiops-components": "link:x-pack/packages/ml/aiops_components",
"@kbn/aiops-log-pattern-analysis": "link:x-pack/packages/ml/aiops_log_pattern_analysis",
"@kbn/aiops-log-rate-analysis": "link:x-pack/packages/ml/aiops_log_rate_analysis",
"@kbn/aiops-plugin": "link:x-pack/plugins/aiops",
"@kbn/aiops-test-utils": "link:x-pack/packages/ml/aiops_test_utils",
"@kbn/aiops-utils": "link:x-pack/packages/ml/aiops_utils",
"@kbn/alerting-api-integration-test-plugin": "link:x-pack/test/alerting_api_integration/common/plugins/alerts",
"@kbn/alerting-example-plugin": "link:x-pack/examples/alerting_example",
"@kbn/alerting-fixture-plugin": "link:x-pack/test/functional_with_es_ssl/plugins/alerts",

View file

@ -18,14 +18,20 @@
"@kbn/advanced-settings-plugin/*": ["src/plugins/advanced_settings/*"],
"@kbn/ai-assistant-management-plugin": ["src/plugins/ai_assistant_management/selection"],
"@kbn/ai-assistant-management-plugin/*": ["src/plugins/ai_assistant_management/selection/*"],
"@kbn/aiops-change-point-detection": ["x-pack/packages/ml/aiops_change_point_detection"],
"@kbn/aiops-change-point-detection/*": ["x-pack/packages/ml/aiops_change_point_detection/*"],
"@kbn/aiops-common": ["x-pack/packages/ml/aiops_common"],
"@kbn/aiops-common/*": ["x-pack/packages/ml/aiops_common/*"],
"@kbn/aiops-components": ["x-pack/packages/ml/aiops_components"],
"@kbn/aiops-components/*": ["x-pack/packages/ml/aiops_components/*"],
"@kbn/aiops-log-pattern-analysis": ["x-pack/packages/ml/aiops_log_pattern_analysis"],
"@kbn/aiops-log-pattern-analysis/*": ["x-pack/packages/ml/aiops_log_pattern_analysis/*"],
"@kbn/aiops-log-rate-analysis": ["x-pack/packages/ml/aiops_log_rate_analysis"],
"@kbn/aiops-log-rate-analysis/*": ["x-pack/packages/ml/aiops_log_rate_analysis/*"],
"@kbn/aiops-plugin": ["x-pack/plugins/aiops"],
"@kbn/aiops-plugin/*": ["x-pack/plugins/aiops/*"],
"@kbn/aiops-test-utils": ["x-pack/packages/ml/aiops_test_utils"],
"@kbn/aiops-test-utils/*": ["x-pack/packages/ml/aiops_test_utils/*"],
"@kbn/aiops-utils": ["x-pack/packages/ml/aiops_utils"],
"@kbn/aiops-utils/*": ["x-pack/packages/ml/aiops_utils/*"],
"@kbn/alerting-api-integration-helpers": ["x-pack/test/alerting_api_integration/packages/helpers"],
"@kbn/alerting-api-integration-helpers/*": ["x-pack/test/alerting_api_integration/packages/helpers/*"],
"@kbn/alerting-api-integration-test-plugin": ["x-pack/test/alerting_api_integration/common/plugins/alerts"],

View file

@ -4,6 +4,7 @@
"xpack.actions": "plugins/actions",
"xpack.aiops": [
"packages/ml/aiops_components",
"packages/ml/aiops_log_pattern_analysis",
"plugins/aiops"
],
"xpack.alerting": "plugins/alerting",

View file

@ -30,6 +30,7 @@ export type {
SignificantItemHistogramItem,
SignificantItemType,
HistogramField,
ItemSet,
NumericColumnStats,
NumericColumnStatsMap,
FieldValuePair,

View file

@ -51,6 +51,25 @@ export interface FieldValuePair {
fieldValue: string | number;
}
/**
* Represents an item set returned from `frequent_item_sets` augmented
* with some metadata related to log rate analysis.
*/
export interface ItemSet {
/** An array of field-value pairs representing the items in the set. */
set: FieldValuePair[];
/** The size of the item set. */
size: number;
/** The maximum p-value associated with the item set. */
maxPValue: number;
/** The document count of the item set. */
doc_count: number;
/** The support value of the item set. */
support: number;
/** The total document count. */
total_doc_count: number;
}
/**
* Interface describing attributes used for numeric histograms.
* @interface

View file

@ -0,0 +1,5 @@
# @kbn/aiops-change-point-detection
Static utilities for AIOps change point detection.
https://docs.elastic.dev/kibana-dev-docs/api/kbn-aiops-change-point-detection

View file

@ -0,0 +1,26 @@
/*
* 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.
*/
/**
* This is an internal hard coded feature flag so we can easily turn on/off the
* "Change Point Detection UI" during development until the first release.
*/
export const CHANGE_POINT_DETECTION_ENABLED = true;
export const CASES_ATTACHMENT_CHANGE_POINT_CHART = 'aiopsChangePointChart';
export const EMBEDDABLE_CHANGE_POINT_CHART_TYPE = 'aiopsChangePointChart' as const;
export type EmbeddableChangePointType = typeof EMBEDDABLE_CHANGE_POINT_CHART_TYPE;
export const CHANGE_POINT_DETECTION_VIEW_TYPE = {
CHARTS: 'charts',
TABLE: 'table',
} as const;
export type ChangePointDetectionViewType =
typeof CHANGE_POINT_DETECTION_VIEW_TYPE[keyof typeof CHANGE_POINT_DETECTION_VIEW_TYPE];

View file

@ -0,0 +1,12 @@
/*
* 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.
*/
module.exports = {
preset: '@kbn/test',
rootDir: '../../../..',
roots: ['<rootDir>/x-pack/packages/ml/aiops_change_point_detection'],
};

View file

@ -0,0 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/aiops-change-point-detection",
"owner": "@elastic/ml-ui"
}

View file

@ -0,0 +1,6 @@
{
"name": "@kbn/aiops-change-point-detection",
"private": true,
"version": "1.0.0",
"license": "Elastic License 2.0"
}

View file

@ -0,0 +1,19 @@
{
"extends": "../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
"jest",
"node",
"react"
]
},
"include": [
"**/*.ts",
"**/*.tsx",
],
"exclude": [
"target/**/*"
],
"kbn_references": []
}

View file

@ -0,0 +1,5 @@
# @kbn/aiops-common
Static utilities for AIOps related efforts.
https://docs.elastic.dev/kibana-dev-docs/api/kbn-aiops-common

View file

@ -5,10 +5,19 @@
* 2.0.
*/
/**
* AIOPS_PLUGIN_ID is used as a unique identifier for the aiops plugin
*/
export const AIOPS_PLUGIN_ID = 'aiops';
export const AIOPS_API_ENDPOINT = {
LOG_RATE_ANALYSIS: '/internal/aiops/log_rate_analysis',
CATEGORIZATION_FIELD_VALIDATION: '/internal/aiops/categorization_field_validation',
} as const;
type AiopsApiEndpointKeys = keyof typeof AIOPS_API_ENDPOINT;
export type AiopsApiEndpoint = typeof AIOPS_API_ENDPOINT[AiopsApiEndpointKeys];
export const AIOPS_TELEMETRY_ID = {
AIOPS_DEFAULT_SOURCE: 'ml_aiops_labs',
AIOPS_ANALYSIS_RUN_ORIGIN: 'aiops-analysis-run-origin',
} as const;
export const EMBEDDABLE_ORIGIN = 'embeddable';

View file

@ -8,5 +8,5 @@
module.exports = {
preset: '@kbn/test/jest_node',
rootDir: '../../../..',
roots: ['<rootDir>/x-pack/packages/ml/aiops_utils'],
roots: ['<rootDir>/x-pack/packages/ml/aiops_common'],
};

View file

@ -1,5 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/aiops-utils",
"id": "@kbn/aiops-common",
"owner": "@elastic/ml-ui"
}

View file

@ -1,9 +1,9 @@
{
"name": "@kbn/aiops-utils",
"name": "@kbn/aiops-common",
"description": "Static utilities for AIOps related efforts.",
"author": "Machine Learning UI",
"homepage": "https://docs.elastic.dev/kibana-dev-docs/api/kbn-aiops-utils",
"homepage": "https://docs.elastic.dev/kibana-dev-docs/api/kbn-aiops-common",
"private": true,
"version": "1.0.0",
"license": "Elastic License 2.0"
}
}

View file

@ -15,7 +15,6 @@
],
"kbn_references": [
"@kbn/ml-is-populated-object",
"@kbn/ml-agg-utils",
],
"exclude": [
"target/**/*",

View file

@ -32,7 +32,7 @@ import {
type LogRateAnalysisType,
type LogRateHistogramItem,
type WindowParameters,
} from '@kbn/aiops-utils';
} from '@kbn/aiops-log-rate-analysis';
import { MULTILAYER_TIME_AXIS_STYLE } from '@kbn/charts-plugin/common';
import type { DataPublicPluginStart } from '@kbn/data-plugin/public';
import type { ChartsPluginStart } from '@kbn/charts-plugin/public';

View file

@ -13,8 +13,8 @@ import * as d3Scale from 'd3-scale';
import * as d3Selection from 'd3-selection';
import * as d3Transition from 'd3-transition';
import { getSnappedWindowParameters } from '@kbn/aiops-utils';
import type { WindowParameters } from '@kbn/aiops-utils';
import { getSnappedWindowParameters } from '@kbn/aiops-log-rate-analysis';
import type { WindowParameters } from '@kbn/aiops-log-rate-analysis';
import './dual_brush.scss';

View file

@ -20,13 +20,13 @@
],
"kbn_references": [
"@kbn/i18n-react",
"@kbn/aiops-utils",
"@kbn/i18n",
"@kbn/core",
"@kbn/charts-plugin",
"@kbn/data-plugin",
"@kbn/field-formats-plugin",
"@kbn/visualization-utils",
"@kbn/aiops-log-rate-analysis",
],
"exclude": [
"target/**/*",

View file

@ -0,0 +1,5 @@
# @kbn/aiops-log-pattern-analysis
Static utilities for AIOps log pattern analysis.
https://docs.elastic.dev/kibana-dev-docs/api/kbn-aiops-log-pattern-analysis

View file

@ -0,0 +1,12 @@
/*
* 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.
*/
module.exports = {
preset: '@kbn/test',
rootDir: '../../../..',
roots: ['<rootDir>/x-pack/packages/ml/aiops_log_pattern_analysis'],
};

View file

@ -0,0 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/aiops-log-pattern-analysis",
"owner": "@elastic/ml-ui"
}

View file

@ -0,0 +1,6 @@
{
"name": "@kbn/aiops-log-pattern-analysis",
"private": true,
"version": "1.0.0",
"license": "Elastic License 2.0"
}

View file

@ -41,6 +41,9 @@ export const indicesOptionsSchema = schema.object({
ignore_throttled: schema.maybe(schema.boolean()),
});
/**
* Defines the schema for the categorization API request body.
*/
export const categorizeSchema = schema.object({
index: schema.string(),
field: schema.string(),
@ -51,6 +54,9 @@ export const categorizeSchema = schema.object({
intervalMs: schema.maybe(schema.number()),
});
/**
* Schema for categorization API request body.
*/
export type CategorizeSchema = TypeOf<typeof categorizeSchema>;
export const categorizationFieldValidationSchema = schema.object({

View file

@ -0,0 +1,24 @@
{
"extends": "../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
"jest",
"node",
"react"
]
},
"include": [
"**/*.ts",
"**/*.tsx",
],
"exclude": [
"target/**/*"
],
"kbn_references": [
"@kbn/ml-random-sampler-utils",
"@kbn/config-schema",
"@kbn/i18n",
"@kbn/ml-runtime-field-utils",
]
}

View file

@ -0,0 +1,5 @@
# @kbn/aiops-log-rate-analysis
Static utilities for AIOps log rate analysis.
https://docs.elastic.dev/kibana-dev-docs/api/kbn-aiops-log-rate-analysis

View file

@ -14,7 +14,7 @@ import {
resetAllAction,
resetGroupsAction,
updateLoadingStateAction,
} from './log_rate_analysis/actions';
} from './actions';
import { initialState, streamReducer } from './stream_reducer';
describe('streamReducer', () => {

View file

@ -7,8 +7,8 @@
import type { SignificantItem, SignificantItemGroup } from '@kbn/ml-agg-utils';
import type { AiopsLogRateAnalysisApiAction } from './log_rate_analysis/actions';
import { API_ACTION_NAME } from './log_rate_analysis/actions';
import type { AiopsLogRateAnalysisApiAction } from './actions';
import { API_ACTION_NAME } from './actions';
interface StreamState {
ccsWarning: boolean;

View file

@ -5,6 +5,7 @@
* 2.0.
*/
/** Log rate analysis settings */
export const LOG_RATE_ANALYSIS_SETTINGS = {
/**
* The p-value threshold to be used for statistically significant items.
@ -30,23 +31,5 @@ export const LOG_RATE_ANALYSIS_SETTINGS = {
*/
export const RANDOM_SAMPLER_SEED = 3867412;
export const CASES_ATTACHMENT_CHANGE_POINT_CHART = 'aiopsChangePointChart';
export const EMBEDDABLE_CHANGE_POINT_CHART_TYPE = 'aiopsChangePointChart' as const;
export type EmbeddableChangePointType = typeof EMBEDDABLE_CHANGE_POINT_CHART_TYPE;
export const AIOPS_TELEMETRY_ID = {
AIOPS_DEFAULT_SOURCE: 'ml_aiops_labs',
AIOPS_ANALYSIS_RUN_ORIGIN: 'aiops-analysis-run-origin',
} as const;
export const EMBEDDABLE_ORIGIN = 'embeddable';
export const CHANGE_POINT_DETECTION_VIEW_TYPE = {
CHARTS: 'charts',
TABLE: 'table',
} as const;
export type ChangePointDetectionViewType =
typeof CHANGE_POINT_DETECTION_VIEW_TYPE[keyof typeof CHANGE_POINT_DETECTION_VIEW_TYPE];
/** Highlighting color for charts */
export const LOG_RATE_ANALYSIS_HIGHLIGHT_COLOR = 'orange';

View file

@ -0,0 +1,18 @@
/*
* 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.
*/
export { LOG_RATE_ANALYSIS_HIGHLIGHT_COLOR } from './constants';
export { getLogRateAnalysisType } from './get_log_rate_analysis_type';
export { LOG_RATE_ANALYSIS_TYPE, type LogRateAnalysisType } from './log_rate_analysis_type';
export type { LogRateHistogramItem } from './log_rate_histogram_item';
export type { DocumentCountStatsChangePoint } from './types';
export type { WindowParameters } from './window_parameters';
export { getSnappedTimestamps } from './get_snapped_timestamps';
export { getSnappedWindowParameters } from './get_snapped_window_parameters';
export { getWindowParameters } from './get_window_parameters';
export { getWindowParametersForTrigger } from './get_window_parameters_for_trigger';
export { getExtendedChangePoint } from './get_extended_change_point';

View file

@ -5,5 +5,8 @@
* 2.0.
*/
/** Highlighting color for charts */
export const LOG_RATE_ANALYSIS_HIGHLIGHT_COLOR = 'orange';
module.exports = {
preset: '@kbn/test',
rootDir: '../../../..',
roots: ['<rootDir>/x-pack/packages/ml/aiops_log_rate_analysis'],
};

View file

@ -0,0 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/aiops-log-rate-analysis",
"owner": "@elastic/ml-ui"
}

View file

@ -0,0 +1,6 @@
{
"name": "@kbn/aiops-log-rate-analysis",
"private": true,
"version": "1.0.0",
"license": "Elastic License 2.0"
}

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import type { AiopsLogRateAnalysisSchema } from '../../../../../common/api/log_rate_analysis/schema';
import type { AiopsLogRateAnalysisSchema } from '../../api/schema';
import { paramsMock } from './params_match_all';
import { searchQueryMock } from './search_query';

View file

@ -14,13 +14,12 @@ import {
createRandomSamplerWrapper,
type RandomSamplerWrapper,
} from '@kbn/ml-random-sampler-utils';
import { createCategoryRequest } from '@kbn/aiops-log-pattern-analysis/create_category_request';
import type { Category, CategoriesAgg } from '@kbn/aiops-log-pattern-analysis/types';
import { isRequestAbortedError } from '@kbn/aiops-common/is_request_aborted_error';
import { RANDOM_SAMPLER_SEED } from '../../../../common/constants';
import type { AiopsLogRateAnalysisSchema } from '../../../../common/api/log_rate_analysis/schema';
import { createCategoryRequest } from '../../../../common/api/log_categorization/create_category_request';
import type { Category, CategoriesAgg } from '../../../../common/api/log_categorization/types';
import { isRequestAbortedError } from '../../../lib/is_request_aborted_error';
import { RANDOM_SAMPLER_SEED } from '../constants';
import type { AiopsLogRateAnalysisSchema } from '../api/schema';
import { getQueryWithParams } from './get_query_with_params';

View file

@ -11,12 +11,11 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { ElasticsearchClient } from '@kbn/core/server';
import type { Logger } from '@kbn/logging';
import { isPopulatedObject } from '@kbn/ml-is-populated-object';
import { getCategoryQuery } from '@kbn/aiops-log-pattern-analysis/get_category_query';
import type { Category } from '@kbn/aiops-log-pattern-analysis/types';
import { isRequestAbortedError } from '@kbn/aiops-common/is_request_aborted_error';
import type { AiopsLogRateAnalysisSchema } from '../../../../common/api/log_rate_analysis/schema';
import { getCategoryQuery } from '../../../../common/api/log_categorization/get_category_query';
import type { Category } from '../../../../common/api/log_categorization/types';
import { isRequestAbortedError } from '../../../lib/is_request_aborted_error';
import type { AiopsLogRateAnalysisSchema } from '../api/schema';
import { getQueryWithParams } from './get_query_with_params';
import type { FetchCategoriesResponse } from './fetch_categories';

View file

@ -12,15 +12,11 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import type { Logger } from '@kbn/logging';
import { type SignificantItem } from '@kbn/ml-agg-utils';
import type { ItemSet, SignificantItem } from '@kbn/ml-agg-utils';
import { createRandomSamplerWrapper } from '@kbn/ml-random-sampler-utils';
import type {
SignificantItemDuplicateGroup,
ItemSet,
FetchFrequentItemSetsResponse,
} from '@kbn/aiops-utils/log_rate_analysis/types';
import { RANDOM_SAMPLER_SEED, LOG_RATE_ANALYSIS_SETTINGS } from '../../../../common/constants';
import { RANDOM_SAMPLER_SEED, LOG_RATE_ANALYSIS_SETTINGS } from '../constants';
import type { SignificantItemDuplicateGroup, FetchFrequentItemSetsResponse } from '../types';
interface FrequentItemSetsAggregation extends estypes.AggregationsSamplerAggregation {
fi: {

View file

@ -10,7 +10,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { ES_FIELD_TYPES } from '@kbn/field-types';
import type { ElasticsearchClient } from '@kbn/core/server';
import type { AiopsLogRateAnalysisSchema } from '../../../../common/api/log_rate_analysis/schema';
import type { AiopsLogRateAnalysisSchema } from '../api/schema';
import { getTotalDocCountRequest } from './get_total_doc_count_request';

View file

@ -11,10 +11,10 @@ import type { ElasticsearchClient } from '@kbn/core/server';
import type { Logger } from '@kbn/logging';
import { criticalTableLookup, type Histogram } from '@kbn/ml-chi2test';
import { type SignificantItem, SIGNIFICANT_ITEM_TYPE } from '@kbn/ml-agg-utils';
import type { Category } from '@kbn/aiops-log-pattern-analysis/types';
import type { Category } from '../../../../common/api/log_categorization/types';
import type { AiopsLogRateAnalysisSchema } from '../../../../common/api/log_rate_analysis/schema';
import { LOG_RATE_ANALYSIS_SETTINGS } from '../../../../common/constants';
import type { AiopsLogRateAnalysisSchema } from '../api/schema';
import { LOG_RATE_ANALYSIS_SETTINGS } from '../constants';
import { fetchCategories } from './fetch_categories';
import { fetchCategoryCounts } from './fetch_category_counts';

View file

@ -14,11 +14,10 @@ import {
createRandomSamplerWrapper,
type RandomSamplerWrapper,
} from '@kbn/ml-random-sampler-utils';
import { isRequestAbortedError } from '@kbn/aiops-common/is_request_aborted_error';
import { LOG_RATE_ANALYSIS_SETTINGS, RANDOM_SAMPLER_SEED } from '../../../../common/constants';
import type { AiopsLogRateAnalysisSchema } from '../../../../common/api/log_rate_analysis/schema';
import { isRequestAbortedError } from '../../../lib/is_request_aborted_error';
import { LOG_RATE_ANALYSIS_SETTINGS, RANDOM_SAMPLER_SEED } from '../constants';
import type { AiopsLogRateAnalysisSchema } from '../api/schema';
import { getNormalizedScore } from './get_normalized_score';
import { getQueryWithParams } from './get_query_with_params';

View file

@ -11,19 +11,15 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import type { Logger } from '@kbn/logging';
import type { FieldValuePair, SignificantItem } from '@kbn/ml-agg-utils';
import type {
FetchFrequentItemSetsResponse,
ItemSet,
} from '@kbn/aiops-utils/log_rate_analysis/types';
import type { FieldValuePair, ItemSet, SignificantItem } from '@kbn/ml-agg-utils';
import { isPopulatedObject } from '@kbn/ml-is-populated-object';
import { getCategoryQuery } from '@kbn/aiops-log-pattern-analysis/get_category_query';
import type { Category } from '@kbn/aiops-log-pattern-analysis/types';
import { isRequestAbortedError } from '@kbn/aiops-common/is_request_aborted_error';
import type { AiopsLogRateAnalysisSchema } from '../../../../common/api/log_rate_analysis/schema';
import { getCategoryQuery } from '../../../../common/api/log_categorization/get_category_query';
import type { Category } from '../../../../common/api/log_categorization/types';
import { LOG_RATE_ANALYSIS_SETTINGS } from '../../../../common/constants';
import { isRequestAbortedError } from '../../../lib/is_request_aborted_error';
import type { AiopsLogRateAnalysisSchema } from '../api/schema';
import type { FetchFrequentItemSetsResponse } from '../types';
import { LOG_RATE_ANALYSIS_SETTINGS } from '../constants';
import { getQueryWithParams } from './get_query_with_params';

View file

@ -11,7 +11,7 @@ import type { ElasticsearchClient } from '@kbn/core/server';
import type { Logger } from '@kbn/logging';
import { type SignificantItem, SIGNIFICANT_ITEM_TYPE } from '@kbn/ml-agg-utils';
import type { AiopsLogRateAnalysisSchema } from '../../../../common/api/log_rate_analysis/schema';
import type { AiopsLogRateAnalysisSchema } from '../api/schema';
import { fetchCategories } from './fetch_categories';

View file

@ -14,11 +14,10 @@ import {
createRandomSamplerWrapper,
type RandomSamplerWrapper,
} from '@kbn/ml-random-sampler-utils';
import { isRequestAbortedError } from '@kbn/aiops-common/is_request_aborted_error';
import { LOG_RATE_ANALYSIS_SETTINGS, RANDOM_SAMPLER_SEED } from '../../../../common/constants';
import type { AiopsLogRateAnalysisSchema } from '../../../../common/api/log_rate_analysis/schema';
import { isRequestAbortedError } from '../../../lib/is_request_aborted_error';
import type { AiopsLogRateAnalysisSchema } from '../api/schema';
import { LOG_RATE_ANALYSIS_SETTINGS, RANDOM_SAMPLER_SEED } from '../constants';
import { getQueryWithParams } from './get_query_with_params';
import { getRequestBase } from './get_request_base';

View file

@ -6,7 +6,8 @@
*/
import type { SignificantItemGroup } from '@kbn/ml-agg-utils';
import type { FieldValuePairCounts } from '@kbn/aiops-utils/log_rate_analysis/types';
import type { FieldValuePairCounts } from '../types';
/**
* Get a nested record of field/value pairs with counts

View file

@ -8,8 +8,7 @@
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { type SignificantItemGroup, SIGNIFICANT_ITEM_TYPE } from '@kbn/ml-agg-utils';
import { getCategoryQuery } from '../../../../common/api/log_categorization/get_category_query';
import { getCategoryQuery } from '@kbn/aiops-log-pattern-analysis/get_category_query';
// Transforms a list of significant items from a group in a query filter.
// Uses a `term` filter for single field value combinations.

View file

@ -8,7 +8,8 @@
import { uniqWith, isEqual } from 'lodash';
import type { SignificantItemGroup } from '@kbn/ml-agg-utils';
import type { SignificantItemDuplicateGroup } from '@kbn/aiops-utils/log_rate_analysis/types';
import type { SignificantItemDuplicateGroup } from '../types';
export function getGroupsWithReaddedDuplicates(
groups: SignificantItemGroup[],

View file

@ -7,7 +7,7 @@
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { AiopsLogRateAnalysisSchema } from '../../../../common/api/log_rate_analysis/schema';
import type { AiopsLogRateAnalysisSchema } from '../api/schema';
import { getQueryWithParams } from './get_query_with_params';

View file

@ -6,7 +6,8 @@
*/
import type { SignificantItemGroup } from '@kbn/ml-agg-utils';
import type { FieldValuePairCounts } from '@kbn/aiops-utils/log_rate_analysis/types';
import type { FieldValuePairCounts } from '../types';
/**
* Analyse duplicate field/value pairs in groups.

View file

@ -9,7 +9,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { FieldValuePair } from '@kbn/ml-agg-utils';
import type { AiopsLogRateAnalysisSchema } from '../../../../common/api/log_rate_analysis/schema';
import type { AiopsLogRateAnalysisSchema } from '../api/schema';
import { getRangeQuery } from './get_range_query';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import type { AiopsLogRateAnalysisSchema } from '../../../../common/api/log_rate_analysis/schema';
import type { AiopsLogRateAnalysisSchema } from '../api/schema';
export const getRequestBase = ({ index, includeFrozen }: AiopsLogRateAnalysisSchema) => ({
index,

View file

@ -7,8 +7,7 @@
import { uniqBy } from 'lodash';
import type { SignificantItem, SignificantItemGroup } from '@kbn/ml-agg-utils';
import type { ItemSet } from '@kbn/aiops-utils/log_rate_analysis/types';
import type { ItemSet, SignificantItem, SignificantItemGroup } from '@kbn/ml-agg-utils';
import { duplicateIdentifier } from './duplicate_identifier';
import { groupDuplicates } from './fetch_frequent_item_sets';

View file

@ -5,8 +5,9 @@
* 2.0.
*/
import type { SignificantItem } from '@kbn/ml-agg-utils';
import type { ItemSet, SimpleHierarchicalTreeNode } from '@kbn/aiops-utils/log_rate_analysis/types';
import type { ItemSet, SignificantItem } from '@kbn/ml-agg-utils';
import type { SimpleHierarchicalTreeNode } from '../types';
import { getValueCounts } from './get_value_counts';
import { getValuesDescending } from './get_values_descending';

Some files were not shown because too many files have changed in this diff Show more