Skip to content

Commit

Permalink
Merge branch 'main' into 160425-restore-dataset-selection
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyghiani authored Jul 19, 2023
2 parents 42f029d + 917e3f2 commit d97e26c
Show file tree
Hide file tree
Showing 298 changed files with 1,622 additions and 1,456 deletions.
4 changes: 3 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ packages/kbn-eslint-plugin-eslint @elastic/kibana-operations
packages/kbn-eslint-plugin-imports @elastic/kibana-operations
packages/kbn-eslint-plugin-telemetry @elastic/actionable-observability
x-pack/test/encrypted_saved_objects_api_integration/plugins/api_consumer_plugin @elastic/kibana-security
packages/kbn-event-annotation-common @elastic/kibana-visualizations
packages/kbn-event-annotation-components @elastic/kibana-visualizations
src/plugins/event_annotation @elastic/kibana-visualizations
x-pack/test/plugin_api_integration/plugins/event_log @elastic/response-ops
x-pack/plugins/event_log @elastic/response-ops
Expand Down Expand Up @@ -762,7 +764,7 @@ src/plugins/vis_types/timeseries @elastic/kibana-visualizations
src/plugins/vis_types/vega @elastic/kibana-visualizations
src/plugins/vis_types/vislib @elastic/kibana-visualizations
src/plugins/vis_types/xy @elastic/kibana-visualizations
src/plugins/visualization_ui_components @elastic/kibana-visualizations
packages/kbn-visualization-ui-components @elastic/kibana-visualizations
src/plugins/visualizations @elastic/kibana-visualizations
x-pack/plugins/watcher @elastic/platform-deployment-management
packages/kbn-web-worker-stub @elastic/kibana-operations
Expand Down
10 changes: 8 additions & 2 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
"expressionShape": "src/plugins/expression_shape",
"expressionTagcloud": "src/plugins/chart_expressions/expression_tagcloud",
"eventAnnotation": "src/plugins/event_annotation",
"eventAnnotationCommon": "packages/kbn-event-annotation-common",
"eventAnnotationComponents": "packages/kbn-event-annotation-components",
"fieldFormats": "src/plugins/field_formats",
"files": "src/plugins/files",
"filesManagement": "src/plugins/files_management",
Expand Down Expand Up @@ -72,7 +74,11 @@
"kibanaOverview": "src/plugins/kibana_overview",
"lists": "packages/kbn-securitysolution-list-utils/src",
"exceptionList-components": "packages/kbn-securitysolution-exception-list-components/src",
"management": ["src/legacy/core_plugins/management", "src/plugins/management", "packages/kbn-management"],
"management": [
"src/legacy/core_plugins/management",
"src/plugins/management",
"packages/kbn-management"
],
"monaco": "packages/kbn-monaco/src",
"navigation": "src/plugins/navigation",
"newsfeed": "src/plugins/newsfeed",
Expand Down Expand Up @@ -113,7 +119,7 @@
"visTypeVislib": "src/plugins/vis_types/vislib",
"visTypeXy": "src/plugins/vis_types/xy",
"visualizations": "src/plugins/visualizations",
"visualizationUiComponents": "src/plugins/visualization_ui_components",
"visualizationUiComponents": "packages/kbn-visualization-ui-components",
"unifiedSearch": "src/plugins/unified_search",
"unifiedFieldList": "packages/kbn-unified-field-list",
"unifiedHistogram": "src/plugins/unified_histogram"
Expand Down
6 changes: 1 addition & 5 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,6 @@ The plugin exposes the static DefaultEditorController class to consume.
|WARNING: Missing README.
|{kib-repo}blob/{branch}/src/plugins/visualization_ui_components/README.md[visualizationUiComponents]
|A series of UI components pulled out of Lens to make them available outside Lens.
|===
[discrete]
Expand All @@ -427,7 +423,7 @@ The plugin exposes the static DefaultEditorController class to consume.
|{kib-repo}blob/{branch}/x-pack/plugins/aiops/README.md[aiops]
|The plugin provides APIs and components for AIOps features, including the “Explain log rate spikes” UI, maintained by the ML team.
|The plugin provides APIs and components for AIOps features, including the “Log rate analysis” UI, maintained by the ML team.
|{kib-repo}blob/{branch}/x-pack/plugins/alerting/README.md[alerting]
Expand Down
4 changes: 4 additions & 0 deletions docs/redirects.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
The following pages have moved or been deleted.

--
[role="exclude",id="explain-log-rate-spikes"]
== Explain log rate spikes
Refer to <<log-rate-analysis>>.

[role="exclude",id="snapshot-repositories"]
== Snapshot and Restore
Refer to {ref}/snapshot-restore.html[Snapshot and Restore].
Expand Down
Binary file removed docs/user/ml/images/ml-explain-log-rate-before.png
Binary file not shown.
Binary file removed docs/user/ml/images/ml-explain-log-rate.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/ml/images/ml-log-rate-analysis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions docs/user/ml/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -117,27 +117,27 @@ AIOps Labs is a part of {ml-app} in {kib} which provides features that use
advanced statistical methods to help you interpret your data and its behavior.

[discrete]
[[explain-log-rate-spikes]]
=== Explain log rate spikes
[[log-rate-analysis]]
=== Log rate analysis

preview::[]

Explain log rate spikes is a feature that uses advanced statistical methods to
identify reasons for increases in log rates. It makes it easy to find and
investigate causes of unusual spikes by using the analysis workflow view.
Log rate analysis is a feature that uses advanced statistical methods to
identify reasons for increases or decreases in log rates. It makes it easy to find and
investigate causes of unusual spikes or drops by using the analysis workflow view.
Examine the histogram chart of the log rates for a given {data-source}, and find
the reason behind a particular change possibly in millions of log events across
multiple fields and values.

You can find explain log rate spikes under **{ml-app}** > **AIOps Labs** where
You can find log rate analysis under **{ml-app}** > **AIOps Labs** where
you can select the {data-source} or saved search that you want to analyze.

[role="screenshot"]
image::user/ml/images/ml-explain-log-rate-before.png[Log event histogram chart]
image::user/ml/images/ml-log-rate-analysis-before.png[Log event histogram chart]

Select a spike in the log event histogram chart to start the analysis. It
Select a spike or drop in the log event histogram chart to start the analysis. It
identifies statistically significant field-value combinations that contribute to
the spike and displays them in a table. You can optionally choose to summarize
the spike or drop and displays them in a table. You can optionally choose to summarize
the results into groups. The table also shows an indicator of the level of
impact and a sparkline showing the shape of the impact in the chart. Hovering
over a row displays the impact on the histogram chart in more detail. You can
Expand All @@ -153,7 +153,7 @@ analyzed data. You can move the brushes to redefine both the baseline and the
deviation and rerun the analysis with the modified values.

[role="screenshot"]
image::user/ml/images/ml-explain-log-rate.png[Log rate spike explained]
image::user/ml/images/ml-log-rate-analysis.png[Log rate spike explained]


[discrete]
Expand Down Expand Up @@ -205,7 +205,7 @@ image::user/ml/images/ml-change-point-detection.png[Change point detection UI]
Select a function and a metric field, then pick a date range to start detecting
change points in the defined range. Optionally, you can split the data by a
field. If the cardinality of the split field exceeds 10,000, then only the first
10,000, sorted by document count, are analyzed. You can configure a maximum of 6
10,000, sorted by document count, are analyzed. You can configure a maximum of 6
combinations of a function applied to a metric field, partitioned by a split
field to identify change points.

Expand All @@ -222,4 +222,4 @@ change; lower values indicate more significant changes. You can use the change
point type selector to filter the results by specific types of change points.

[role="screenshot"]
image::user/ml/images/ml-change-point-detection-selected.png[Selected change points]
image::user/ml/images/ml-change-point-detection-selected.png[Selected change points]
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,8 @@
"@kbn/es-types": "link:packages/kbn-es-types",
"@kbn/es-ui-shared-plugin": "link:src/plugins/es_ui_shared",
"@kbn/eso-plugin": "link:x-pack/test/encrypted_saved_objects_api_integration/plugins/api_consumer_plugin",
"@kbn/event-annotation-common": "link:packages/kbn-event-annotation-common",
"@kbn/event-annotation-components": "link:packages/kbn-event-annotation-components",
"@kbn/event-annotation-plugin": "link:src/plugins/event_annotation",
"@kbn/event-log-fixture-plugin": "link:x-pack/test/plugin_api_integration/plugins/event_log",
"@kbn/event-log-plugin": "link:x-pack/plugins/event_log",
Expand Down Expand Up @@ -750,7 +752,7 @@
"@kbn/vis-type-vega-plugin": "link:src/plugins/vis_types/vega",
"@kbn/vis-type-vislib-plugin": "link:src/plugins/vis_types/vislib",
"@kbn/vis-type-xy-plugin": "link:src/plugins/vis_types/xy",
"@kbn/visualization-ui-components": "link:src/plugins/visualization_ui_components",
"@kbn/visualization-ui-components": "link:packages/kbn-visualization-ui-components",
"@kbn/visualizations-plugin": "link:src/plugins/visualizations",
"@kbn/watcher-plugin": "link:x-pack/plugins/watcher",
"@loaders.gl/core": "^2.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/deeplinks/ml/deep_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type LinkId =
| 'resultExplorer'
| 'analyticsMap'
| 'aiOps'
| 'explainLogRateSpikes'
| 'logRateAnalysis'
| 'logPatternAnalysis'
| 'changePointDetections'
| 'modelManagement'
Expand Down
2 changes: 1 addition & 1 deletion packages/default-nav/ml/default_navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const defaultNavigation: MlNodeDefinition = {
}),
children: [
{
link: 'ml:explainLogRateSpikes',
link: 'ml:logRateAnalysis',
},
{
link: 'ml:logPatternAnalysis',
Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-coloring/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"name": "@kbn/coloring",
"private": true,
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0"
}
"license": "SSPL-1.0 OR Elastic License 2.0",
"sideEffects": false
}
3 changes: 3 additions & 0 deletions packages/kbn-event-annotation-common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @kbn/event-annotation-common

