Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/elastic/kibana into actio…
Browse files Browse the repository at this point in the history
…ns/alert-history-telemetry
  • Loading branch information
ymao1 committed Apr 14, 2021
2 parents bc4dbc4 + 69f570f commit 6c31c26
Show file tree
Hide file tree
Showing 168 changed files with 6,060 additions and 1,118 deletions.
29 changes: 21 additions & 8 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,27 @@ which also contains the timelion APIs and backend, look at the vis_type_timelion
|<<uiactions-plugin>>
|An API for:
- creating custom functionality (`actions`)
- creating custom user interaction events (`triggers`)
- attaching and detaching `actions` to `triggers`.
- emitting `trigger` events
- executing `actions` attached to a given `trigger`.
- exposing a context menu for the user to choose the appropriate action when there are multiple actions attached to a single trigger.
|UI Actions plugins provides API to manage *triggers* and *actions*.
*Trigger* is an abstract description of user's intent to perform an action
(like user clicking on a value inside chart). It allows us to do runtime
binding between code from different plugins. For, example one such
trigger is when somebody applies filters on dashboard; another one is when
somebody opens a Dashboard panel context menu.
*Actions* are pieces of code that execute in response to a trigger. For example,
to the dashboard filtering trigger multiple actions can be attached. Once a user
filters on the dashboard all possible actions are displayed to the user in a
popup menu and the user has to chose one.
In general this plugin provides:
- Creating custom functionality (actions).
- Creating custom user interaction events (triggers).
- Attaching and detaching actions to triggers.
- Emitting trigger events.
- Executing actions attached to a given trigger.
- Exposing a context menu for the user to choose the appropriate action when there are multiple actions attached to a single trigger.
|{kib-repo}blob/{branch}/src/plugins/url_forwarding/README.md[urlForwarding]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

```typescript
start(core: CoreStart, { fieldFormats, logger }: IndexPatternsServiceStartDeps): {
indexPatternsServiceFactory: (savedObjectsClient: Pick<import("../../../../core/server").SavedObjectsClient, "get" | "delete" | "create" | "bulkCreate" | "checkConflicts" | "find" | "bulkGet" | "resolve" | "update" | "addToNamespaces" | "deleteFromNamespaces" | "bulkUpdate" | "removeReferencesTo" | "openPointInTimeForType" | "closePointInTime" | "createPointInTimeFinder" | "errors">, elasticsearchClient: ElasticsearchClient) => Promise<IndexPatternsCommonService>;
indexPatternsServiceFactory: (savedObjectsClient: Pick<import("../../../../core/server").SavedObjectsClient, "update" | "get" | "delete" | "create" | "bulkCreate" | "checkConflicts" | "find" | "bulkGet" | "resolve" | "addToNamespaces" | "deleteFromNamespaces" | "bulkUpdate" | "removeReferencesTo" | "openPointInTimeForType" | "closePointInTime" | "createPointInTimeFinder" | "errors">, elasticsearchClient: ElasticsearchClient) => Promise<IndexPatternsCommonService>;
};
```

Expand All @@ -22,6 +22,6 @@ start(core: CoreStart, { fieldFormats, logger }: IndexPatternsServiceStartDeps):
<b>Returns:</b>

`{
indexPatternsServiceFactory: (savedObjectsClient: Pick<import("../../../../core/server").SavedObjectsClient, "get" | "delete" | "create" | "bulkCreate" | "checkConflicts" | "find" | "bulkGet" | "resolve" | "update" | "addToNamespaces" | "deleteFromNamespaces" | "bulkUpdate" | "removeReferencesTo" | "openPointInTimeForType" | "closePointInTime" | "createPointInTimeFinder" | "errors">, elasticsearchClient: ElasticsearchClient) => Promise<IndexPatternsCommonService>;
indexPatternsServiceFactory: (savedObjectsClient: Pick<import("../../../../core/server").SavedObjectsClient, "update" | "get" | "delete" | "create" | "bulkCreate" | "checkConflicts" | "find" | "bulkGet" | "resolve" | "addToNamespaces" | "deleteFromNamespaces" | "bulkUpdate" | "removeReferencesTo" | "openPointInTimeForType" | "closePointInTime" | "createPointInTimeFinder" | "errors">, elasticsearchClient: ElasticsearchClient) => Promise<IndexPatternsCommonService>;
}`

