Skip to content
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

Merged
merged 20 commits into from
Feb 1, 2024

Conversation

shahzad31
Copy link
Contributor

@shahzad31 shahzad31 commented Jan 25, 2024

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

image

All related instances will appear as grid

image

@shahzad31 shahzad31 requested review from a team as code owners January 25, 2024 07:38
@botelastic botelastic bot added the Team:obs-ux-management Observability Management User Experience Team label Jan 25, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@shahzad31 shahzad31 added the release_note:skip Skip the PR/issue when compiling release notes label Jan 25, 2024
@mgiota
Copy link
Contributor

mgiota commented Jan 25, 2024

That looks super cool!

@shahzad31 shahzad31 removed the request for review from a team January 25, 2024 08:58
@mgiota mgiota self-requested a review January 30, 2024 07:16
@mgiota
Copy link
Contributor

mgiota commented Jan 30, 2024

@shahzad31 I like the idea! I tested it locally and here are a few comments before doing the code review:

  • Here's how it looks like when I added the overview embeddable for group by instances. Can you change the default panel dimensions of the grouped embeddable? Here's a PR that might help.
Screenshot 2024-01-30 at 08 18 40
  • I would like some input from @maciejforcone regarding Show all related group-by instances label
  • The new toggle doesn't appear on the alerts embeddable. Yesterday it didn't appear on the overview embeddable as well, although I had some group by instances. I didn't have any data for this SLO though. I mean I created an SLO using the kbn-data-forge package (previously high cardinality indexer) and while creating it, in the SLI preview I could see there was no data. So in case there is no data flowing, the group by toggle won't be visible.
  • Do we need to consider any migration? For example if user had previously added an SLO overview embeddable of a group by instance, and now selects to include another group by instance of the same SLO, having the toggle on, he will just see this specific group by instance twice. I don't think anything would break, right? I will test it and report back
Screen.Recording.2024-01-30.at.08.28.52.mov


const onConfirmClick = () => onCreate({ slos: selectedSlos, showAllGroupByInstances });

const hasGroupBy = selectedSlos?.some((slo) => slo.instanceId !== '*');
Copy link
Contributor

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

},
},
],
},
};

return query;
}, [slos, timeRange]);
}, [showAllGroupByInstances, slos, timeRange.from]);
Copy link
Contributor

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,
              },
            },

Copy link
Contributor

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',
Copy link
Contributor

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();
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

@mgiota
Copy link
Contributor

mgiota commented Jan 30, 2024

The new toggle doesn't appear on the alerts embeddable.

Regarding my comment, I was able to see the toggle, once I selected a group by instance. So this was your intention, to display it only if user selects a group by instance, right?

Screenshot 2024-01-30 at 10 13 36

@mgiota
Copy link
Contributor

mgiota commented Jan 30, 2024

@shahzad31 I have an alerts embeddable. I have enabled the Show all related group by instances, but I would expect to see:

  • 4 SLOs included on the top right link of the embeddable
  • in the SLO popup configuration I would expect to see the rest 3 group by instances as well
Screen.Recording.2024-01-30.at.10.17.09.mov

Also 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.

@mgiota
Copy link
Contributor

mgiota commented Jan 30, 2024

The alert notification does not appear in the group panel for the instance the-post.box. As you can see, this SLO instance has one alert

Screenshot 2024-01-30 at 10 28 39

@@ -82,7 +82,7 @@ export function useFetchActiveAlerts({
bool: {
filter: [
{ term: { 'slo.id': sloId } },
{ term: { 'slo.instanceId': instanceId } },
...(instanceId === '*' ? [] : [{ term: { 'slo.instanceId': instanceId } }]),
Copy link
Contributor

@mgiota mgiota Jan 30, 2024

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

Copy link
Contributor

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

Copy link
Contributor

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 !== '*' && (
Copy link
Contributor

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

@shahzad31 shahzad31 requested a review from mgiota January 30, 2024 18:25
@mgiota
Copy link
Contributor

mgiota commented Jan 31, 2024

@shahzad31 I have an alerts embeddable. I have enabled the Show all related group by instances, but I would expect to see:

  • 4 SLOs included on the top right link of the embeddable
  • in the SLO popup configuration I would expect to see the rest 3 group by instances as well

Screen.Recording.2024-01-30.at.10.17.09.mov

Also 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.

PR looks good. What is still pending though for me to approve it is input from @maciejforcone regarding this one.

@mgiota mgiota requested a review from maciejforcone January 31, 2024 08:06
Copy link

@maciejforcone maciejforcone left a 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

@mgiota
Copy link
Contributor

mgiota commented Jan 31, 2024

Just updating here the status: According to our discussion we will display 1 SLO (5 instances)

Copy link
Contributor

@mgiota mgiota left a 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?

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
observability 597 599 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
observability 626.5KB 627.0KB +532.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@mgiota mgiota self-requested a review February 1, 2024 13:55
Copy link
Contributor

@mgiota mgiota left a 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.

@shahzad31
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/doc

@shahzad31 shahzad31 merged commit 4f7402b into elastic:main Feb 1, 2024
17 checks passed
@shahzad31 shahzad31 deleted the slo-card-config branch February 1, 2024 18:06
@kibanamachine kibanamachine added v8.13.0 backport:skip This commit does not require backporting labels Feb 1, 2024
fkanout pushed a commit to fkanout/kibana that referenced this pull request Feb 7, 2024
)

## 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">
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
)

## 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">
fkanout pushed a commit to fkanout/kibana that referenced this pull request Mar 4, 2024
)

## 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">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-management Observability Management User Experience Team v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants