Skip to content

Commit

Permalink
Merge branch 'master' into uptime-usage-collector-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
TinaHeiligers committed Dec 22, 2020
2 parents 3788b87 + 9bc2fcc commit eb87c64
Show file tree
Hide file tree
Showing 84 changed files with 810 additions and 602 deletions.
11 changes: 6 additions & 5 deletions docs/user/alerting/alerting-getting-started.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,15 @@ image::images/alert-concepts-connectors.svg[Connectors provide a central place t
[float]
=== Summary

An _alert_ consists of conditions, _actions_, and a schedule. When conditions are met, _alert instances_ are created that render _actions_ and invoke them. To make action setup and update easier, actions refer to _connectors_ that centralize the information used to connect with {kib} services and third-party integrations.
An _alert_ consists of conditions, _actions_, and a schedule. When conditions are met, _alert instances_ are created that render _actions_ and invoke them. To make action setup and update easier, actions refer to _connectors_ that centralize the information used to connect with {kib} services and third-party integrations. The following example ties these concepts together:

image::images/alert-concepts-summary.svg[Alerts, actions, alert instances and connectors work together to convert detection into action]

* *Alert*: a specification of the conditions to be detected, the schedule for detection, and the response when detection occurs.
* *Action*: the response to a detected condition defined in the alert. Typically actions specify a service or third party integration along with alert details that will be sent to it.
* *Alert instance*: state tracked by {kib} for every occurrence of a detected condition. Actions as well as controls like muting and re-notification are controlled at the instance level.
* *Connector*: centralized configurations for services and third party integration that are referenced by actions.
. Anytime an *alert*'s conditions are met, an *alert instance* is created. This example checks for servers with average CPU > 0.9. Three servers meet the condition, so three instances are created.
. Instances create *actions* as long as they are not muted or throttled. When actions are created, the template that was setup in the alert is filled with actual values. In this example three actions are created, and the template string {{server}} is replaced with the server name for each instance.
. {kib} invokes the actions, sending them to a 3rd party *integration* like an email service.
. If the 3rd party integration has connection parameters or credentials, {kib} will fetch these from the *connector* referenced in the action.


[float]
[[alerting-concepts-differences]]
Expand Down
2 changes: 1 addition & 1 deletion docs/user/alerting/images/alert-concepts-summary.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@
"url-loader": "^2.2.0",
"use-resize-observer": "^6.0.0",
"val-loader": "^1.1.1",
"vega": "^5.17.0",
"vega": "^5.17.1",
"vega-lite": "^4.17.0",
"vega-schema-url-parser": "^2.1.0",
"vega-tooltip": "^0.24.2",
Expand Down
2 changes: 0 additions & 2 deletions src/dev/run_find_plugins_with_circular_deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ type CircularDepList = Set<string>;

const allowedList: CircularDepList = new Set([
'src/plugins/charts -> src/plugins/discover',
'src/plugins/charts -> src/plugins/vis_default_editor',
'src/plugins/vis_default_editor -> src/plugins/visualizations',
'src/plugins/vis_default_editor -> src/plugins/visualize',
'src/plugins/visualizations -> src/plugins/visualize',
'x-pack/plugins/actions -> x-pack/plugins/case',
'x-pack/plugins/case -> x-pack/plugins/security_solution',
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/apm_oss/server/tutorial/index_pattern.json

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/plugins/charts/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
"version": "kibana",
"server": true,
"ui": true,
"requiredPlugins": ["expressions"],
"requiredBundles": ["visDefaultEditor"]
"requiredPlugins": ["expressions"]
}
9 changes: 0 additions & 9 deletions src/plugins/charts/public/static/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,8 @@
* under the License.
*/

export { BasicOptions } from './basic_options';
export { ColorMode, LabelRotation, defaultCountLabel } from './collections';
export { ColorRanges, SetColorRangeValue } from './color_ranges';
export { ColorSchemaOptions, SetColorSchemaOptionsValue } from './color_schema';
export { ColorSchemaParams, Labels, Style } from './types';
export { NumberInputOption } from './number_input';
export { RangeOption } from './range';
export { RequiredNumberInputOption } from './required_number_input';
export { SelectOption } from './select';
export { SwitchOption } from './switch';
export { TextInputOption } from './text_input';
export { LegendToggle } from './legend_toggle';
export { ColorPicker } from './color_picker';
export { CurrentTime } from './current_time';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/maps_legacy/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"ui": true,
"server": true,
"extraPublicDirs": ["common"],
"requiredBundles": ["kibanaReact", "charts"]
"requiredBundles": ["kibanaReact", "visDefaultEditor"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import React from 'react';
import { EuiLink, EuiSpacer, EuiText, EuiScreenReaderOnly } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

import { TextInputOption } from '../../../charts/public';
import { TextInputOption } from '../../../vis_default_editor/public';
import { WMSOptions } from '../common/types/external_basemap_types';

interface WmsInternalOptions {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/maps_legacy/public/components/wms_options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { FormattedMessage } from '@kbn/i18n/react';
import { TmsLayer } from '../index';
import { Vis } from '../../../visualizations/public';
import { RegionMapVisParams } from '../common/types/region_map_types';
import { SelectOption, SwitchOption } from '../../../charts/public';
import { SelectOption, SwitchOption } from '../../../vis_default_editor/public';
import { WmsInternalOptions } from './wms_internal_options';
import { WMSOptions, TileMapVisParams } from '../common/types/external_basemap_types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { VisOptionsProps } from 'src/plugins/vis_default_editor/public';
import { FileLayerField, VectorLayer, IServiceSettings } from '../../../maps_legacy/public';
import { NumberInputOption, SelectOption, SwitchOption } from '../../../charts/public';
import { SelectOption, SwitchOption, NumberInputOption } from '../../../vis_default_editor/public';
import { RegionMapVisParams, WmsOptions } from '../../../maps_legacy/public';

const mapLayerForOption = ({ layerId, name }: VectorLayer) => ({
Expand Down
9 changes: 7 additions & 2 deletions src/plugins/tile_map/public/components/tile_map_options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ import React, { useEffect } from 'react';
import { EuiPanel, EuiSpacer } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { VisOptionsProps } from 'src/plugins/vis_default_editor/public';
import { BasicOptions, RangeOption, SelectOption, SwitchOption } from '../../../charts/public';
import {
VisOptionsProps,
BasicOptions,
SelectOption,
SwitchOption,
RangeOption,
} from '../../../vis_default_editor/public';
import { WmsOptions, TileMapVisParams, MapTypes } from '../../../maps_legacy/public';

export type TileMapOptionsProps = VisOptionsProps<TileMapVisParams>;
Expand Down
1 change: 1 addition & 0 deletions src/plugins/vis_default_editor/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"id": "visDefaultEditor",
"version": "kibana",
"ui": true,
"optionalPlugins": ["visualize"],
"requiredBundles": ["kibanaUtils", "kibanaReact", "data"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import React from 'react';

import { i18n } from '@kbn/i18n';

import { VisOptionsProps } from '../../../../vis_default_editor/public';

import { VisOptionsProps } from '../../vis_options_props';
import { SwitchOption } from './switch';
import { SelectOption } from './select';

Expand All @@ -39,7 +38,7 @@ function BasicOptions<VisParams extends BasicOptionsParams>({
return (
<>
<SelectOption
label={i18n.translate('charts.controls.vislibBasicOptions.legendPositionLabel', {
label={i18n.translate('visDefaultEditor.options.vislibBasicOptions.legendPositionLabel', {
defaultMessage: 'Legend position',
})}
options={vis.type.editorConfig.collections.legendPositions}
Expand All @@ -48,7 +47,7 @@ function BasicOptions<VisParams extends BasicOptionsParams>({
setValue={setValue}
/>
<SwitchOption
label={i18n.translate('charts.controls.vislibBasicOptions.showTooltipLabel', {
label={i18n.translate('visDefaultEditor.options.vislibBasicOptions.showTooltipLabel', {
defaultMessage: 'Show tooltip',
})}
paramName="addTooltip"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { last } from 'lodash';

import { i18n } from '@kbn/i18n';

import { RangeValues, RangesParamEditor } from '../../../../vis_default_editor/public';
import { RangeValues, RangesParamEditor } from '../controls/ranges';

export type SetColorRangeValue = (paramName: string, value: RangeValues[]) => void;

Expand Down Expand Up @@ -71,7 +71,7 @@ function ColorRanges({
return (
<RangesParamEditor
data-test-subj={dataTestSubj}
error={i18n.translate('charts.controls.colorRanges.errorText', {
error={i18n.translate('visDefaultEditor.options.colorRanges.errorText', {
defaultMessage: 'Each range should be greater than previous.',
})}
hidePlaceholders={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ import { i18n } from '@kbn/i18n';
import { EuiLink, EuiText } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

import { VisOptionsProps } from 'src/plugins/vis_default_editor/public';
import { ColorSchemaParams, ColorSchema } from 'src/plugins/charts/public';
import { VisOptionsProps } from '../../vis_options_props';
import { SelectOption } from './select';
import { SwitchOption } from './switch';
import { ColorSchemaParams } from './types';
import { ColorSchema } from '../color_maps';

export type SetColorSchemaOptionsValue = <T extends keyof ColorSchemaParams>(
paramName: T,
Expand Down Expand Up @@ -67,7 +66,7 @@ function ColorSchemaOptions({
}}
>
<FormattedMessage
id="charts.controls.colorSchema.resetColorsButtonLabel"
id="visDefaultEditor.options.colorSchema.resetColorsButtonLabel"
defaultMessage="Reset colors"
/>
</EuiLink>
Expand All @@ -80,11 +79,11 @@ function ColorSchemaOptions({
disabled={disabled}
helpText={
showHelpText &&
i18n.translate('charts.controls.colorSchema.howToChangeColorsDescription', {
i18n.translate('visDefaultEditor.options.colorSchema.howToChangeColorsDescription', {
defaultMessage: 'Individual colors can be changed in the legend.',
})
}
label={i18n.translate('charts.controls.colorSchema.colorSchemaLabel', {
label={i18n.translate('visDefaultEditor.options.colorSchema.colorSchemaLabel', {
defaultMessage: 'Color schema',
})}
labelAppend={isCustomColors && resetColorsButton}
Expand All @@ -96,7 +95,7 @@ function ColorSchemaOptions({

<SwitchOption
disabled={disabled}
label={i18n.translate('charts.controls.colorSchema.reverseColorSchemaLabel', {
label={i18n.translate('visDefaultEditor.options.colorSchema.reverseColorSchemaLabel', {
defaultMessage: 'Reverse schema',
})}
paramName="invertColors"
Expand Down
28 changes: 28 additions & 0 deletions src/plugins/vis_default_editor/public/components/options/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export { BasicOptions } from './basic_options';
export { SwitchOption } from './switch';
export { SelectOption } from './select';
export { ColorRanges, SetColorRangeValue } from './color_ranges';
export { ColorSchemaOptions, SetColorSchemaOptionsValue } from './color_schema';
export { NumberInputOption } from './number_input';
export { RangeOption } from './range';
export { RequiredNumberInputOption } from './required_number_input';
export { TextInputOption } from './text_input';
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function RangeOption<ParamName extends string>({
const [stateValue, setStateValue] = useState(value);
const [isValidState, setIsValidState] = useState(true);

const error = i18n.translate('charts.controls.rangeErrorMessage', {
const error = i18n.translate('visDefaultEditor.options.rangeErrorMessage', {
defaultMessage: 'Values must be on or between {min} and {max}',
values: { min, max },
});
Expand Down
17 changes: 9 additions & 8 deletions src/plugins/vis_default_editor/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@
* under the License.
*/

export { DefaultEditorController } from './default_editor_controller';
import { PluginInitializerContext } from 'kibana/public';
import { DefaultEditorController } from './default_editor_controller';
import { VisDefaultEditorPlugin } from './plugin';

export { DefaultEditorController };
export { useValidation } from './components/controls/utils';
export * from './components/options';
export { RangesParamEditor, RangeValues } from './components/controls/ranges';
export * from './editor_size';
export * from './vis_options_props';
export * from './utils';
export { ISchemas, Schemas, Schema } from './schemas';

/** dummy plugin, we just want visDefaultEditor to have its own bundle */
export function plugin() {
return new (class VisDefaultEditor {
setup() {}
start() {}
})();
}
export const plugin = (context: PluginInitializerContext) => {
return new VisDefaultEditorPlugin();
};
40 changes: 40 additions & 0 deletions src/plugins/vis_default_editor/public/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { CoreSetup, Plugin } from 'kibana/public';

import { VisualizePluginSetup } from '../../visualize/public';
import { DefaultEditorController } from './default_editor_controller';

export interface VisDefaultEditorSetupDependencies {
visualize: VisualizePluginSetup;
}

export class VisDefaultEditorPlugin
implements Plugin<void, void, VisDefaultEditorSetupDependencies, {}> {
public setup(core: CoreSetup, { visualize }: VisDefaultEditorSetupDependencies) {
if (visualize) {
visualize.setDefaultEditor(DefaultEditorController);
}
}

public start() {}

stop() {}
}
2 changes: 1 addition & 1 deletion src/plugins/vis_type_markdown/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"ui": true,
"server": true,
"requiredPlugins": ["expressions", "visualizations"],
"requiredBundles": ["kibanaReact", "charts", "visualizations", "expressions", "visDefaultEditor"]
"requiredBundles": ["kibanaReact", "visualizations", "expressions", "visDefaultEditor"]
}
3 changes: 1 addition & 2 deletions src/plugins/vis_type_markdown/public/settings_options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import React from 'react';
import { EuiPanel } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { VisOptionsProps } from 'src/plugins/vis_default_editor/public';
import { RangeOption, SwitchOption } from '../../charts/public';
import { VisOptionsProps, SwitchOption, RangeOption } from '../../vis_default_editor/public';
import { MarkdownVisParams } from './types';

function SettingsOptions({ stateParams, setValue }: VisOptionsProps<MarkdownVisParams>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ import {
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';

import { VisOptionsProps } from 'src/plugins/vis_default_editor/public';
import {
ColorMode,
ColorRanges,
ColorSchemaOptions,
SetColorRangeValue,
VisOptionsProps,
SwitchOption,
RangeOption,
SetColorSchemaOptionsValue,
SetColorRangeValue,
} from '../../../charts/public';
ColorSchemaOptions,
RangeOption,
} from '../../../vis_default_editor/public';
import { ColorMode } from '../../../charts/public';
import { MetricVisParam, VisParams } from '../types';

function MetricVisOptions({
Expand Down
1 change: 0 additions & 1 deletion src/plugins/vis_type_table/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"kibanaUtils",
"kibanaReact",
"share",
"charts",
"visDefaultEditor"
],
"optionalPlugins": ["usageCollection"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ import { EuiIconTip, EuiPanel } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';

import { VisOptionsProps } from 'src/plugins/vis_default_editor/public';
import { search } from '../../../data/public';
import { SwitchOption, SelectOption, NumberInputOption } from '../../../charts/public';
import {
SwitchOption,
SelectOption,
NumberInputOption,
VisOptionsProps,
} from '../../../vis_default_editor/public';
import { TableVisParams } from '../types';
import { totalAggregations } from './utils';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
import React from 'react';
import { EuiPanel } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { VisOptionsProps } from '../../../vis_default_editor/public';
import { VisOptionsProps, SelectOption, SwitchOption } from '../../../vis_default_editor/public';
import { ValidatedDualRange } from '../../../kibana_react/public';
import { SelectOption, SwitchOption } from '../../../charts/public';
import { TagCloudVisParams } from '../types';

function TagCloudOptions({ stateParams, setValue, vis }: VisOptionsProps<TagCloudVisParams>) {
Expand Down
Loading

0 comments on commit eb87c64

Please sign in to comment.