Skip to content

Commit

Permalink
Merge branch 'master' into reporting/canvas-layout
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Oct 21, 2020
2 parents 58dd494 + a18856a commit f4f6bbe
Show file tree
Hide file tree
Showing 46 changed files with 953 additions and 226 deletions.
27 changes: 27 additions & 0 deletions docs/user/monitoring/kibana-alerts.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,33 @@ default, the trigger condition is set at 85% or more averaged over the last 5
minutes. The alert is grouped across all the nodes of the cluster by running
checks on a schedule time of 1 minute with a re-notify internal of 1 day.

[discrete]
[[kibana-alerts-disk-usage-threshold]]
== Disk usage threshold

This alert is triggered when a node is nearly at disk capacity. By
default, the trigger condition is set at 80% or more averaged over the last 5
minutes. The alert is grouped across all the nodes of the cluster by running
checks on a schedule time of 1 minute with a re-notify internal of 1 day.

[discrete]
[[kibana-alerts-jvm-memory-threshold]]
== JVM memory threshold

This alert is triggered when a node runs a consistently high JVM memory usage. By
default, the trigger condition is set at 85% or more averaged over the last 5
minutes. The alert is grouped across all the nodes of the cluster by running
checks on a schedule time of 1 minute with a re-notify internal of 1 day.

[discrete]
[[kibana-alerts-missing-monitoring-data]]
== Missing monitoring data

This alert is triggered when any stack products nodes or instances stop sending
monitoring data. By default, the trigger condition is set to missing for 15 minutes
looking back 1 day. The alert is grouped across all the nodes of the cluster by running
checks on a schedule time of 1 minute with a re-notify internal of 6 hours.