4 changes: 2 additions & 2 deletions docs/user/monitoring/kibana-alerts.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ by running checks on a schedule time of 1 minute with a re-notify interval of 6
[[kibana-alerts-large-shard-size]]
== Large shard size

This alert is triggered if a large (primary) shard size is found on any of the
specified index patterns. The trigger condition is met if an index's shard size is
This alert is triggered if a large average shard size (across associated primaries) is found on any of the
specified index patterns. The trigger condition is met if an index's average shard size is
55gb or higher in the last 5 minutes. The alert is grouped across all indices that match
the default pattern of `*` by running checks on a schedule time of 1 minute with a re-notify
interval of 12 hours.
Expand Down
1 change: 1 addition & 0 deletions src/plugins/data/server/server.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import { PublicMethodsOf } from '@kbn/utility-types';
import { RecursiveReadonly } from '@kbn/utility-types';
import { RequestAdapter } from 'src/plugins/inspector/common';
import { RequestHandlerContext } from 'src/core/server';
import * as Rx from 'rxjs';
import { SavedObject } from 'kibana/server';
import { SavedObject as SavedObject_2 } from 'src/core/server';
import { SavedObjectsClientContract } from 'src/core/server';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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 React from 'react';
import { shallow } from 'enzyme';
import { DocViewerTab } from './doc_viewer_tab';
import { ElasticSearchHit } from '../../doc_views/doc_views_types';

