Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into np-migrate-coordi…
Browse files Browse the repository at this point in the history
…nate-maps
  • Loading branch information
Aaron Caldwell committed May 6, 2020
2 parents f4af673 + eef220e commit 46ad010
Show file tree
Hide file tree
Showing 150 changed files with 2,323 additions and 826 deletions.
Binary file modified docs/management/alerting/images/alerts-and-actions-ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/management/alerting/images/alerts-details-muting.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 modified docs/management/alerting/images/alerts-filter-by-action-type.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 modified docs/management/alerting/images/alerts-filter-by-type.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 modified docs/management/alerting/images/individual-mute-disable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/user/alerting/defining-alerts.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ image::images/alert-flyout-sections.png[The three sections of an alert definitio
All alert share the following four properties in common:

[role="screenshot"]
image::images/alert-flyout-general-details.png[All alerts have name, tags, check every, and re-notify every properties in common]
image::images/alert-flyout-general-details.png[alt='All alerts have name, tags, check every, and notify every properties in common']

Name:: The name of the alert. While this name does not have to be unique, the name can be referenced in actions and also appears in the searchable alert listing in the management UI. A distinctive name can help identify and find an alert.
Tags:: A list of tag names that can be applied to an alert. Tags can help you organize and find alerts, because tags appear in the alert listing in the management UI which is searchable by tag.
Check every:: This value determines how frequently the alert conditions below are checked. Note that the timing of background alert checks are not guaranteed, particularly for intervals of less than 10 seconds. See <<alerting-scale-performance>> for more information.
Re-notify every:: This value limits how often actions are repeated when an alert instance remains active across alert checks. See <<alerting-concepts-suppressing-duplicate-notifications>> for more information.
Notify every:: This value limits how often actions are repeated when an alert instance remains active across alert checks. See <<alerting-concepts-suppressing-duplicate-notifications>> for more information.

[float]
[[defining-alerts-type-conditions]]
Expand Down
Binary file modified docs/user/alerting/images/alert-flyout-action-type-selection.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 modified docs/user/alerting/images/alert-flyout-alert-conditions.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 modified docs/user/alerting/images/alert-flyout-alert-type-selection.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 modified docs/user/alerting/images/alert-flyout-general-details.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/user/alerting/images/alert-types-index-threshold-select.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 modified docs/user/alerting/images/alerting-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export default function({ getService, getPageObjects }: PluginFunctionalProvider
}, i)) as any;
};