NOTE: Some action types are subscription features, while others are free.
For a comparison of the Elastic subscription levels, see the alerting section of
the {subscriptions}[Subscriptions page].
19 changes: 19 additions & 0 deletions src/plugins/kibana_usage_collection/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": [
"common/*",
"server/**/**/*",
"../../../typings/*"
],
"references": [
{ "path": "../../core/tsconfig.json" },
{ "path": "../../plugins/usage_collection/tsconfig.json" },
]
}
4 changes: 4 additions & 0 deletions tasks/config/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ module.exports = function () {
'test/server_integration/http/ssl_redirect/config.js',
'--config',
'test/server_integration/http/cache/config.js',
'--config',
'test/server_integration/http/ssl_with_p12/config.js',
'--config',
'test/server_integration/http/ssl_with_p12_intermediate/config.js',
'--bail',
'--debug',
'--kibana-install-dir',
Expand Down
1 change: 1 addition & 0 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
{ "path": "../src/plugins/usage_collection/tsconfig.json" },
{ "path": "../src/plugins/telemetry_collection_manager/tsconfig.json" },
{ "path": "../src/plugins/telemetry/tsconfig.json" },
{ "path": "../src/plugins/kibana_usage_collection/tsconfig.json" },
{ "path": "../src/plugins/newsfeed/tsconfig.json" }
]
}
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"src/plugins/usage_collection/**/*",
"src/plugins/telemetry_collection_manager/**/*",
"src/plugins/telemetry/**/*",
"src/plugins/kibana_usage_collection/**/*",
"src/plugins/newsfeed/**/*"
// In the build we actually exclude **/public/**/* from this config so that
// we can run the TSC on both this and the .browser version of this config
Expand All @@ -29,6 +30,7 @@
{ "path": "./src/plugins/usage_collection/tsconfig.json" },
{ "path": "./src/plugins/telemetry_collection_manager/tsconfig.json" },
{ "path": "./src/plugins/telemetry/tsconfig.json" },
{ "path": "./src/plugins/kibana_usage_collection/tsconfig.json" },
{ "path": "./src/plugins/newsfeed/tsconfig.json" }
]
}
1 change: 1 addition & 0 deletions tsconfig.refs.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
{ "path": "./src/plugins/usage_collection/tsconfig.json" },
{ "path": "./src/plugins/telemetry_collection_manager/tsconfig.json" },
{ "path": "./src/plugins/telemetry/tsconfig.json" },
{ "path": "./src/plugins/kibana_usage_collection/tsconfig.json" },
{ "path": "./src/plugins/newsfeed/tsconfig.json" },
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export interface DeleteAgentPolicyRequest {

export interface DeleteAgentPolicyResponse {
id: string;
name: string;
}

export interface GetFullAgentPolicyRequest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@ export interface DeletePackagePoliciesRequest {

export type DeletePackagePoliciesResponse = Array<{
id: string;
name?: string;
success: boolean;
}>;
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const AgentPolicyDeleteProvider: React.FunctionComponent<Props> = ({ chil
notifications.toasts.addSuccess(
i18n.translate('xpack.ingestManager.deleteAgentPolicy.successSingleNotificationTitle', {
defaultMessage: "Deleted agent policy '{id}'",
values: { id: agentPolicy },
values: { id: data.name || data.id },
})
);
if (onSuccessCallback.current) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const PackagePolicyDeleteProvider: React.FunctionComponent<Props> = ({
'xpack.ingestManager.deletePackagePolicy.successSingleNotificationTitle',
{
defaultMessage: "Deleted integration '{id}'",
values: { id: successfulResults[0].id },
values: { id: successfulResults[0].name || successfulResults[0].id },
}
);
notifications.toasts.addSuccess(successMessage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export const AgentListPage: React.FunctionComponent<{}> = () => {
// Agent data states
const [showInactive, setShowInactive] = useState<boolean>(false);
const [showUpgradeable, setShowUpgradeable] = useState<boolean>(false);

// Table and search states
const [search, setSearch] = useState<string>(defaultKuery);
const [selectionMode, setSelectionMode] = useState<SelectionMode>('manual');
Expand All @@ -188,11 +189,20 @@ export const AgentListPage: React.FunctionComponent<{}> = () => {
const [isStatusFilterOpen, setIsStatutsFilterOpen] = useState<boolean>(false);
const [selectedStatus, setSelectedStatus] = useState<string[]>([]);

const isUsingFilter =
search.trim() ||
selectedAgentPolicies.length ||
selectedStatus.length ||
showInactive ||
showUpgradeable;

const clearFilters = useCallback(() => {
setSearch('');
setSelectedAgentPolicies([]);
setSelectedStatus([]);
}, [setSearch, setSelectedAgentPolicies, setSelectedStatus]);
setShowInactive(false);
setShowUpgradeable(false);
}, [setSearch, setSelectedAgentPolicies, setSelectedStatus, setShowInactive, setShowUpgradeable]);

// Add a agent policy id to current search
const addAgentPolicyFilter = (policyId: string) => {
Expand Down Expand Up @@ -638,7 +648,7 @@ export const AgentListPage: React.FunctionComponent<{}> = () => {
id="xpack.ingestManager.agentList.loadingAgentsMessage"
defaultMessage="Loading agents…"
/>
) : search.trim() || selectedAgentPolicies.length || selectedStatus.length ? (
) : isUsingFilter ? (
<FormattedMessage
id="xpack.ingestManager.agentList.noFilteredAgentsPrompt"
defaultMessage="No agents found. {clearFiltersLink}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ class AgentPolicyService {
await this.triggerAgentPolicyUpdatedEvent(soClient, 'deleted', id);
return {
id,
name: agentPolicy.name,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,15 @@ class PackagePolicyService {

for (const id of ids) {
try {
const oldPackagePolicy = await this.get(soClient, id);
if (!oldPackagePolicy) {
const packagePolicy = await this.get(soClient, id);
if (!packagePolicy) {
throw new Error('Package policy not found');
}
if (!options?.skipUnassignFromAgentPolicies) {
await agentPolicyService.unassignPackagePolicies(
soClient,
oldPackagePolicy.policy_id,
[oldPackagePolicy.id],
packagePolicy.policy_id,
[packagePolicy.id],
{
user: options?.user,
}
Expand All @@ -303,6 +303,7 @@ class PackagePolicyService {
await soClient.delete(SAVED_OBJECT_TYPE, id);
result.push({
id,
name: packagePolicy.name,
success: true,
});
} catch (e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
EuiLink,
EuiSelect,
EuiSpacer,
EuiSwitch,
EuiTitle,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
Expand Down Expand Up @@ -138,7 +139,7 @@ export const AdvancedStepForm: FC<CreateAnalyticsStepProps> = ({
const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = docLinks;

const { setEstimatedModelMemoryLimit, setFormState } = actions;
const { form, isJobCreated } = state;
const { form, isJobCreated, estimatedModelMemoryLimit } = state;
const {
computeFeatureInfluence,
eta,
Expand All @@ -159,6 +160,7 @@ export const AdvancedStepForm: FC<CreateAnalyticsStepProps> = ({
outlierFraction,
predictionFieldName,
randomizeSeed,
useEstimatedMml,
} = form;

const [numTopClassesOptions, setNumTopClassesOptions] = useState<EuiComboBoxOptionOption[]>([
Expand Down Expand Up @@ -204,7 +206,9 @@ export const AdvancedStepForm: FC<CreateAnalyticsStepProps> = ({
if (success) {
if (modelMemoryLimit !== expectedMemory) {
setEstimatedModelMemoryLimit(expectedMemory);
setFormState({ modelMemoryLimit: expectedMemory });
if (useEstimatedMml === true) {
setFormState({ modelMemoryLimit: expectedMemory });
}
}
} else {
// Check which field is invalid
Expand Down Expand Up @@ -481,18 +485,35 @@ export const AdvancedStepForm: FC<CreateAnalyticsStepProps> = ({
}
)}
>
<EuiFieldText
placeholder={
jobType !== undefined
? DEFAULT_MODEL_MEMORY_LIMIT[jobType]
: DEFAULT_MODEL_MEMORY_LIMIT.outlier_detection
}
disabled={isJobCreated}
value={modelMemoryLimit || ''}
onChange={(e) => setFormState({ modelMemoryLimit: e.target.value })}
isInvalid={modelMemoryLimitValidationResult !== null}
data-test-subj="mlAnalyticsCreateJobWizardModelMemoryInput"
/>
<>
<EuiFieldText
placeholder={
jobType !== undefined
? DEFAULT_MODEL_MEMORY_LIMIT[jobType]
: DEFAULT_MODEL_MEMORY_LIMIT.outlier_detection
}
disabled={isJobCreated || useEstimatedMml}
value={useEstimatedMml ? estimatedModelMemoryLimit : modelMemoryLimit || ''}
onChange={(e) => setFormState({ modelMemoryLimit: e.target.value })}
isInvalid={modelMemoryLimitValidationResult !== null}
data-test-subj="mlAnalyticsCreateJobWizardModelMemoryInput"
/>
<EuiSpacer size="s" />
<EuiSwitch
disabled={isJobCreated}
name="mlDataFrameAnalyticsUseEstimatedMml"
label={i18n.translate('xpack.ml.dataframe.analytics.create.useEstimatedMmlLabel', {
defaultMessage: 'Use estimated model memory limit',
})}
checked={useEstimatedMml === true}
onChange={() =>
setFormState({
useEstimatedMml: !useEstimatedMml,
})
}
data-test-subj="mlAnalyticsCreateJobWizardUseEstimatedMml"
/>
</>
</EuiFormRow>
</EuiFlexItem>
<EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export const ConfigurationStepForm: FC<CreateAnalyticsStepProps> = ({
requiredFieldsError,
sourceIndex,
trainingPercent,
useEstimatedMml,
} = form;

const toastNotifications = getToastNotifications();
Expand Down Expand Up @@ -164,7 +165,8 @@ export const ConfigurationStepForm: FC<CreateAnalyticsStepProps> = ({

const debouncedGetExplainData = debounce(async () => {
const jobTypeChanged = previousJobType !== jobType;
const shouldUpdateModelMemoryLimit = !firstUpdate.current || !modelMemoryLimit;
const shouldUpdateModelMemoryLimit =
(!firstUpdate.current || !modelMemoryLimit) && useEstimatedMml === true;
const shouldUpdateEstimatedMml =
!firstUpdate.current || !modelMemoryLimit || estimatedModelMemoryLimit === '';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export interface State {
sourceIndexFieldsCheckFailed: boolean;
standardizationEnabled: undefined | string;
trainingPercent: number;
useEstimatedMml: boolean;
};
disabled: boolean;
indexPatternsMap: SourceIndexMap;
Expand Down Expand Up @@ -161,6 +162,7 @@ export const getInitialState = (): State => ({
sourceIndexFieldsCheckFailed: false,
standardizationEnabled: 'true',
trainingPercent: 80,
useEstimatedMml: true,
},
jobConfig: {},
disabled:
Expand Down
Loading

0 comments on commit f4f6bbe

Please sign in to comment.