Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
ALERT_INSTANCE_ID,
TAGS,
ALERT_REASON,
ALERT_WORKFLOW_TAGS,
} from '@kbn/rule-data-utils';
import { i18n } from '@kbn/i18n';

Expand Down Expand Up @@ -96,6 +97,16 @@ export const getColumns = (
id: TAGS,
initialWidth: 150,
},
{
displayAsText: i18n.translate(
'xpack.observability.alertsTGrid.workflowTagsColumnDescription',
{
defaultMessage: 'Workflow Tags',
}
),
id: ALERT_WORKFLOW_TAGS,
initialWidth: 150,
},
{
displayAsText: i18n.translate('xpack.observability.alertsTGrid.reasonColumnDescription', {
defaultMessage: 'Reason',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,6 @@ function getRelevantAlertFields(alertDetail: AlertData) {
'kibana.alert.rule.uuid',
'event.action',
'event.kind',
'kibana.alert.rule.tags',
'kibana.alert.maintenance_window_ids',
'kibana.alert.consecutive_matches',
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export function StatusBar({ alert, alertStatus }: StatusBarProps) {
const dateFormat = useUiSetting<string>('dateFormat');

const tags = alert?.fields[TAGS];
const workflowTags = alert?.fields['kibana.alert.workflow_tags'];

if (!alert) {
return null;
Expand All @@ -53,16 +54,37 @@ export function StatusBar({ alert, alertStatus }: StatusBarProps) {
</EuiFlexItem>
<CaseLinks alert={alert} />
<EuiFlexItem grow={false}>
<TagsList tags={tags} ignoreEmpty color="default" />
<EuiFlexGroup gutterSize="xs">
<EuiText size="s" color="subdued">
<FormattedMessage
id="xpack.observability.pages.alertDetails.pageTitle.tags"
defaultMessage="Tags:"
/>
</EuiText>
<TagsList tags={tags} ignoreEmpty color="default" />
</EuiFlexGroup>
</EuiFlexItem>
{workflowTags && workflowTags.length > 0 && (
<EuiFlexItem grow={false}>
<EuiFlexGroup gutterSize="xs">
<EuiText size="s" color="subdued">
<FormattedMessage
id="xpack.observability.pages.alertDetails.pageTitle.workflowTags"
defaultMessage="Workflow Tags:"
/>
</EuiText>
<TagsList tags={workflowTags} ignoreEmpty color="default" />
</EuiFlexGroup>
</EuiFlexItem>
)}

<EuiFlexItem grow={false} css={{ minWidth: 100 }}>
<EuiFlexGroup gutterSize="none">
<EuiFlexGroup gutterSize="xs">
<EuiText size="s" color="subdued">
<FormattedMessage
id="xpack.observability.pages.alertDetails.pageTitle.triggered"
defaultMessage="Triggered"
defaultMessage="Triggered:"
/>
:&nbsp;
</EuiText>
<EuiToolTip content={moment(Number(alert.start)).format(dateFormat)}>
<EuiText
Expand All @@ -78,13 +100,12 @@ export function StatusBar({ alert, alertStatus }: StatusBarProps) {
</EuiFlexGroup>
</EuiFlexItem>
<EuiFlexItem grow={false} css={{ minWidth: 120 }}>
<EuiFlexGroup gutterSize="none">
<EuiFlexGroup gutterSize="xs">
<EuiText size="s" color="subdued">
<FormattedMessage
id="xpack.observability.pages.alertDetails.pageTitle.duration"
defaultMessage="Duration"
defaultMessage="Duration:"
/>
:&nbsp;
</EuiText>
<EuiText
css={css`
Expand All @@ -97,13 +118,12 @@ export function StatusBar({ alert, alertStatus }: StatusBarProps) {
</EuiFlexGroup>
</EuiFlexItem>
<EuiFlexItem grow={false} css={{ minWidth: 240 }}>
<EuiFlexGroup gutterSize="none">
<EuiFlexGroup gutterSize="xs">
<EuiText size="s" color="subdued">
<FormattedMessage
id="xpack.observability.pages.alertDetails.pageTitle.lastStatusUpdate"
defaultMessage="Last status update"
defaultMessage="Last status update:"
/>
:&nbsp;
</EuiText>
<EuiToolTip content={moment(alert.fields[TIMESTAMP]).format(dateFormat)}>
<EuiText
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const ACTIVE_ALERTS = 6;
const RECOVERED_ALERTS = 4;
const ALL_ALERTS = ACTIVE_ALERTS + RECOVERED_ALERTS;
const COLUMNS = 11;
const COLUMNS = 12;

before(async () => {
await pageObjects.common.navigateToApp(HOSTS_VIEW_PATH);
Expand Down Expand Up @@ -905,7 +905,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const ACTIVE_ALERTS = 6;
const RECOVERED_ALERTS = 4;
const ALL_ALERTS = ACTIVE_ALERTS + RECOVERED_ALERTS;
const COLUMNS = 11;
const COLUMNS = 12;

await pageObjects.infraHostsView.visitAlertTab();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const ACTIVE_ALERTS = 2;
const RECOVERED_ALERTS = 2;
const ALL_ALERTS = ACTIVE_ALERTS + RECOVERED_ALERTS;
const COLUMNS = 11;
const COLUMNS = 12;
before(async () => {
await esArchiver.load(
'x-pack/solutions/observability/test/fixtures/es_archives/infra/alerts'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { RuleNotifyWhen } from '@kbn/alerting-plugin/common';
import type { FtrProviderContext } from '../../../../ftr_provider_context';
import { asyncForEach } from '../../helpers';

const TOTAL_ALERTS_CELL_COUNT = 440;
const RECOVERED_ALERTS_CELL_COUNT = 330;
const ACTIVE_ALERTS_CELL_COUNT = 110;
const TOTAL_ALERTS_CELL_COUNT = 480;
const RECOVERED_ALERTS_CELL_COUNT = 360;
const ACTIVE_ALERTS_CELL_COUNT = 120;

export default ({ getService, getPageObjects }: FtrProviderContext) => {
const esArchiver = getService('esArchiver');
Expand Down Expand Up @@ -213,6 +213,25 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => {
});
});

describe('Actions Button', () => {
after(async () => {
await observability.alerts.common.navigateToTimeWithData();
// Clear active status
await alertControls.clearControlSelections('0');
await observability.alerts.common.waitForAlertTableToLoad();
});

it('Opens rule details page when click on "View Rule Details"', async () => {
const actionsButton = await observability.alerts.common.getActionsButtonByIndex(0);
await actionsButton.click();
await observability.alerts.common.viewRuleDetailsButtonClick();

expect(
await (await find.byCssSelector('[data-test-subj="breadcrumb first"]')).getVisibleText()
).to.eql('Observability');
});
});

describe('Flyout', () => {
it('Can be opened', async () => {
await observability.alerts.common.openAlertsFlyout();
Expand Down Expand Up @@ -285,18 +304,6 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => {
});
});
});

describe('Actions Button', () => {
it('Opens rule details page when click on "View Rule Details"', async () => {
const actionsButton = await observability.alerts.common.getActionsButtonByIndex(0);
await actionsButton.click();
await observability.alerts.common.viewRuleDetailsButtonClick();

expect(
await (await find.byCssSelector('[data-test-subj="breadcrumb first"]')).getVisibleText()
).to.eql('Observability');
});
});
});
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
ALERT_STATUS,
ALERT_INSTANCE_ID,
TAGS,
ALERT_WORKFLOW_TAGS,
} from '@kbn/rule-data-utils';
import type { FtrProviderContext } from '../../../../ftr_provider_context';

Expand Down Expand Up @@ -73,6 +74,7 @@ export default ({ getService }: FtrProviderContext) => {
ALERT_EVALUATION_VALUE,
ALERT_EVALUATION_THRESHOLD,
TAGS,
ALERT_WORKFLOW_TAGS,
ALERT_REASON,
]) {
expect(await testSubjects.exists(`dataGridHeaderCell-${colId}`)).to.be(true);
Expand Down