Skip to content

Commit

Permalink
feat(slo): group by slo id (elastic#210469)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdelemme authored Feb 11, 2025
1 parent d36df89 commit 9545d6b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const groupBySchema = t.union([
t.literal('slo.indicator.type'),
t.literal('slo.instanceId'),
t.literal('_index'),
t.literal('slo.id'),
]);

const findSLOGroupsParamsSchema = t.partial({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ export function QuickFilters({
align-items: flex-start;
min-height: initial;
}
.controlPanel {
height: initial;
}
.controlGroup {
min-height: initial;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export function useGroupName(groupBy: GroupByField, group: string, summary?: Gro
case 'ungrouped':
case 'slo.tags':
case 'status':
case 'slo.id':
return groupName;
case 'slo.instanceId':
if (groupName === ALL_VALUE || !summary?.worst?.slo?.groupings) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ export function SloGroupBy({ onStateChange, state, loading }: Props) {
handleChangeGroupBy('slo.indicator.type');
},
},
{
label: i18n.translate('xpack.slo.list.groupBy.sloId', {
defaultMessage: 'SLO definition id',
}),
checked: groupBy === 'slo.id',
value: 'slo.id',
onClick: () => {
handleChangeGroupBy('slo.id');
},
},
{
label: i18n.translate('xpack.slo.list.groupBy.sloInstanceId', {
defaultMessage: 'SLO instance id',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export type GroupByField =
| 'status'
| 'slo.indicator.type'
| 'slo.instanceId'
| '_index';
| '_index'
| 'slo.id';
export type SortDirection = 'asc' | 'desc';
export type SortField =
| 'sli_value'
Expand Down

0 comments on commit 9545d6b

Please sign in to comment.