describe('DocViewerTab', () => {
test('changing columns triggers an update', () => {
const props = {
title: 'test',
component: jest.fn(),
id: 1,
render: jest.fn(),
renderProps: {
hit: {} as ElasticSearchHit,
columns: ['test'],
},
};

const wrapper = shallow(<DocViewerTab {...props} />);

const nextProps = {
...props,
renderProps: {
hit: {} as ElasticSearchHit,
columns: ['test2'],
},
};

const shouldUpdate = (wrapper!.instance() as DocViewerTab).shouldComponentUpdate(nextProps, {
hasError: false,
error: '',
});
expect(shouldUpdate).toBe(true);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

import React from 'react';
import { isEqual } from 'lodash';
import { I18nProvider } from '@kbn/i18n/react';
import { DocViewRenderTab } from './doc_viewer_render_tab';
import { DocViewerError } from './doc_viewer_render_error';
Expand Down Expand Up @@ -46,6 +47,7 @@ export class DocViewerTab extends React.Component<Props, State> {
return (
nextProps.renderProps.hit._id !== this.props.renderProps.hit._id ||
nextProps.id !== this.props.id ||
!isEqual(nextProps.renderProps.columns, this.props.renderProps.columns) ||
nextState.hasError
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ describe('<FieldEditor />', () => {
expect(form.getErrorsMessages()).toEqual(['Awwww! Painless syntax error']);

// We change the type and expect the form error to not be there anymore
await changeFieldType('long');
await changeFieldType('keyword');
expect(form.getErrorsMessages()).toEqual([]);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
EuiSpacer,
EuiComboBoxOptionOption,
EuiCode,
EuiCallOut,
} from '@elastic/eui';
import type { CoreStart } from 'src/core/public';

Expand Down Expand Up @@ -138,6 +139,11 @@ const geti18nTexts = (): {
},
});

const changeWarning = i18n.translate('indexPatternFieldEditor.editor.form.changeWarning', {
defaultMessage:
'Changing name or type can break searches and visualizations that rely on this field.',
});

const formDeserializer = (field: Field): FieldFormInternal => {
let fieldType: Array<EuiComboBoxOptionOption<RuntimeType>>;
if (!field.type) {
Expand Down Expand Up @@ -204,6 +210,11 @@ const FieldEditorComponent = ({
clearSyntaxError();
}, [type, clearSyntaxError]);

const [{ name: updatedName, type: updatedType }] = useFormData({ form });
const nameHasChanged = Boolean(field?.name) && field?.name !== updatedName;
const typeHasChanged =
Boolean(field?.type) && field?.type !== (updatedType && updatedType[0].value);

return (
<Form form={form} className="indexPatternFieldEditor__form">
<EuiFlexGroup>
Expand Down Expand Up @@ -231,6 +242,18 @@ const FieldEditorComponent = ({
</EuiFlexItem>
</EuiFlexGroup>

{(nameHasChanged || typeHasChanged) && (
<>
<EuiSpacer size="xs" />
<EuiCallOut
color="warning"
title={changeWarning}
iconType="alert"
size="s"
data-test-subj="changeWarning"
/>
</>
)}
<EuiSpacer size="xl" />

{/* Set custom label */}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { savedObjectsRepositoryMock, loggingSystemMock } from '../../../../../co
import {
Collector,
createUsageCollectionSetupMock,
} from '../../../../usage_collection/server/usage_collection.mock';
} from '../../../../usage_collection/server/mocks';
import { MAIN_APP_DEFAULT_VIEW_ID } from '../../../../usage_collection/common/constants';
import { createCollectorFetchContextMock } from 'src/plugins/usage_collection/server/mocks';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,23 @@ import {
Collector,
createUsageCollectionSetupMock,
createCollectorFetchContextMock,
} from '../../../../usage_collection/server/usage_collection.mock';
} from '../../../../usage_collection/server/mocks';

import { registerCloudProviderUsageCollector } from './cloud_provider_collector';

describe('registerCloudProviderUsageCollector', () => {
let collector: Collector<unknown>;
const logger = loggingSystemMock.createLogger();

const usageCollectionMock = createUsageCollectionSetupMock();
usageCollectionMock.makeUsageCollector.mockImplementation((config) => {
collector = new Collector(logger, config);
return createUsageCollectionSetupMock().makeUsageCollector(config);
});

const mockedFetchContext = createCollectorFetchContextMock();

beforeEach(() => {
cloudDetailsMock.mockClear();
detectCloudServiceMock.mockClear();
const usageCollectionMock = createUsageCollectionSetupMock();
usageCollectionMock.makeUsageCollector.mockImplementation((config) => {
collector = new Collector(logger, config);
return createUsageCollectionSetupMock().makeUsageCollector(config);
});
registerCloudProviderUsageCollector(usageCollectionMock);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import {
Collector,
createUsageCollectionSetupMock,
} from '../../../../usage_collection/server/usage_collection.mock';
} from '../../../../usage_collection/server/mocks';
import { createCollectorFetchContextMock } from 'src/plugins/usage_collection/server/mocks';
import { registerCoreUsageCollector } from '.';
import { coreUsageDataServiceMock, loggingSystemMock } from '../../../../../core/server/mocks';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ export {
registerUiCounterSavedObjectType,
registerUiCountersRollups,
} from './ui_counters';
export {
registerUsageCountersRollups,
registerUsageCountersUsageCollector,
} from './usage_counters';
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
Collector,
createCollectorFetchContextMock,
createUsageCollectionSetupMock,
} from '../../../../usage_collection/server/usage_collection.mock';
} from '../../../../usage_collection/server/mocks';
import { registerKibanaUsageCollector } from './';

const logger = loggingSystemMock.createLogger();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
Collector,
createUsageCollectionSetupMock,
createCollectorFetchContextMock,
} from '../../../../usage_collection/server/usage_collection.mock';
} from '../../../../usage_collection/server/mocks';

import {
registerManagementUsageCollector,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
Collector,
createUsageCollectionSetupMock,
createCollectorFetchContextMock,
} from '../../../../usage_collection/server/usage_collection.mock';
} from '../../../../usage_collection/server/mocks';

import { registerOpsStatsCollector } from './';
import { OpsMetrics } from '../../../../../core/server';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* 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 type { UICounterSavedObject } from '../ui_counter_saved_object_type';
export const rawUiCounters: UICounterSavedObject[] = [
{
type: 'ui-counter',
id: 'Kibana_home:23102020:click:different_type',
attributes: {
count: 1,
},
references: [],
updated_at: '2020-11-24T11:27:57.067Z',
version: 'WzI5NDRd',
},
{
type: 'ui-counter',
id: 'Kibana_home:25102020:loaded:intersecting_event',
attributes: {
count: 1,
},
references: [],
updated_at: '2020-10-25T11:27:57.067Z',
version: 'WzI5NDRd',
},
{
type: 'ui-counter',
id: 'Kibana_home:23102020:loaded:intersecting_event',
attributes: {
count: 3,
},
references: [],
updated_at: '2020-10-23T11:27:57.067Z',
version: 'WzI5NDRd',
},
{
type: 'ui-counter',
id: 'Kibana_home:24112020:click:only_reported_in_ui_counters',
attributes: {
count: 1,
},
references: [],
updated_at: '2020-11-24T11:27:57.067Z',
version: 'WzI5NDRd',
},
];
Loading

0 comments on commit 6c31c26

Please sign in to comment.