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

[Infra] Show all alerts in Infra views (Host + Containers) for consistency with entity inventory #202188

Merged
merged 7 commits into from
Nov 29, 2024

Conversation

rmyz
Copy link
Contributor

@rmyz rmyz commented Nov 28, 2024

Summary

Closes #201567
Fixes #181580 and #201528

This PR ensures that Infra views display all alerts, regardless of index pattern.
It provides consistent alert visibility across services.

  • Alert counts per host in the Hosts List now shows all host alerts
  • Alert counts in alerting tab in Hosts List now shows all host alerts
  • Hosts Views now shows all host alerts
  • Container Views now shows all container alerts
  • Alert counts shown in Hosts Lists and Host Views now are consistent with alerting app when filtered by host
  • Clicking through alerts in host/container views now filters by just the entity ID
  • Clicking Show all in Hosts now goes to Alerts app with all hosts that have alerts in the filter
  • Clicking an Alert in Entity Inventory now searches by just the entity ID

Screenshots

Screen Before After
Entity inventory (no changes here, just showing the alert count for next screens) image image
Host detail view image image
Host List view imageimage imageimage
Container detail view image image
Click Show all in Host List image image
Click Show all in Host/Container detail view image image
Click alert in Entity Inventory image image

@rmyz rmyz self-assigned this Nov 28, 2024
@rmyz rmyz added release_note:fix backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Nov 28, 2024
@rmyz rmyz marked this pull request as ready for review November 28, 2024 15:06
@rmyz rmyz requested a review from a team as a code owner November 28, 2024 15:06
@rmyz rmyz requested a review from iblancof November 28, 2024 15:06
);
expect(screen.queryByTestId('inventoryAlertsBadgeLink')?.textContent).toEqual('5');
});
it('render alerts badge for a service entity with multiple identity fields', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing this test as we don't have that functionality anymore

@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Nov 28, 2024
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.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@rmyz
Copy link
Contributor Author

rmyz commented Nov 28, 2024

CC @roshan-elastic in case you want to see the screenshots

@roshan-elastic
Copy link

CC @roshan-elastic in case you want to see the screenshots

THANK YOU! Having just the PRs I need to see without needing to go further than here saves me SO much time ❤️

Copy link
Contributor

@cauemarcondes cauemarcondes left a comment

Choose a reason for hiding this comment

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

LGTM, just a nit

…cs/hosts/components/tabs/alerts/alerts_tab_content.tsx

Co-authored-by: Cauê Marcondes <[email protected]>
Copy link
Contributor

@crespocarlos crespocarlos left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -63,7 +69,7 @@ export const AlertsTabContent = () => {
<LinkToAlertsPage
dateRange={searchCriteria.dateRange}
data-test-subj="infraHostAlertsTabAlertsShowAllButton"
kuery={`${ALERT_RULE_PRODUCER}: ${INFRA_ALERT_FEATURE_ID}`}
kuery={`${hostsWithAlertsKuery}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure we want to filter by this?

The query's scalability has changed, and instead of showing all alerts across hosts, we're now only displaying alerts for specific hosts. This could limit the visibility we might need.

Any thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well, as the previous query would only show alerts that were created inside infra, now we are filtering by all the hosts that have more than 1 alert. This maintains the alert count we are showing everywhere

Copy link
Member

@jennypavlova jennypavlova left a comment

Choose a reason for hiding this comment

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

LGTM, just nits ⬇️

@rmyz rmyz enabled auto-merge (squash) November 29, 2024 14:16
@elasticmachine
Copy link
Contributor

elasticmachine commented Nov 29, 2024

💛 Build succeeded, but was flaky

  • Buildkite Build
  • Commit: bee9a26
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-202188-bee9a2634649

Failed CI Steps

Metrics [docs]

Async chunks

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

id before after diff
infra 1.8MB 1.8MB -298.0B
inventory 236.8KB 236.7KB -81.0B
total -379.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
infra 56.5KB 56.9KB +418.0B

History

cc @rmyz

@rmyz rmyz merged commit a882b2c into elastic:main Nov 29, 2024
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/12087516249

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 29, 2024
…tency with entity inventory (elastic#202188)

## Summary

Closes elastic#201567
Fixes elastic#181580 and elastic#201528

This PR ensures that Infra views display all alerts, regardless of index
pattern.
It provides consistent alert visibility across services.
- **Alert counts per host in the Hosts List now shows all host alerts**
- **Alert counts in alerting tab in Hosts List now shows all host
alerts**
- **Hosts Views now shows all host alerts**
- **Container Views now shows all container alerts**
- **Alert counts shown in Hosts Lists and Host Views now are consistent
with alerting app when filtered by host**
- **Clicking through alerts in host/container views now filters by just
the entity ID**
- **Clicking `Show all` in `Hosts` now goes to Alerts app with all hosts
that have alerts in the filter**
- **Clicking an Alert in Entity Inventory now searches by just the
entity ID**

## Screenshots
Screen|Before|After
-|-|-
Entity inventory (no changes here, just showing the alert count for next
screens)|<img width="1276" alt="image"
src="https://github.com/user-attachments/assets/e6054957-b9d8-4d19-8ce3-b101f60099a2">|<img
width="772" alt="image"
src="https://github.com/user-attachments/assets/2b64fb4d-ff60-4c6b-8e15-3ccb5ae6621b">
Host detail view|<img width="662" alt="image"
src="https://github.com/user-attachments/assets/0dd405bc-888a-4fd0-9412-6016e8ae3795">|<img
width="775" alt="image"
src="https://github.com/user-attachments/assets/bf694b1d-b7bb-4cc8-abd1-bebb2070d11c">
Host List view|<img width="536" alt="image"
src="https://github.com/user-attachments/assets/a9c7ae89-8549-49d0-aeb3-3dc28dd3f713"><img
width="894" alt="image"
src="https://github.com/user-attachments/assets/38433bfb-66b0-4c08-824a-ccf46ad93e50">|<img
width="582" alt="image"
src="https://github.com/user-attachments/assets/7addf149-9f12-45a3-b443-9cd069edc4a9"><img
width="731" alt="image"
src="https://github.com/user-attachments/assets/51e80e6c-504b-40b0-80b7-a9a58a6ad153">
Container detail view|<img width="676" alt="image"
src="https://github.com/user-attachments/assets/851cafec-d580-4184-a7a1-7b87620ea1b4">|<img
width="698" alt="image"
src="https://github.com/user-attachments/assets/aebdd4f5-26f1-4b74-8cf4-37dc74aad112">
Click `Show all` in Host List|<img width="696" alt="image"
src="https://github.com/user-attachments/assets/0557f9f8-aee3-4898-be17-372f3522f160">|<img
width="1096" alt="image"
src="https://github.com/user-attachments/assets/c5ace835-a56b-45cb-95c7-fa978d7840f5">
Click `Show all` in Host/Container detail view|<img width="712"
alt="image"
src="https://github.com/user-attachments/assets/eb04c059-aff0-48f4-90fb-73c08943cb57">|<img
width="748" alt="image"
src="https://github.com/user-attachments/assets/189f686d-5931-4f42-bf14-ac9f1ae987e4">
Click alert in Entity Inventory|<img width="677" alt="image"
src="https://github.com/user-attachments/assets/e99f70a1-c217-4225-acf4-25285fff8282">|<img
width="637" alt="image"
src="https://github.com/user-attachments/assets/9aa77aa4-7a77-45ac-8cf4-95b5203d0f5a">

---------

Co-authored-by: Cauê Marcondes <[email protected]>
(cherry picked from commit a882b2c)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 29, 2024
…consistency with entity inventory (#202188) (#202336)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Infra] Show all alerts in Infra views (Host + Containers) for
consistency with entity inventory
(#202188)](#202188)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Sergi
Romeu","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-29T15:45:58Z","message":"[Infra]
Show all alerts in Infra views (Host + Containers) for consistency with
entity inventory (#202188)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/201567\nFixes #181580 and
#201528\n\nThis PR ensures that Infra views display all alerts,
regardless of index\npattern.\nIt provides consistent alert visibility
across services.\n- **Alert counts per host in the Hosts List now shows
all host alerts**\n- **Alert counts in alerting tab in Hosts List now
shows all host\nalerts**\n- **Hosts Views now shows all host alerts**\n-
**Container Views now shows all container alerts**\n- **Alert counts
shown in Hosts Lists and Host Views now are consistent\nwith alerting
app when filtered by host**\n- **Clicking through alerts in
host/container views now filters by just\nthe entity ID**\n- **Clicking
`Show all` in `Hosts` now goes to Alerts app with all hosts\nthat have
alerts in the filter**\n- **Clicking an Alert in Entity Inventory now
searches by just the\nentity ID**\n\n##
Screenshots\nScreen|Before|After\n-|-|-\nEntity inventory (no changes
here, just showing the alert count for next\nscreens)|<img
width=\"1276\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/e6054957-b9d8-4d19-8ce3-b101f60099a2\">|<img\nwidth=\"772\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/2b64fb4d-ff60-4c6b-8e15-3ccb5ae6621b\">\nHost
detail view|<img width=\"662\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/0dd405bc-888a-4fd0-9412-6016e8ae3795\">|<img\nwidth=\"775\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/bf694b1d-b7bb-4cc8-abd1-bebb2070d11c\">\nHost
List view|<img width=\"536\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/a9c7ae89-8549-49d0-aeb3-3dc28dd3f713\"><img\nwidth=\"894\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/38433bfb-66b0-4c08-824a-ccf46ad93e50\">|<img\nwidth=\"582\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/7addf149-9f12-45a3-b443-9cd069edc4a9\"><img\nwidth=\"731\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/51e80e6c-504b-40b0-80b7-a9a58a6ad153\">\nContainer
detail view|<img width=\"676\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/851cafec-d580-4184-a7a1-7b87620ea1b4\">|<img\nwidth=\"698\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/aebdd4f5-26f1-4b74-8cf4-37dc74aad112\">\nClick
`Show all` in Host List|<img width=\"696\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/0557f9f8-aee3-4898-be17-372f3522f160\">|<img\nwidth=\"1096\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/c5ace835-a56b-45cb-95c7-fa978d7840f5\">\nClick
`Show all` in Host/Container detail view|<img
width=\"712\"\nalt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/eb04c059-aff0-48f4-90fb-73c08943cb57\">|<img\nwidth=\"748\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/189f686d-5931-4f42-bf14-ac9f1ae987e4\">\nClick
alert in Entity Inventory|<img width=\"677\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/e99f70a1-c217-4225-acf4-25285fff8282\">|<img\nwidth=\"637\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/9aa77aa4-7a77-45ac-8cf4-95b5203d0f5a\">\n\n---------\n\nCo-authored-by:
Cauê Marcondes
<[email protected]>","sha":"a882b2ce48ecc741433aa6df67606f434024a469","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","backport:prev-minor","ci:project-deploy-observability"],"title":"[Infra]
Show all alerts in Infra views (Host + Containers) for consistency with
entity inventory
","number":202188,"url":"https://github.com/elastic/kibana/pull/202188","mergeCommit":{"message":"[Infra]
Show all alerts in Infra views (Host + Containers) for consistency with
entity inventory (#202188)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/201567\nFixes #181580 and
#201528\n\nThis PR ensures that Infra views display all alerts,
regardless of index\npattern.\nIt provides consistent alert visibility
across services.\n- **Alert counts per host in the Hosts List now shows
all host alerts**\n- **Alert counts in alerting tab in Hosts List now
shows all host\nalerts**\n- **Hosts Views now shows all host alerts**\n-
**Container Views now shows all container alerts**\n- **Alert counts
shown in Hosts Lists and Host Views now are consistent\nwith alerting
app when filtered by host**\n- **Clicking through alerts in
host/container views now filters by just\nthe entity ID**\n- **Clicking
`Show all` in `Hosts` now goes to Alerts app with all hosts\nthat have
alerts in the filter**\n- **Clicking an Alert in Entity Inventory now
searches by just the\nentity ID**\n\n##
Screenshots\nScreen|Before|After\n-|-|-\nEntity inventory (no changes
here, just showing the alert count for next\nscreens)|<img
width=\"1276\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/e6054957-b9d8-4d19-8ce3-b101f60099a2\">|<img\nwidth=\"772\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/2b64fb4d-ff60-4c6b-8e15-3ccb5ae6621b\">\nHost
detail view|<img width=\"662\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/0dd405bc-888a-4fd0-9412-6016e8ae3795\">|<img\nwidth=\"775\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/bf694b1d-b7bb-4cc8-abd1-bebb2070d11c\">\nHost
List view|<img width=\"536\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/a9c7ae89-8549-49d0-aeb3-3dc28dd3f713\"><img\nwidth=\"894\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/38433bfb-66b0-4c08-824a-ccf46ad93e50\">|<img\nwidth=\"582\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/7addf149-9f12-45a3-b443-9cd069edc4a9\"><img\nwidth=\"731\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/51e80e6c-504b-40b0-80b7-a9a58a6ad153\">\nContainer
detail view|<img width=\"676\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/851cafec-d580-4184-a7a1-7b87620ea1b4\">|<img\nwidth=\"698\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/aebdd4f5-26f1-4b74-8cf4-37dc74aad112\">\nClick
`Show all` in Host List|<img width=\"696\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/0557f9f8-aee3-4898-be17-372f3522f160\">|<img\nwidth=\"1096\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/c5ace835-a56b-45cb-95c7-fa978d7840f5\">\nClick
`Show all` in Host/Container detail view|<img
width=\"712\"\nalt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/eb04c059-aff0-48f4-90fb-73c08943cb57\">|<img\nwidth=\"748\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/189f686d-5931-4f42-bf14-ac9f1ae987e4\">\nClick
alert in Entity Inventory|<img width=\"677\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/e99f70a1-c217-4225-acf4-25285fff8282\">|<img\nwidth=\"637\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/9aa77aa4-7a77-45ac-8cf4-95b5203d0f5a\">\n\n---------\n\nCo-authored-by:
Cauê Marcondes
<[email protected]>","sha":"a882b2ce48ecc741433aa6df67606f434024a469"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/202188","number":202188,"mergeCommit":{"message":"[Infra]
Show all alerts in Infra views (Host + Containers) for consistency with
entity inventory (#202188)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/201567\nFixes #181580 and
#201528\n\nThis PR ensures that Infra views display all alerts,
regardless of index\npattern.\nIt provides consistent alert visibility
across services.\n- **Alert counts per host in the Hosts List now shows
all host alerts**\n- **Alert counts in alerting tab in Hosts List now
shows all host\nalerts**\n- **Hosts Views now shows all host alerts**\n-
**Container Views now shows all container alerts**\n- **Alert counts
shown in Hosts Lists and Host Views now are consistent\nwith alerting
app when filtered by host**\n- **Clicking through alerts in
host/container views now filters by just\nthe entity ID**\n- **Clicking
`Show all` in `Hosts` now goes to Alerts app with all hosts\nthat have
alerts in the filter**\n- **Clicking an Alert in Entity Inventory now
searches by just the\nentity ID**\n\n##
Screenshots\nScreen|Before|After\n-|-|-\nEntity inventory (no changes
here, just showing the alert count for next\nscreens)|<img
width=\"1276\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/e6054957-b9d8-4d19-8ce3-b101f60099a2\">|<img\nwidth=\"772\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/2b64fb4d-ff60-4c6b-8e15-3ccb5ae6621b\">\nHost
detail view|<img width=\"662\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/0dd405bc-888a-4fd0-9412-6016e8ae3795\">|<img\nwidth=\"775\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/bf694b1d-b7bb-4cc8-abd1-bebb2070d11c\">\nHost
List view|<img width=\"536\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/a9c7ae89-8549-49d0-aeb3-3dc28dd3f713\"><img\nwidth=\"894\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/38433bfb-66b0-4c08-824a-ccf46ad93e50\">|<img\nwidth=\"582\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/7addf149-9f12-45a3-b443-9cd069edc4a9\"><img\nwidth=\"731\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/51e80e6c-504b-40b0-80b7-a9a58a6ad153\">\nContainer
detail view|<img width=\"676\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/851cafec-d580-4184-a7a1-7b87620ea1b4\">|<img\nwidth=\"698\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/aebdd4f5-26f1-4b74-8cf4-37dc74aad112\">\nClick
`Show all` in Host List|<img width=\"696\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/0557f9f8-aee3-4898-be17-372f3522f160\">|<img\nwidth=\"1096\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/c5ace835-a56b-45cb-95c7-fa978d7840f5\">\nClick
`Show all` in Host/Container detail view|<img
width=\"712\"\nalt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/eb04c059-aff0-48f4-90fb-73c08943cb57\">|<img\nwidth=\"748\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/189f686d-5931-4f42-bf14-ac9f1ae987e4\">\nClick
alert in Entity Inventory|<img width=\"677\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/e99f70a1-c217-4225-acf4-25285fff8282\">|<img\nwidth=\"637\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/9aa77aa4-7a77-45ac-8cf4-95b5203d0f5a\">\n\n---------\n\nCo-authored-by:
Cauê Marcondes
<[email protected]>","sha":"a882b2ce48ecc741433aa6df67606f434024a469"}}]}]
BACKPORT-->

Co-authored-by: Sergi Romeu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) ci:project-deploy-observability Create an Observability project release_note:fix v8.18.0 v9.0.0
Projects
None yet
8 participants