-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SLOs] In Embeddables, show all related instances option #175503
Conversation
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
That looks super cool! |
.../plugins/triggers_actions_ui/public/application/sections/alerts_table/alerts_table_state.tsx
Outdated
Show resolved
Hide resolved
…/alerts_table/alerts_table_state.tsx
@shahzad31 I like the idea! I tested it locally and here are a few comments before doing the code review:
Screen.Recording.2024-01-30.at.08.28.52.mov |
|
||
const onConfirmClick = () => onCreate({ slos: selectedSlos, showAllGroupByInstances }); | ||
|
||
const hasGroupBy = selectedSlos?.some((slo) => slo.instanceId !== '*'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better use the ALL_VALUE
here
x-pack/plugins/observability/public/embeddable/slo/alerts/components/slo_alerts_table.tsx
Show resolved
Hide resolved
x-pack/plugins/observability/public/embeddable/slo/alerts/components/slo_alerts_table.tsx
Show resolved
Hide resolved
}, | ||
}, | ||
], | ||
}, | ||
}; | ||
|
||
return query; | ||
}, [slos, timeRange]); | ||
}, [showAllGroupByInstances, slos, timeRange.from]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to current changes, but I was wondering why we don't have the timeRange.to in the range query. If user selects to see alerts from a specific date to another date, then we don't take the to
into consideration. Do we need to create a ticket for this?
range: {
'@timestamp': {
gte: timeRange.from,
},
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shahzad31 If user selects to
time range in the timepicker, it won't be applied right? Shouldn't the range contain the timeRange.to as well? Do you think we can do this in this PR? Otherwise a follow up PR is fine as well
<EuiSpacer /> | ||
<EuiSwitch | ||
label={i18n.translate( | ||
'xpack.observability.sloConfiguration.euiSwitch.showAllGroupByLabel', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shahzad31 How about we prefix the copy with xpack.observability.sloAlertsEmbeddable
to be consistent with rest i18n copies? It would become xpack.observability.sloAlertsEmbeddable.sloConfiguration.euiSwitch.showAllGroupByLabel
that long though..
initialInput, | ||
parent | ||
); | ||
const [coreStart, pluginStart] = await this.getStartServices(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
@shahzad31 I have an alerts embeddable. I have enabled the
Screen.Recording.2024-01-30.at.10.17.09.movAlso let's think more about the workflow, when user edits the configuration and disables the toggle. In this case we should exclude the alerts from the related group by instances. |
@@ -82,7 +82,7 @@ export function useFetchActiveAlerts({ | |||
bool: { | |||
filter: [ | |||
{ term: { 'slo.id': sloId } }, | |||
{ term: { 'slo.instanceId': instanceId } }, | |||
...(instanceId === '*' ? [] : [{ term: { 'slo.instanceId': instanceId } }]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is used in SLO list page and SLO detail page. Let's make sure it still works fine there. Do we have any tests for this?
One reminder, we use different query for calculating active alerts in SLO pages vs SLO embeddable. I will create a ticket to unify the query in both places. Linking this for reference #172448
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @kdelemme since you wrote this part, I am tagging you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, instanceId can be '*' and the alert stores the instanceId as *
as well, so I'm not sure this filter adds something? but I need to try the query locally
@@ -57,6 +65,21 @@ export function SloConfiguration({ onCreate, onCancel }: SloConfigurationProps) | |||
/> | |||
</EuiFlexItem> | |||
</EuiFlexGroup> | |||
{selectedSlo?.sloInstanceId !== '*' && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use ALL_VALUE
here
PR looks good. What is still pending though for me to approve it is input from @maciejforcone regarding this one. |
x-pack/plugins/observability/public/embeddable/slo/overview/slo_configuration.tsx
Outdated
Show resolved
Hide resolved
…o_configuration.tsx
x-pack/plugins/observability/public/embeddable/slo/overview/slo_configuration.tsx
Show resolved
Hide resolved
…o_configuration.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Just updating here the status: According to our discussion we will display |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you plan to add the 1 SLO (5 instances)
as part of this PR or in a follow up?
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am trying to test your PR locally, but for some reason when I create a Group by SLO the Transform becomes unavailable.
To not block you, I will approve the PR. Before merging, please make sure that you don't have any issue with transforms in your branch and verify that counting works well with a few scenarios we discussed.
- User selects 2 SLOs (different SLO id) that both have group by instances. Then we should sum up all group by instances from the different SLO ids
- user manually selects 2 SLOs (both same SLO id, but different instances) and enables the toggle. If total group by instances were 5 for example, we should make sure we display 2 SLOs with (3 instances) and not 2 SLOs (with 5 instances)
I also leave a small note regarding the change in the activeFetchAlerts hook. A bit more testing is required to verify nothing broke in the SLO pages.
@elasticmachine run elasticsearch-ci/doc |
) ## Summary in SLOs embeddable, added the ability show all related instances Overviews and alerts !! if selected SLO has group-by, it will give an option to show all related instances from the group-by field <img width="829" alt="image" src="https://github.com/elastic/kibana/assets/3505601/f57ad76b-4170-4fc0-8335-c0f0b2a8807e"> All related instances will appear as grid <img width="1728" alt="image" src="https://github.com/elastic/kibana/assets/3505601/c43f058a-1b43-4e44-807d-4157e1f4a2be">
) ## Summary in SLOs embeddable, added the ability show all related instances Overviews and alerts !! if selected SLO has group-by, it will give an option to show all related instances from the group-by field <img width="829" alt="image" src="https://github.com/elastic/kibana/assets/3505601/f57ad76b-4170-4fc0-8335-c0f0b2a8807e"> All related instances will appear as grid <img width="1728" alt="image" src="https://github.com/elastic/kibana/assets/3505601/c43f058a-1b43-4e44-807d-4157e1f4a2be">
) ## Summary in SLOs embeddable, added the ability show all related instances Overviews and alerts !! if selected SLO has group-by, it will give an option to show all related instances from the group-by field <img width="829" alt="image" src="https://github.com/elastic/kibana/assets/3505601/f57ad76b-4170-4fc0-8335-c0f0b2a8807e"> All related instances will appear as grid <img width="1728" alt="image" src="https://github.com/elastic/kibana/assets/3505601/c43f058a-1b43-4e44-807d-4157e1f4a2be">
Summary
in SLOs embeddable, added the ability show all related instances Overviews and alerts !!
if selected SLO has group-by, it will give an option to show all related instances from the group-by field
All related instances will appear as grid