Skip to content

Commit

Permalink
Merge branch 'main' into feature/94603
Browse files Browse the repository at this point in the history
  • Loading branch information
dej611 authored Oct 11, 2022
2 parents 3eb20bc + 7774257 commit 098a745
Show file tree
Hide file tree
Showing 15 changed files with 151 additions and 23 deletions.
6 changes: 4 additions & 2 deletions docs/api/alerting/create_rule.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ the URL, the default space is used.
types of alerts. If you don't need this, set this value to `default`.
`id`:::
(Required, string) The ID of the connector saved object.
(Required, string) The ID of the connector saved object, which you can obtain by
using <<get-all-connectors-api>>.
`params`:::
(Required, object) The map to the `params` that the
Expand Down Expand Up @@ -131,7 +132,8 @@ is `onThrottleInterval`.
[[create-rule-api-example]]
=== {api-examples-title}

Create a rule that has actions associated with a server log connector:
Create an <<rule-type-index-threshold,index threshold rule>> that has actions
associated with a server log connector:

[source,sh]
--------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions docs/management/cases/cases.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

preview::[]

Cases are used to open and track issues directly in {kib}. All cases list
the original reporter and all the users who contribute to a case (_participants_).
You can also send cases to external incident management systems by configuring
connectors.
Cases are used to open and track issues directly in {kib}. You can add
assignees and tags to your cases, set their severity and status, and add alerts,
comments, and visualizations. You can also send cases to external incident
management systems by configuring connectors.

[role="screenshot"]
image::images/cases.png[Cases page]
Expand Down
Binary file modified docs/management/cases/images/cases-visualization.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/cases/images/cases.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion docs/management/cases/manage-cases.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ Open a new case to keep track of issues and share their details with colleagues.

. Go to *Management > {stack-manage-app} > Cases*, then click *Create case*.

. Give the case a name, add any relevant tags and a description.
. Give the case a name, severity, and description.
+
TIP: In the `Description` area, you can use
https://www.markdownguide.org/cheat-sheet[Markdown] syntax to create formatted
text.

. Optionally, add assignees and tags. You can add users only if they meet
the necessary <<setup-cases,prerequisites>>.

. For *External incident management system*, select a connector. For more
information, refer to <<add-case-connectors>>.

Expand Down Expand Up @@ -61,10 +64,12 @@ To view a case, click on its name. You can then:

* Add a new comment.
* Edit existing comments and the description.
* Add or remove assignees.
* Add a connector.
* Send updates to external systems (if external connections are configured).
* Edit tags.
* Refresh the case to retrieve the latest updates.
* Change the status.
* Change the severity.
* Close or delete the case.
* Reopen a closed case.
6 changes: 6 additions & 0 deletions docs/management/cases/setup-cases.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ a|
NOTE: The *Actions and Connectors* feature privilege is required to create, add,
delete, and modify case connectors and to send updates to external systems.

| Give assignee access to cases
a| `All` for the *Cases* feature under *Management*.

NOTE: Before a user can be assigned to a case, they must log into {kib} at
least once, which creates a user profile.

| Give view-only access for cases | `Read` for the *Cases* feature under *Management*.

| Give access to view and delete cases | `Read` for the *Cases* feature under
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
* 2.0.
*/

