Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
bca7bbd
begin enhancing rules ebt telemetry
baileycash-elastic May 20, 2025
e3cad76
switch rule type to single div
baileycash-elastic May 22, 2025
3775a3e
Merge branch 'main' into telemetry-219986-ebt
baileycash-elastic May 22, 2025
5a8c437
add context to subj
baileycash-elastic May 22, 2025
0ac1f09
Merge branch 'main' into telemetry-219986-ebt
baileycash-elastic May 22, 2025
6bbf275
resolve conflicts with data-test-subj
baileycash-elastic May 22, 2025
6d3cad4
move test subj to table row
baileycash-elastic May 22, 2025
faee685
Merge branch 'main' into telemetry-219986-ebt
baileycash-elastic Jun 3, 2025
4689ff6
move ruletype label for details page menu
baileycash-elastic Jun 3, 2025
55ab92f
reduce risky changes
baileycash-elastic Jun 3, 2025
fe49255
Merge branch 'main' into telemetry-219986-ebt
baileycash-elastic Jun 4, 2025
8c40ea4
Merge branch 'main' into telemetry-219986-ebt
baileycash-elastic Jun 5, 2025
7735531
improve subj filters
baileycash-elastic Jun 5, 2025
d93a410
revert untouched files
baileycash-elastic Jun 5, 2025
86fba09
Merge branch 'main' into telemetry-219986-ebt
baileycash-elastic Jun 5, 2025
669fc10
improve subj descriptions and improve test data
baileycash-elastic Jun 6, 2025
6e4add8
fix typos
baileycash-elastic Jun 6, 2025
5eeba42
Merge branch 'main' into telemetry-219986-ebt
baileycash-elastic Jun 9, 2025
d2b48cb
simplify structure
baileycash-elastic Jun 10, 2025
c2ec577
fix typing error
baileycash-elastic Jun 11, 2025
f7fd9c6
Merge branch 'main' into telemetry-219986-ebt
baileycash-elastic Jun 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -667,10 +667,20 @@ describe('telemetry task state', () => {
count_rules_executions_timeouts_by_type_per_day: { '.index-threshold': 30 },
count_rules_executions_timeouts_per_day: 31,
count_rules_muted: 32,
count_rules_muted_by_type: {},
count_rules_muted_by_type: {
// eslint-disable-next-line @typescript-eslint/naming-convention
observability__rules__custom_threshold: 5,
// eslint-disable-next-line @typescript-eslint/naming-convention
slo__rules__burnRate: 4,
},
count_rules_namespaces: 33,
count_rules_snoozed: 34,
count_rules_snoozed_by_type: {},
count_rules_snoozed_by_type: {
// eslint-disable-next-line @typescript-eslint/naming-convention
observability__rules__custom_threshold: 2,
// eslint-disable-next-line @typescript-eslint/naming-convention
slo__rules__burnRate: 1,
},
count_rules_with_muted_alerts: 35,
count_rules_with_tags: 36,
count_rules_with_linked_dashboards: 10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ const SNOOZE_END_TIME_FORMAT = 'LL @ LT';
type DropdownRuleRecord = Pick<
Rule,
'enabled' | 'muteAll' | 'isSnoozedUntil' | 'snoozeSchedule' | 'activeSnoozes'
>;
> &
Partial<Pick<Rule, 'ruleTypeId'>>;

export interface ComponentOpts {
rule: DropdownRuleRecord;
Expand Down Expand Up @@ -223,7 +224,7 @@ export const RuleStatusDropdown: React.FunctionComponent<ComponentOpts> = ({
gutterSize={direction === 'row' ? 's' : 'xs'}
responsive={false}
>
<EuiFlexItem grow={false}>
<EuiFlexItem grow={false} data-test-subj={`ruleType_${rule.ruleTypeId}`}>
{isEditable ? (
<EuiPopover
button={editableBadge}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,18 +541,20 @@ export const RulesListTable = (props: RulesListTableProps) => {
}

return (
<RulesListNotifyBadge
showOnHover
snoozeSettings={rule}
loading={!!isLoadingMap[rule.id]}
disabled={!rule.isEditable}
onRuleChanged={onRuleChanged}
snoozeRule={async (snoozeSchedule) => {
await onSnoozeRule(rule, snoozeSchedule);
}}
unsnoozeRule={async (scheduleIds) => await onUnsnoozeRule(rule, scheduleIds)}
isRuleEditable={rule.isEditable}
/>
<div data-test-subj={`ruleType_${rule.ruleTypeId}`}>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

table cell for snooze

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, if possible, remove the div and add the data-test-subj attribute to the RulesListNotifyBadge

Copy link
Copy Markdown
Contributor

@kdelemme kdelemme Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we add data-test-subj={ruleType_${rule.ruleTypeId}} directly on the RulesListNotifyBadge?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't add it here because the notify badge is used by several components and also has several return statements. I would have to pass the ruleType as an optional prop then optionally add it to each of the possible return statements within the child component

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we also checked to add it to the table cell itself but couldn't see anything that would allow us setting the test-subj prop

<RulesListNotifyBadge
showOnHover
snoozeSettings={rule}
loading={!!isLoadingMap[rule.id]}
disabled={!rule.isEditable}
onRuleChanged={onRuleChanged}
snoozeRule={async (snoozeSchedule) => {
await onSnoozeRule(rule, snoozeSchedule);
}}
unsnoozeRule={async (scheduleIds) => await onUnsnoozeRule(rule, scheduleIds)}
isRuleEditable={rule.isEditable}
/>
</div>
);
},
},
Expand Down Expand Up @@ -777,7 +779,11 @@ export const RulesListTable = (props: RulesListTableProps) => {
width: '90px',
render(rule: RuleTableItem) {
return (
<EuiFlexGroup justifyContent="flexEnd" gutterSize="none">
<EuiFlexGroup
justifyContent="flexEnd"
gutterSize="none"
data-test-subj={`ruleType_${rule.ruleTypeId}`}
>
<EuiFlexItem grow={false} className="ruleSidebarItem">
<EuiFlexGroup justifyContent="flexEnd" gutterSize="xs">
{rule.isEditable && isRuleTypeEditableInContext(rule.ruleTypeId) ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ export function HeaderActions({

return (
<>
<EuiFlexGroup direction="rowReverse" alignItems="center">
<EuiFlexGroup
direction="rowReverse"
alignItems="center"
data-test-subj={`ruleType_${rule.ruleTypeId}`}
>
<EuiFlexItem>
<EuiPopover
id="contextRuleEditMenu"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export function RuleDetailsPage() {
}}
>
<HeaderMenu />
<EuiFlexGroup wrap gutterSize="m">
<EuiFlexGroup wrap gutterSize="m" data-test-subj={`ruleType_${rule.ruleTypeId}`}>
<EuiFlexItem css={{ minWidth: 350 }}>
<RuleStatusPanel
rule={rule}
Expand Down