describe('application status management', () => {
// FLAKY: https://github.com/elastic/kibana/issues/65423
describe.skip('application status management', () => {
beforeEach(async () => {
await PageObjects.common.navigateToApp('app_status_start');
});
Expand Down
13 changes: 13 additions & 0 deletions x-pack/plugins/actions/server/action_type_registry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@ describe('register()', () => {
`);
});

test('shallow clones the given action type', () => {
const myType: ActionType = {
id: 'my-action-type',
name: 'My action type',
minimumLicenseRequired: 'basic',
executor,
};
const actionTypeRegistry = new ActionTypeRegistry(actionTypeRegistryParams);
actionTypeRegistry.register(myType);
myType.name = 'Changed';
expect(actionTypeRegistry.get('my-action-type').name).toEqual('My action type');
});

test('throws error if action type already registered', () => {
const actionTypeRegistry = new ActionTypeRegistry(actionTypeRegistryParams);
actionTypeRegistry.register({
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/actions/server/action_type_registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class ActionTypeRegistry {
)
);
}
this.actionTypes.set(actionType.id, actionType);
this.actionTypes.set(actionType.id, { ...actionType });
this.taskManager.registerTaskDefinitions({
[`actions:${actionType.id}`]: {
title: actionType.name,
Expand Down
19 changes: 19 additions & 0 deletions x-pack/plugins/alerting/server/alert_type_registry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,25 @@ describe('register()', () => {
`);
});

test('shallow clones the given alert type', () => {
const alertType: AlertType = {
id: 'test',
name: 'Test',
actionGroups: [
{
id: 'default',
name: 'Default',
},
],
defaultActionGroupId: 'default',
executor: jest.fn(),
};
const registry = new AlertTypeRegistry(alertTypeRegistryParams);
registry.register(alertType);
alertType.name = 'Changed';
expect(registry.get('test').name).toEqual('Test');
});

test('should throw an error if type is already registered', () => {
const registry = new AlertTypeRegistry(alertTypeRegistryParams);
registry.register({
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/alerting/server/alert_type_registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class AlertTypeRegistry {
);
}
alertType.actionVariables = normalizedActionVariables(alertType.actionVariables);
this.alertTypes.set(alertType.id, alertType);
this.alertTypes.set(alertType.id, { ...alertType });
this.taskManager.registerTaskDefinitions({
[`alerting:${alertType.id}`]: {
title: alertType.name,
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/apm/common/service_map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export interface Connection {
}

export interface ServiceNodeMetrics {
numInstances: number;
avgMemoryUsage: number | null;
avgCpuUsage: number | null;
avgTransactionDuration: number | null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ const ANOMALY_DETECTION_TITLE = i18n.translate(
{ defaultMessage: 'Anomaly Detection' }
);

const ANOMALY_DETECTION_INFO = i18n.translate(
'xpack.apm.serviceMap.anomalyDetectionPopoverInfo',
const ANOMALY_DETECTION_TOOLTIP = i18n.translate(
'xpack.apm.serviceMap.anomalyDetectionPopoverTooltip',
{
defaultMessage:
'Display the health of your service by enabling the anomaly detection feature in Machine Learning.'
'Service health indicators are powered by the anomaly detection feature in machine learning'
}
);

Expand All @@ -108,11 +108,11 @@ const ANOMALY_DETECTION_LINK = i18n.translate(
{ defaultMessage: 'View anomalies' }
);

const ANOMALY_DETECTION_ENABLE_TEXT = i18n.translate(
'xpack.apm.serviceMap.anomalyDetectionPopoverEnable',
const ANOMALY_DETECTION_DISABLED_TEXT = i18n.translate(
'xpack.apm.serviceMap.anomalyDetectionPopoverDisabled',
{
defaultMessage:
'Enable anomaly detection from the Integrations menu in the Service details view.'
'Display service health indicators by enabling anomaly detection from the Integrations menu in the Service details view.'
}
);

Expand Down Expand Up @@ -154,15 +154,18 @@ export function Contents({
</FlexColumnItem>
{isService && (
<FlexColumnItem>
<section>
<HealthStatusTitle size="xxs">
<h3>{ANOMALY_DETECTION_TITLE}</h3>
</HealthStatusTitle>
&nbsp;
<EuiIconTip type="iInCircle" content={ANOMALY_DETECTION_INFO} />
</section>
{hasAnomalyDetection ? (
<>
<section>
<HealthStatusTitle size="xxs">
<h3>{ANOMALY_DETECTION_TITLE}</h3>
</HealthStatusTitle>
&nbsp;
<EuiIconTip
type="iInCircle"
content={ANOMALY_DETECTION_TOOLTIP}
/>
</section>
<ContentLine>
<EuiFlexGroup>
<EuiFlexItem>
Expand All @@ -188,7 +191,12 @@ export function Contents({
</ContentLine>
</>
) : (
<EnableText>{ANOMALY_DETECTION_ENABLE_TEXT}</EnableText>
<>
<HealthStatusTitle size="xxs">
<h3>{ANOMALY_DETECTION_TITLE}</h3>
</HealthStatusTitle>
<EnableText>{ANOMALY_DETECTION_DISABLED_TEXT}</EnableText>
</>
)}
<EuiHorizontalRule margin="xs" />
</FlexColumnItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ storiesOf('app/ServiceMap/Popover/ServiceMetricList', module)
avgRequestsPerMinute={164.47222031860858}
avgCpuUsage={0.32809666568309237}
avgMemoryUsage={0.5504868173242986}
numInstances={2}
isLoading={false}
/>
))
Expand All @@ -27,7 +26,6 @@ storiesOf('app/ServiceMap/Popover/ServiceMetricList', module)
avgRequestsPerMinute={null}
avgCpuUsage={null}
avgMemoryUsage={null}
numInstances={1}
isLoading={true}
/>
))
Expand All @@ -38,7 +36,6 @@ storiesOf('app/ServiceMap/Popover/ServiceMetricList', module)
avgRequestsPerMinute={8.439583235652972}
avgCpuUsage={null}
avgMemoryUsage={null}
numInstances={1}
isLoading={false}
/>
))
Expand All @@ -49,7 +46,6 @@ storiesOf('app/ServiceMap/Popover/ServiceMetricList', module)
avgRequestsPerMinute={null}
avgCpuUsage={null}
avgMemoryUsage={null}
numInstances={1}
isLoading={false}
/>
));
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import {
EuiBadge,
EuiFlexGroup,
EuiFlexItem,
EuiLoadingSpinner
} from '@elastic/eui';
import { EuiFlexGroup, EuiLoadingSpinner } from '@elastic/eui';
import lightTheme from '@elastic/eui/dist/eui_theme_light.json';
import { i18n } from '@kbn/i18n';
import { isNumber } from 'lodash';
Expand All @@ -30,10 +25,6 @@ function LoadingSpinner() {
);
}

const BadgeRow = styled(EuiFlexItem)`
padding-bottom: ${lightTheme.gutterTypes.gutterSmall};
`;

export const ItemRow = styled('tr')`
line-height: 2;
`;
Expand All @@ -57,7 +48,6 @@ export function ServiceMetricList({
avgErrorsPerMinute,
avgCpuUsage,
avgMemoryUsage,
numInstances,
isLoading
}: ServiceMetricListProps) {
const listItems = [
Expand Down Expand Up @@ -110,39 +100,22 @@ export function ServiceMetricList({
: null
}
];
const showBadgeRow = numInstances > 1;

return isLoading ? (
<LoadingSpinner />
) : (
<>
{showBadgeRow && (
<BadgeRow>
<EuiFlexGroup gutterSize="none">
{numInstances > 1 && (
<EuiBadge iconType="apps" color="hollow">
{i18n.translate('xpack.apm.serviceMap.numInstancesMetric', {
values: { numInstances },
defaultMessage: '{numInstances} instances'
})}
</EuiBadge>
)}
</EuiFlexGroup>
</BadgeRow>
)}
<table>
<tbody>
{listItems.map(
({ title, description }) =>
description && (
<ItemRow key={title}>
<ItemTitle>{title}</ItemTitle>
<ItemDescription>{description}</ItemDescription>
</ItemRow>
)
)}
</tbody>
</table>
</>
<table>
<tbody>
{listItems.map(
({ title, description }) =>
description && (
<ItemRow key={title}>
<ItemTitle>{title}</ItemTitle>
<ItemDescription>{description}</ItemDescription>
</ItemRow>
)
)}
</tbody>
</table>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import {
TRANSACTION_DURATION,
METRIC_SYSTEM_CPU_PERCENT,
METRIC_SYSTEM_FREE_MEMORY,
METRIC_SYSTEM_TOTAL_MEMORY,
SERVICE_NODE_NAME
METRIC_SYSTEM_TOTAL_MEMORY
} from '../../../common/elasticsearch_fieldnames';
import { percentMemoryUsedScript } from '../metrics/by_agent/shared/memory';

Expand Down Expand Up @@ -56,22 +55,19 @@ export async function getServiceMapServiceNodeInfo({
errorMetrics,
transactionMetrics,
cpuMetrics,
memoryMetrics,
instanceMetrics
memoryMetrics
] = await Promise.all([
getErrorMetrics(taskParams),
getTransactionMetrics(taskParams),
getCpuMetrics(taskParams),
getMemoryMetrics(taskParams),
getNumInstances(taskParams)
getMemoryMetrics(taskParams)
]);

return {
...errorMetrics,
...transactionMetrics,
...cpuMetrics,
...memoryMetrics,
...instanceMetrics
...memoryMetrics
};
}

Expand Down Expand Up @@ -226,47 +222,3 @@ async function getMemoryMetrics({
avgMemoryUsage: response.aggregations?.avgMemoryUsage.value ?? null
};
}

async function getNumInstances({
setup,
filter
}: TaskParameters): Promise<{ numInstances: number }> {
const { client, indices } = setup;
const response = await client.search({
index: indices['apm_oss.transactionIndices'],
body: {
query: {
bool: {
filter: filter.concat([
{
term: {
[PROCESSOR_EVENT]: 'transaction'
}
},
{
exists: {
field: SERVICE_NODE_NAME
}
},
{
exists: {
field: METRIC_SYSTEM_TOTAL_MEMORY
}
}
])
}
},
aggs: {
instances: {
cardinality: {
field: SERVICE_NODE_NAME
}
}
}
}
});

return {
numInstances: response.aggregations?.instances.value || 1
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const PolicyLink: React.FC<{ name: string; route: string; href: string }> = ({
const clickHandler = useNavigateByRouterEventHandler(route);
return (
// eslint-disable-next-line @elastic/eui/href-or-on-click
<EuiLink href={href} onClick={clickHandler}>
<EuiLink href={href} onClick={clickHandler} data-test-subj="policyNameLink">
{name}
</EuiLink>
);
Expand Down Expand Up @@ -134,6 +134,7 @@ export const PolicyList = React.memo(() => {
render(version: string) {
return (
<LinkToApp
data-test-subj="agentConfigLink"
appId="ingestManager"
appPath={`#/configs/${version}`}
href={`${services.application.getUrlForApp('ingestManager')}#/configs/${version}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import { CreateDocumentResponse } from 'elasticsearch';
import { APICaller } from 'kibana/server';

import { LIST_INDEX } from './lists_services_mock_constants';
import { getShardMock } from './get_shard_mock';
import { LIST_INDEX } from './constants.mock';
import { getShardMock } from './get_shard.mock';

export const getEmptyCreateDocumentResponseMock = (): CreateDocumentResponse => ({
_id: 'elastic-id-123',
Expand Down
Loading

0 comments on commit 46ad010

Please sign in to comment.