import { EuiCallOut, EuiLink, EuiSpacer } from '@elastic/eui';
import { LazyField } from '@kbn/advanced-settings-plugin/public';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import {
apmLabsButton,
apmProgressiveLoading,
Expand All @@ -31,7 +33,7 @@ const apmSettingsKeys = [
];

export function GeneralSettings() {
const { docLinks, notifications } = useApmPluginContext().core;
const { docLinks, notifications, application } = useApmPluginContext().core;
const {
handleFieldChange,
settingsEditableConfig,
Expand Down Expand Up @@ -63,6 +65,29 @@ export function GeneralSettings() {

return (
<>
<EuiCallOut
title={
<FormattedMessage
id="xpack.apm.apmSettings.kibanaLink"
defaultMessage="The full list of APM options can be found in {link}"
values={{
link: (
<EuiLink
href={application.getUrlForApp('management', {
path: `/kibana/settings?query=category:(observability)`,
})}
>
{i18n.translate('xpack.apm.apmSettings.kibanaLink.label', {
defaultMessage: 'Kibana advanced settings',
})}
</EuiLink>
),
}}
/>
}
iconType="iInCircle"
/>
<EuiSpacer />
{apmSettingsKeys.map((settingKey) => {
const editableConfig = settingsEditableConfig[settingKey];
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,20 @@ export class SingleMetricLensAttributes extends LensAttributes {
getSingleMetricLayer() {
const { seriesConfig, selectedMetricField, operationType, indexPattern } = this.layerConfigs[0];

const { columnFilter, columnField, columnLabel, columnType, formula, metricStateOptions } =
parseCustomFieldName(seriesConfig, selectedMetricField);
const {
columnFilter,
columnField,
columnLabel,
columnType,
formula,
metricStateOptions,
format,
} = parseCustomFieldName(seriesConfig, selectedMetricField);

this.metricStateOptions = metricStateOptions;

if (columnType === FORMULA_COLUMN && formula) {
return this.getFormulaLayer({ formula, label: columnLabel, dataView: indexPattern });
return this.getFormulaLayer({ formula, label: columnLabel, dataView: indexPattern, format });
}

const getSourceField = () => {
Expand Down Expand Up @@ -99,22 +106,27 @@ export class SingleMetricLensAttributes extends LensAttributes {
formula,
label,
dataView,
format,
}: {
formula: string;
label?: string;
format?: string;
dataView: DataView;
}) {
const layer = this.lensFormulaHelper?.insertOrReplaceFormulaColumn(
this.columnId,
{
formula,
label,
format: {
id: 'percent',
params: {
decimals: 1,
},
},
format:
format === 'percent' || !format
? {
id: 'percent',
params: {
decimals: 1,
},
}
: undefined,
},
{ columns: {}, columnOrder: [] },
dataView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,36 @@ export function getSyntheticsSingleMetricConfig({ dataView }: ConfigProps): Seri
titlePosition: 'bottom',
},
},
{
id: 'monitor_errors',
field: 'state.id',
label: i18n.translate('xpack.observability.expView.errors', {
defaultMessage: 'Errors',
}),
metricStateOptions: {
titlePosition: 'bottom',
colorMode: 'Labels',
palette: {
name: 'custom',
type: 'palette',
params: {
steps: 3,
name: 'custom',
reverse: false,
rangeType: 'number',
rangeMin: 0,
progression: 'fixed',
stops: [{ color: '#E7664C', stop: 100 }],
colorStops: [{ color: '#E7664C', stop: 0 }],
continuity: 'above',
maxSteps: 5,
},
},
},
columnType: FORMULA_COLUMN,
formula: 'unique_count(state.id, kql=\'monitor.status: "down"\')',
format: 'number',
},
],
labels: FieldLabels,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export interface MetricOption {
formula?: string;
metricStateOptions?: Pick<MetricState, 'colorMode' | 'palette' | 'titlePosition'>;
palette?: PaletteOutput;
format?: 'percent' | 'number';
}

export interface SeriesConfig {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { useKibana } from '@kbn/kibana-react-plugin/public';
import React from 'react';
import { ReportTypes } from '@kbn/observability-plugin/public';
import { useParams } from 'react-router-dom';
import { ClientPluginsStart } from '../../../../../plugin';

export const MonitorErrorsCount = () => {
const { observability } = useKibana<ClientPluginsStart>().services;

const { ExploratoryViewEmbeddable } = observability;

const { monitorId } = useParams<{ monitorId: string }>();

return (
<ExploratoryViewEmbeddable
align="left"
reportType={ReportTypes.SINGLE_METRIC}
attributes={[
{
time: {
from: 'now-1h',
to: 'now',
},
reportDefinitions: { config_id: [monitorId] },
dataType: 'synthetics',
selectedMetricField: 'state.id',
name: 'synthetics-series-1',
},
]}
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { MonitorDetailsPanel } from './monitor_details_panel';
import { AvailabilitySparklines } from './availability_sparklines';
import { LastTestRun } from './last_test_run';
import { LastTenTestRuns } from './last_ten_test_runs';
import { MonitorErrorsCount } from './monitor_errors_count';

export const MonitorSummary = () => {
const { euiTheme } = useEuiTheme();
Expand Down Expand Up @@ -56,7 +57,10 @@ export const MonitorSummary = () => {
<DurationPanel />
</EuiFlexItem>
<EuiFlexItem>{/* TODO: Add duration metric sparkline*/}</EuiFlexItem>
<EuiFlexItem>{/* TODO: Add error metric and sparkline*/}</EuiFlexItem>
<EuiFlexItem>
<MonitorErrorsCount />
</EuiFlexItem>
<EuiFlexItem>{/* TODO: Add error sparkline*/}</EuiFlexItem>
</EuiFlexGroup>
</EuiPanel>
<EuiSpacer size="l" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
export default function (providerContext: FtrProviderContext) {
const { loadTestFile, getService } = providerContext;

describe('endpoint', function () {
describe.skip('endpoint', function () {
const ingestManager = getService('ingestManager');
const log = getService('log');
const endpointTestResources = getService('endpointTestResources');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const endpointTestResources = getService('endpointTestResources');
const policyTestResources = getService('policyTestResources');

describe('When on the Trusted Apps list', function () {
// FLAKY: https://github.com/elastic/kibana/issues/114309
describe.skip('When on the Trusted Apps list', function () {
let indexedData: IndexedHostsAndAlertsResponse;
before(async () => {
const endpointPackage = await policyTestResources.getEndpointPackage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default ({ getService, getPageObjects }) => {
const log = getService('log');
const browser = getService('browser');
const PageObjects = getPageObjects(['common']);
const retry = getService('retry');

describe('telemetry', function () {
before(async () => {
Expand All @@ -23,9 +24,11 @@ export default ({ getService, getPageObjects }) => {
});

it('should show banner Help us improve the Elastic Stack', async () => {
const actualMessage = await PageObjects.common.getWelcomeText();
log.debug(`### X-Pack Welcome Text: ${actualMessage}`);
expect(actualMessage).to.contain('Help us improve the Elastic Stack');
await retry.tryForTime(20000, async () => {
const actualMessage = await PageObjects.common.getWelcomeText();
log.debug(`### X-Pack Welcome Text: ${actualMessage}`);
expect(actualMessage).to.contain('Help us improve the Elastic Stack');
});
});
});
};

0 comments on commit 098a745

Please sign in to comment.