Skip to content

Commit

Permalink
Merge branch 'alerting/np-tests-migration' of github.com:gmmorris/kib…
Browse files Browse the repository at this point in the history
…ana into alerting/np-tests-migration

* 'alerting/np-tests-migration' of github.com:gmmorris/kibana:
  [APM] Agent remote config: validation for Java agent configs (#63956)
  [APM] Fix duplicate index patterns (#64883)
  Drilldowns (#61219)
  [Alerting] fix labels and links in PagerDuty action ui and docs (#64032)
  [Event Log] Ensure sorting tests are less flaky (#64781)
  update endpoint to restrict removing with datasources (#64978)
  [Logs UI] [Alerting] Alerts management page enhancements (#64654)
  Adjust kibana app owning files (#65064)
  Migrate tutorial resources (#64298)
  [Logs UI] Tweak copy in log alerts dialog (#64645)
  [Logs UI] [Alerting] Documentation (#64886)
  [Logs UI] Add dataset filter to ML module setup screen (#64470)
  [TSVB] Fixing memory leak (#64918)
  Bump backport to 5.4.1 (#65041)
  • Loading branch information
gmmorris committed May 4, 2020
2 parents 48cbde4 + 801bd16 commit 85a6679
Show file tree
Hide file tree
Showing 428 changed files with 9,830 additions and 2,077 deletions.
29 changes: 27 additions & 2 deletions .backportrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
{
"upstream": "elastic/kibana",
"branches": [{ "name": "7.x", "checked": true }, "7.7", "7.6", "7.5", "7.4", "7.3", "7.2", "7.1", "7.0", "6.8", "6.7", "6.6", "6.5", "6.4", "6.3", "6.2", "6.1", "6.0", "5.6"],
"labels": ["backport"]
"targetBranchChoices": [
{ "name": "master", "checked": true },
{ "name": "7.x", "checked": true },
"7.7",
"7.6",
"7.5",
"7.4",
"7.3",
"7.2",
"7.1",
"7.0",
"6.8",
"6.7",
"6.6",
"6.5",
"6.4",
"6.3",
"6.2",
"6.1",
"6.0",
"5.6"
],
"targetPRLabels": ["backport"],
"branchLabelMapping": {
"^v7.8.0$": "7.x",
"^v(\\d+).(\\d+).\\d+$": "$1.$2"
}
}
20 changes: 12 additions & 8 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# For more info, see https://help.github.com/articles/about-codeowners/

# App
/x-pack/plugins/dashboard_enhanced/ @elastic/kibana-app
/x-pack/plugins/lens/ @elastic/kibana-app
/x-pack/plugins/graph/ @elastic/kibana-app
/src/legacy/server/url_shortening/ @elastic/kibana-app
Expand All @@ -11,18 +12,21 @@
/src/legacy/core_plugins/kibana/public/discover/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/local_application_service/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/dev_tools/ @elastic/kibana-app
/src/plugins/vis_type_vislib/ @elastic/kibana-app
/src/plugins/vis_type_xy/ @elastic/kibana-app
/src/plugins/vis_type_table/ @elastic/kibana-app
/src/plugins/kibana_legacy/ @elastic/kibana-app
/src/plugins/vis_type_timelion/ @elastic/kibana-app
/src/plugins/dashboard/ @elastic/kibana-app
/src/plugins/discover/ @elastic/kibana-app
/src/plugins/input_control_vis/ @elastic/kibana-app
/src/plugins/visualize/ @elastic/kibana-app
/src/plugins/vis_type_timeseries/ @elastic/kibana-app
/src/plugins/vis_type_metric/ @elastic/kibana-app
/src/plugins/kibana_legacy/ @elastic/kibana-app
/src/plugins/vis_default_editor/ @elastic/kibana-app
/src/plugins/vis_type_markdown/ @elastic/kibana-app
/src/plugins/vis_type_metric/ @elastic/kibana-app
/src/plugins/vis_type_table/ @elastic/kibana-app
/src/plugins/vis_type_tagcloud/ @elastic/kibana-app
/src/plugins/vis_type_timelion/ @elastic/kibana-app
/src/plugins/vis_type_timeseries/ @elastic/kibana-app
/src/plugins/vis_type_vega/ @elastic/kibana-app
/src/plugins/vis_type_vislib/ @elastic/kibana-app
/src/plugins/vis_type_xy/ @elastic/kibana-app
/src/plugins/visualize/ @elastic/kibana-app

# Core UI
# Exclude tutorials folder for now because they are not owned by Kibana app and most will move out soon
Expand Down
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"data": "src/plugins/data",
"embeddableApi": "src/plugins/embeddable",
"embeddableExamples": "examples/embeddable_examples",
"uiActionsExamples": "examples/ui_action_examples",
"share": "src/plugins/share",
"home": "src/plugins/home",
"charts": "src/plugins/charts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ esFilters: {
generateFilters: typeof generateFilters;
onlyDisabledFiltersChanged: (newFilters?: import("../common").Filter[] | undefined, oldFilters?: import("../common").Filter[] | undefined) => boolean;
changeTimeFilter: typeof changeTimeFilter;
convertRangeFilterToTimeRangeString: typeof convertRangeFilterToTimeRangeString;
mapAndFlattenFilters: (filters: import("../common").Filter[]) => import("../common").Filter[];
extractTimeFilter: typeof extractTimeFilter;
}
Expand Down
Binary file added docs/logs/images/alert-actions-menu.png
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/logs/images/alert-flyout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/logs/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ In this case, you will only see the logs for the selected component.
* <<xpack-logs-using>>
* <<xpack-logs-configuring>>
* <<xpack-logs-analysis>>
* <<xpack-logs-alerting>>

[role="screenshot"]
image::logs/images/logs-console.png[Log Console in Kibana]
Expand All @@ -30,3 +31,5 @@ include::using.asciidoc[]
include::configuring.asciidoc[]

include::log-rate.asciidoc[]

include::logs-alerting.asciidoc[]
27 changes: 27 additions & 0 deletions docs/logs/logs-alerting.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[role="xpack"]
[[xpack-logs-alerting]]
== Logs alerting

[float]
=== Overview

To use the alerting functionality you need to {kibana-ref}/alerting-getting-started.html#alerting-setup-prerequisites[set up alerting].

You can then select the *Create alert* option, from the *Alerts* actions dropdown.

[role="screenshot"]
image::logs/images/alert-actions-menu.png[Screenshot showing alerts menu]

Within the alert flyout you can configure your logs alert:

[role="screenshot"]
image::logs/images/alert-flyout.png[Screenshot showing alerts flyout]

[float]
=== Fields and comparators

The comparators available for conditions depend on the chosen field. The combinations available are:

- Numeric fields: *more than*, *more than or equals*, *less than*, *less than or equals*, *equals*, and *does not equal*.
- Aggregatable fields: *is* and *is not*.
- Non-aggregatable fields: *matches*, *does not match*, *matches phrase*, *does not match phrase*.
4 changes: 2 additions & 2 deletions docs/user/alerting/action-types/pagerduty.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ section of the alert configuration and selecting *Add new*.
* Alternatively, create a connector by navigating to *Management* from the {kib} navbar and selecting
*Alerts and Actions*. Then, select the *Connectors* tab, click the *Create connector* button, and select the PagerDuty option.

. Configure the connector by giving it a name and optionally entering the API URL and Routing Key, or using the defaults.
. Configure the connector by giving it a name and entering the Integration Key, optionally entering a custom API URL.
+
See <<pagerduty-in-pagerduty, In PagerDuty>> for how to obtain the endpoint and key information from PagerDuty and
<<pagerduty-connector-configuration, Connector configuration>> for more details.
Expand Down Expand Up @@ -133,7 +133,7 @@ PagerDuty connectors have the following configuration properties:

Name:: The name of the connector. The name is used to identify a connector in the management UI connector listing, or in the connector list when configuring an action.
API URL:: An optional PagerDuty event URL. Defaults to `https://events.pagerduty.com/v2/enqueue`. If you are using the <<action-settings, `xpack.actions.whitelistedHosts`>> setting, make sure the hostname is whitelisted.
Routing Key:: A 32 character PagerDuty Integration Key for an integration on a service or on a global ruleset.
Integration Key:: A 32 character PagerDuty Integration Key for an integration on a service, also referred to as the routing key.

[float]
[[pagerduty-action-configuration]]
Expand Down
3 changes: 1 addition & 2 deletions examples/ui_action_examples/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
*/

import { UiActionExamplesPlugin } from './plugin';
import { PluginInitializer } from '../../../src/core/public';

export const plugin: PluginInitializer<void, void> = () => new UiActionExamplesPlugin();
export const plugin = () => new UiActionExamplesPlugin();

export { HELLO_WORLD_TRIGGER_ID } from './hello_world_trigger';
export { ACTION_HELLO_WORLD } from './hello_world_action';
23 changes: 16 additions & 7 deletions examples/ui_action_examples/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@
* under the License.
*/

import { Plugin, CoreSetup } from '../../../src/core/public';
import { UiActionsSetup } from '../../../src/plugins/ui_actions/public';
import { Plugin, CoreSetup, CoreStart } from '../../../src/core/public';
import { UiActionsSetup, UiActionsStart } from '../../../src/plugins/ui_actions/public';
import { createHelloWorldAction, ACTION_HELLO_WORLD } from './hello_world_action';
import { helloWorldTrigger, HELLO_WORLD_TRIGGER_ID } from './hello_world_trigger';

interface UiActionExamplesSetupDependencies {
export interface UiActionExamplesSetupDependencies {
uiActions: UiActionsSetup;
}

export interface UiActionExamplesStartDependencies {
uiActions: UiActionsStart;
}

declare module '../../../src/plugins/ui_actions/public' {
export interface TriggerContextMapping {
[HELLO_WORLD_TRIGGER_ID]: {};
Expand All @@ -37,18 +41,23 @@ declare module '../../../src/plugins/ui_actions/public' {
}

export class UiActionExamplesPlugin
implements Plugin<void, void, UiActionExamplesSetupDependencies> {
public setup(core: CoreSetup, { uiActions }: UiActionExamplesSetupDependencies) {
implements
Plugin<void, void, UiActionExamplesSetupDependencies, UiActionExamplesStartDependencies> {
public setup(
core: CoreSetup<UiActionExamplesStartDependencies>,
{ uiActions }: UiActionExamplesSetupDependencies
) {
uiActions.registerTrigger(helloWorldTrigger);

const helloWorldAction = createHelloWorldAction(async () => ({
openModal: (await core.getStartServices())[0].overlays.openModal,
}));

uiActions.registerAction(helloWorldAction);
uiActions.attachAction(helloWorldTrigger.id, helloWorldAction);
uiActions.addTriggerAction(helloWorldTrigger.id, helloWorldAction);
}

public start() {}
public start(core: CoreStart, plugins: UiActionExamplesStartDependencies) {}

public stop() {}
}
3 changes: 1 addition & 2 deletions examples/ui_actions_explorer/public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ const ActionsExplorer = ({ uiActionsApi, openModal }: Props) => {
);
},
});
uiActionsApi.registerAction(dynamicAction);
uiActionsApi.attachAction(HELLO_WORLD_TRIGGER_ID, dynamicAction);
uiActionsApi.addTriggerAction(HELLO_WORLD_TRIGGER_ID, dynamicAction);
setConfirmationText(
`You've successfully added a new action: ${dynamicAction.getDisplayName(
{}
Expand Down
16 changes: 8 additions & 8 deletions examples/ui_actions_explorer/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,21 @@ export class UiActionsExplorerPlugin implements Plugin<void, void, {}, StartDeps

const startServices = core.getStartServices();

deps.uiActions.attachAction(
deps.uiActions.addTriggerAction(
USER_TRIGGER,
createPhoneUserAction(async () => (await startServices)[1].uiActions)
);
deps.uiActions.attachAction(
deps.uiActions.addTriggerAction(
USER_TRIGGER,
createEditUserAction(async () => (await startServices)[0].overlays.openModal)
);

deps.uiActions.attachAction(COUNTRY_TRIGGER, viewInMapsAction);
deps.uiActions.attachAction(COUNTRY_TRIGGER, lookUpWeatherAction);
deps.uiActions.attachAction(COUNTRY_TRIGGER, showcasePluggability);
deps.uiActions.attachAction(PHONE_TRIGGER, makePhoneCallAction);
deps.uiActions.attachAction(PHONE_TRIGGER, showcasePluggability);
deps.uiActions.attachAction(USER_TRIGGER, showcasePluggability);
deps.uiActions.addTriggerAction(COUNTRY_TRIGGER, viewInMapsAction);
deps.uiActions.addTriggerAction(COUNTRY_TRIGGER, lookUpWeatherAction);
deps.uiActions.addTriggerAction(COUNTRY_TRIGGER, showcasePluggability);
deps.uiActions.addTriggerAction(PHONE_TRIGGER, makePhoneCallAction);
deps.uiActions.addTriggerAction(PHONE_TRIGGER, showcasePluggability);
deps.uiActions.addTriggerAction(USER_TRIGGER, showcasePluggability);

core.application.register({
id: 'uiActionsExplorer',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"babel-plugin-istanbul": "^6.0.0",
"backport": "5.1.3",
"backport": "5.4.1",
"chai": "3.5.0",
"chance": "1.0.18",
"cheerio": "0.22.0",
Expand Down
1 change: 1 addition & 0 deletions src/core/public/overlays/flyout/flyout_service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export interface OverlayFlyoutStart {
export interface OverlayFlyoutOpenOptions {
className?: string;
closeButtonAriaLabel?: string;
ownFocus?: boolean;
'data-test-subj'?: string;
}

Expand Down
3 changes: 2 additions & 1 deletion src/dev/storybook/aliases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
*/

export const storybookAliases = {
advanced_ui_actions: 'x-pack/plugins/advanced_ui_actions/scripts/storybook.js',
apm: 'x-pack/plugins/apm/scripts/storybook.js',
canvas: 'x-pack/legacy/plugins/canvas/scripts/storybook_new.js',
codeeditor: 'src/plugins/kibana_react/public/code_editor/scripts/storybook.ts',
dashboard_enhanced: 'x-pack/plugins/dashboard_enhanced/scripts/storybook.js',
drilldowns: 'x-pack/plugins/drilldowns/scripts/storybook.js',
embeddable: 'src/plugins/embeddable/scripts/storybook.js',
infra: 'x-pack/legacy/plugins/infra/scripts/storybook.js',
siem: 'x-pack/plugins/siem/scripts/storybook.js',
ui_actions: 'x-pack/plugins/advanced_ui_actions/scripts/storybook.js',
};
Binary file not shown.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface ClonePanelActionContext {
export class ClonePanelAction implements ActionByType<typeof ACTION_CLONE_PANEL> {
public readonly type = ACTION_CLONE_PANEL;
public readonly id = ACTION_CLONE_PANEL;
public order = 11;
public order = 45;

constructor(private core: CoreStart) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface ReplacePanelActionContext {
export class ReplacePanelAction implements ActionByType<typeof ACTION_REPLACE_PANEL> {
public readonly type = ACTION_REPLACE_PANEL;
public readonly id = ACTION_REPLACE_PANEL;
public order = 11;
public order = 3;

constructor(
private core: CoreStart,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ test('DashboardContainer in edit mode shows edit mode actions', async () => {

const editModeAction = createEditModeAction();
uiActionsSetup.registerAction(editModeAction);
uiActionsSetup.attachAction(CONTEXT_MENU_TRIGGER, editModeAction);
uiActionsSetup.addTriggerAction(CONTEXT_MENU_TRIGGER, editModeAction);
setup.registerEmbeddableFactory(
CONTACT_CARD_EMBEDDABLE,
new ContactCardEmbeddableFactory((() => null) as any, {} as any)
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/dashboard/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class DashboardPlugin
): Setup {
const expandPanelAction = new ExpandPanelAction();
uiActions.registerAction(expandPanelAction);
uiActions.attachAction(CONTEXT_MENU_TRIGGER, expandPanelAction);
uiActions.attachAction(CONTEXT_MENU_TRIGGER, expandPanelAction.id);
const startServices = core.getStartServices();

if (share) {
Expand Down Expand Up @@ -310,11 +310,11 @@ export class DashboardPlugin
plugins.embeddable.getEmbeddableFactories
);
uiActions.registerAction(changeViewAction);
uiActions.attachAction(CONTEXT_MENU_TRIGGER, changeViewAction);
uiActions.attachAction(CONTEXT_MENU_TRIGGER, changeViewAction.id);

const clonePanelAction = new ClonePanelAction(core);
uiActions.registerAction(clonePanelAction);
uiActions.attachAction(CONTEXT_MENU_TRIGGER, clonePanelAction);
uiActions.attachAction(CONTEXT_MENU_TRIGGER, clonePanelAction.id);

const savedDashboardLoader = createSavedDashboardLoader({
savedObjectsClient: core.savedObjects.client,
Expand Down
1 change: 1 addition & 0 deletions src/plugins/data/public/actions/apply_filter_action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export function createFilterAction(
return createAction<typeof ACTION_GLOBAL_APPLY_FILTER>({
type: ACTION_GLOBAL_APPLY_FILTER,
id: ACTION_GLOBAL_APPLY_FILTER,
getIconType: () => 'filter',
getDisplayName: () => {
return i18n.translate('data.filter.applyFilterActionTitle', {
defaultMessage: 'Apply filter to current view',
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/data/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import {
changeTimeFilter,
mapAndFlattenFilters,
extractTimeFilter,
convertRangeFilterToTimeRangeString,
} from './query';

// Filter helpers namespace:
Expand Down Expand Up @@ -96,6 +97,7 @@ export const esFilters = {
onlyDisabledFiltersChanged,

changeTimeFilter,
convertRangeFilterToTimeRangeString,
mapAndFlattenFilters,
extractTimeFilter,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ const indexPatternCache = createIndexPatternCache();

type IndexPatternCachedFieldType = 'id' | 'title';

export interface IndexPatternSavedObjectAttrs {
title: string;
}

export class IndexPatternsService {
private config: IUiSettingsClient;
private savedObjectsClient: SavedObjectsClientContract;
private savedObjectsCache?: Array<SimpleSavedObject<Record<string, any>>> | null;
private savedObjectsCache?: Array<SimpleSavedObject<IndexPatternSavedObjectAttrs>> | null;
private apiClient: IndexPatternsApiClient;
ensureDefaultIndexPattern: EnsureDefaultIndexPattern;

Expand All @@ -53,7 +57,7 @@ export class IndexPatternsService {

private async refreshSavedObjectsCache() {
this.savedObjectsCache = (
await this.savedObjectsClient.find<Record<string, any>>({
await this.savedObjectsClient.find<IndexPatternSavedObjectAttrs>({
type: 'index-pattern',
fields: ['title'],
perPage: 10000,
Expand Down
Loading

0 comments on commit 85a6679

Please sign in to comment.