A few core annotation-related types and utilities that are available in both server and browser contexts.
52 changes: 52 additions & 0 deletions packages/kbn-event-annotation-common/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export const AvailableAnnotationIcons = {
ASTERISK: 'asterisk',
ALERT: 'alert',
BELL: 'bell',
BOLT: 'bolt',
BUG: 'bug',
CIRCLE: 'circle',
EDITOR_COMMENT: 'editorComment',
FLAG: 'flag',
HEART: 'heart',
MAP_MARKER: 'mapMarker',
PIN_FILLED: 'pinFilled',
STAR_EMPTY: 'starEmpty',
STAR_FILLED: 'starFilled',
TAG: 'tag',
TRIANGLE: 'triangle',
} as const;

export const EVENT_ANNOTATION_GROUP_TYPE = 'event-annotation-group';

export {
defaultAnnotationColor,
defaultAnnotationRangeColor,
defaultAnnotationLabel,
getDefaultManualAnnotation,
getDefaultQueryAnnotation,
createCopiedAnnotation,
isRangeAnnotationConfig,
isManualPointAnnotationConfig,
isQueryAnnotationConfig,
} from './util';

export type {
EventAnnotationGroupContent,
AvailableAnnotationIcon,
PointStyleProps,
EventAnnotationConfig,
EventAnnotationGroupConfig,
RangeStyleProps,
ManualAnnotationType,
PointInTimeEventAnnotationConfig,
RangeEventAnnotationConfig,
QueryPointEventAnnotationConfig,
} from './types';
13 changes: 13 additions & 0 deletions packages/kbn-event-annotation-common/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

module.exports = {
preset: '@kbn/test/jest_node',
rootDir: '../..',
roots: ['<rootDir>/packages/kbn-event-annotation-common'],
};
5 changes: 5 additions & 0 deletions packages/kbn-event-annotation-common/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/event-annotation-common",
"owner": "@elastic/kibana-visualizations"
}
7 changes: 7 additions & 0 deletions packages/kbn-event-annotation-common/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "@kbn/event-annotation-common",
"private": true,
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0",
"sideEffects": false
}
23 changes: 23 additions & 0 deletions packages/kbn-event-annotation-common/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
"jest",
"node"
]
},
"include": [
"**/*.ts",
],
"exclude": [
"target/**/*"
],
"kbn_references": [
"@kbn/data-plugin",
"@kbn/content-management-table-list-view-table",
"@kbn/visualization-ui-components",
"@kbn/ui-theme",
"@kbn/i18n",
]
}
89 changes: 89 additions & 0 deletions packages/kbn-event-annotation-common/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { $Values } from 'utility-types';
import { DataViewSpec, KibanaQueryOutput } from '@kbn/data-plugin/common';
import { UserContentCommonSchema } from '@kbn/content-management-table-list-view-table';
import type { LineStyle } from '@kbn/visualization-ui-components';
import { AvailableAnnotationIcons } from '.';

export type AvailableAnnotationIcon = $Values<typeof AvailableAnnotationIcons>;

export type PointStyleProps = StyleSharedProps & {
icon?: AvailableAnnotationIcon;
lineWidth?: number;
lineStyle?: LineStyle;
textVisibility?: boolean;
};

export type PointInTimeEventAnnotationConfig = {
id: string;
type: ManualAnnotationType;
key: {
type: 'point_in_time';
timestamp: string;
};
} & PointStyleProps;

export type Fill = 'inside' | 'outside' | 'none';
export type ManualAnnotationType = 'manual';
export type QueryAnnotationType = 'query';
export type KeyType = 'point_in_time' | 'range';

interface StyleSharedProps {
label: string;
color?: string;
isHidden?: boolean;
}

export type RangeStyleProps = StyleSharedProps & {
outside?: boolean;
};

export type RangeEventAnnotationConfig = {
type: ManualAnnotationType;
id: string;
key: {
type: 'range';
timestamp: string;
endTimestamp: string;
};
} & RangeStyleProps;

export type StyleProps = PointStyleProps & RangeStyleProps;

export type QueryPointEventAnnotationConfig = {
id: string;
type: QueryAnnotationType;
filter: KibanaQueryOutput;
timeField?: string;
textField?: string;
extraFields?: string[];
key: {
type: 'point_in_time';
};
} & PointStyleProps;

export type EventAnnotationConfig =
| PointInTimeEventAnnotationConfig
| RangeEventAnnotationConfig
| QueryPointEventAnnotationConfig;

export interface EventAnnotationGroupConfig {
annotations: EventAnnotationConfig[];
indexPatternId: string;
ignoreGlobalFilters: boolean;
title: string;
description: string;
tags: string[];
dataViewSpec?: DataViewSpec;
}

export type EventAnnotationGroupContent = UserContentCommonSchema & {
attributes: { indexPatternId: string; dataViewSpec?: DataViewSpec };
};
Loading

0 comments on commit d97e26c

Please sign in to comment.