Skip to content

[Security Solution][Entity Analytics][PrivMon] Handle null/undefined values gracefully for tiles on Privmon dashboard#226387

Merged
abhishekbhatia1710 merged 8 commits intoelastic:mainfrom
abhishekbhatia1710:privmon-handle-null-values-for-tiles
Jul 11, 2025
Merged

[Security Solution][Entity Analytics][PrivMon] Handle null/undefined values gracefully for tiles on Privmon dashboard#226387
abhishekbhatia1710 merged 8 commits intoelastic:mainfrom
abhishekbhatia1710:privmon-handle-null-values-for-tiles

Conversation

@abhishekbhatia1710
Copy link
Copy Markdown
Contributor

@abhishekbhatia1710 abhishekbhatia1710 commented Jul 3, 2025

Summary

What changed:

Added error handling for PrivMon dashboard tiles when ES queries fail (like missing ML indices)
Instead of showing broken visualizations, tiles now display a clean "Data not available" message
The error tiles maintain consistent styling and layout with working tiles

Added state tracking to detect when visualization loading completes

  • Check for missing [tables] property in visualization response to identify errors
  • Render a styled error state using EUI components that matches the design of working tiles
  • Made error message i18n compliant for proper localization

Screenshot Ref :

image

With data :

image

Testing Steps :

  1. Checkout this PR
  2. Start the privmon engine : POST kbn:/api/entity_analytics/monitoring/engine/init
  3. Add some privileged users either using a CSV file or from dev console.
  4. Add relevant data for different indexes using the security-documents-generator.
  5. Enable the risk score and Asset criticality.
  6. Change filters for timerange or any KQL query to get the desired results.
  7. The tile visualisations on the privmon dashboard should not display any errors. It should either display the Count or Data not available.

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

@abhishekbhatia1710 abhishekbhatia1710 self-assigned this Jul 3, 2025
@abhishekbhatia1710 abhishekbhatia1710 requested a review from a team as a code owner July 3, 2025 10:46
@abhishekbhatia1710 abhishekbhatia1710 added release_note:skip Skip the PR/issue when compiling release notes Team:Entity Analytics Security Entity Analytics Team backport:version Backport to applied version labels v9.1.0 labels Jul 3, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-entity-analytics (Team:Entity Analytics)


const LENS_VISUALIZATION_HEIGHT = 126;
const LENS_VISUALIZATION_MIN_WIDTH = 160;
const LENS_VISUALIZATION_HEIGHT = 150;
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.

Can you describe what the effect of this change to the height/weight is?

Copy link
Copy Markdown
Contributor Author

@abhishekbhatia1710 abhishekbhatia1710 Jul 9, 2025

Choose a reason for hiding this comment

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

Yes, with the EUIGroup and EuiPanel coming into play, the space of EuiFlex became more and the tiles occupied 4 columns and 2 rows in the (usual monitor size window) instead of 2 columns and 2 rows as below :

image

So the height and width brings the tile in 2x3 frame (for usual monitor size window)

Copy link
Copy Markdown
Contributor

@jaredburgettelastic jaredburgettelastic left a comment

Choose a reason for hiding this comment

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

Have not desk tested, but code looks straightforward and good to me!

) {
return (
<EuiFlexItem grow={false} style={{ minWidth: LENS_VISUALIZATION_MIN_WIDTH }}>
<EuiPanel
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.

I am not a fan of the grey panel, I think this would look better white like the other tiles, and maybe with slighly larger text, maybe color="warning" and a warning icon? Could you have another go at the styling and see what you can come up with? 🙂

Screenshot 2025-07-09 at 10 59 20

Copy link
Copy Markdown
Contributor

@hop-dev hop-dev Jul 9, 2025

Choose a reason for hiding this comment

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

Maybe not colored text I think that will look weird ignore that, but icon could be nice 😎

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.

We can discuss if this looks better :

image

Copy link
Copy Markdown
Contributor

@hop-dev hop-dev Jul 9, 2025

Choose a reason for hiding this comment

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

Yeah or maybe big central icon with text below, one for 🅿️

1. minWidht and minHeight remains
2. Subdued tile is removed
3. Title and "Data not available" similar to other tiles
4. Warning icon currently near "Data not available"
@hop-dev
Copy link
Copy Markdown
Contributor

hop-dev commented Jul 9, 2025

@elasticmachine merge upstream

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

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
securitySolution 9.8MB 9.8MB +422.0B

History

cc @abhishekbhatia1710

@abhishekbhatia1710 abhishekbhatia1710 merged commit df7732a into elastic:main Jul 11, 2025
12 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.1

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

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
9.1 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 226387

Questions ?

Please refer to the Backport tool documentation

@abhishekbhatia1710
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
9.1

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

Questions ?

Please refer to the Backport tool documentation

abhishekbhatia1710 added a commit to abhishekbhatia1710/kibana that referenced this pull request Jul 11, 2025
…values gracefully for tiles on Privmon dashboard (elastic#226387)

## Summary

What changed:

Added error handling for PrivMon dashboard tiles when ES queries fail
(like missing ML indices)
Instead of showing broken visualizations, tiles now display a clean
"Data not available" message
The error tiles maintain consistent styling and layout with working
tiles

Added state tracking to detect when visualization loading completes
- Check for missing [tables] property in visualization response to
identify errors
- Render a styled error state using EUI components that matches the
design of working tiles
- Made error message i18n compliant for proper localization

Screenshot Ref :

![image](https://github.com/user-attachments/assets/3e989159-5fa2-4b57-9fe4-523f5785e109)

With data :

![image](https://github.com/user-attachments/assets/473f3254-32c2-4799-ba4b-51121932ab20)

Testing Steps :
1. Checkout this PR
2. Start the privmon engine : `POST
kbn:/api/entity_analytics/monitoring/engine/init`
3. Add some privileged users either using a CSV file or from dev
console.
4. Add relevant data for different indexes using the
security-documents-generator.
6. Enable the risk score and Asset criticality.
7. Change filters for timerange or any KQL query to get the desired
results.
8. The tile visualisations on the privmon dashboard should not display
any errors. It should either display the Count or `Data not available`.

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit df7732a)

# Conflicts:
#	x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/privileged_user_monitoring/components/key_insights_panel/index.tsx
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jul 14, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @abhishekbhatia1710

abhishekbhatia1710 added a commit that referenced this pull request Jul 14, 2025
…fined values gracefully for tiles on Privmon dashboard (#226387) (#227577)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Security Solution][Entity Analytics][PrivMon] Handle null/undefined
values gracefully for tiles on Privmon dashboard
(#226387)](#226387)

<!--- Backport version: 10.0.1 -->

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

<!--BACKPORT [{"author":{"name":"Abhishek
Bhatia","email":"117628830+abhishekbhatia1710@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-07-11T07:55:23Z","message":"[Security
Solution][Entity Analytics][PrivMon] Handle null/undefined values
gracefully for tiles on Privmon dashboard (#226387)\n\n##
Summary\n\nWhat changed:\n\nAdded error handling for PrivMon dashboard
tiles when ES queries fail\n(like missing ML indices)\nInstead of
showing broken visualizations, tiles now display a clean\n\"Data not
available\" message\nThe error tiles maintain consistent styling and
layout with working\ntiles\n\nAdded state tracking to detect when
visualization loading completes\n- Check for missing [tables] property
in visualization response to\nidentify errors\n- Render a styled error
state using EUI components that matches the\ndesign of working tiles\n-
Made error message i18n compliant for proper localization\n\nScreenshot
Ref :
\n\n\n![image](https://github.com/user-attachments/assets/3e989159-5fa2-4b57-9fe4-523f5785e109)\n\nWith
data :
\n\n\n![image](https://github.com/user-attachments/assets/473f3254-32c2-4799-ba4b-51121932ab20)\n\n\nTesting
Steps : \n1. Checkout this PR\n2. Start the privmon engine :
`POST\nkbn:/api/entity_analytics/monitoring/engine/init`\n3. Add some
privileged users either using a CSV file or from dev\nconsole.\n4. Add
relevant data for different indexes using
the\nsecurity-documents-generator.\n6. Enable the risk score and Asset
criticality.\n7. Change filters for timerange or any KQL query to get
the desired\nresults.\n8. The tile visualisations on the privmon
dashboard should not display\nany errors. It should either display the
Count or `Data not available`.\n\n\n### Checklist\n\nCheck the PR
satisfies following conditions. \n\nReviewers should verify this PR
satisfies this list as well.\n\n- [ ] Any text added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[ ] The PR description includes the appropriate Release Notes
section,\nand the correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[ ] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"df7732aab8d3cb1ba494f9fea0445b2cb8d108bc","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Entity
Analytics","backport:version","v9.1.0","v9.2.0"],"title":"[Security
Solution][Entity Analytics][PrivMon] Handle null/undefined values
gracefully for tiles on Privmon
dashboard","number":226387,"url":"https://github.com/elastic/kibana/pull/226387","mergeCommit":{"message":"[Security
Solution][Entity Analytics][PrivMon] Handle null/undefined values
gracefully for tiles on Privmon dashboard (#226387)\n\n##
Summary\n\nWhat changed:\n\nAdded error handling for PrivMon dashboard
tiles when ES queries fail\n(like missing ML indices)\nInstead of
showing broken visualizations, tiles now display a clean\n\"Data not
available\" message\nThe error tiles maintain consistent styling and
layout with working\ntiles\n\nAdded state tracking to detect when
visualization loading completes\n- Check for missing [tables] property
in visualization response to\nidentify errors\n- Render a styled error
state using EUI components that matches the\ndesign of working tiles\n-
Made error message i18n compliant for proper localization\n\nScreenshot
Ref :
\n\n\n![image](https://github.com/user-attachments/assets/3e989159-5fa2-4b57-9fe4-523f5785e109)\n\nWith
data :
\n\n\n![image](https://github.com/user-attachments/assets/473f3254-32c2-4799-ba4b-51121932ab20)\n\n\nTesting
Steps : \n1. Checkout this PR\n2. Start the privmon engine :
`POST\nkbn:/api/entity_analytics/monitoring/engine/init`\n3. Add some
privileged users either using a CSV file or from dev\nconsole.\n4. Add
relevant data for different indexes using
the\nsecurity-documents-generator.\n6. Enable the risk score and Asset
criticality.\n7. Change filters for timerange or any KQL query to get
the desired\nresults.\n8. The tile visualisations on the privmon
dashboard should not display\nany errors. It should either display the
Count or `Data not available`.\n\n\n### Checklist\n\nCheck the PR
satisfies following conditions. \n\nReviewers should verify this PR
satisfies this list as well.\n\n- [ ] Any text added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[ ] The PR description includes the appropriate Release Notes
section,\nand the correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[ ] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"df7732aab8d3cb1ba494f9fea0445b2cb8d108bc"}},"sourceBranch":"main","suggestedTargetBranches":["9.1"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/226387","number":226387,"mergeCommit":{"message":"[Security
Solution][Entity Analytics][PrivMon] Handle null/undefined values
gracefully for tiles on Privmon dashboard (#226387)\n\n##
Summary\n\nWhat changed:\n\nAdded error handling for PrivMon dashboard
tiles when ES queries fail\n(like missing ML indices)\nInstead of
showing broken visualizations, tiles now display a clean\n\"Data not
available\" message\nThe error tiles maintain consistent styling and
layout with working\ntiles\n\nAdded state tracking to detect when
visualization loading completes\n- Check for missing [tables] property
in visualization response to\nidentify errors\n- Render a styled error
state using EUI components that matches the\ndesign of working tiles\n-
Made error message i18n compliant for proper localization\n\nScreenshot
Ref :
\n\n\n![image](https://github.com/user-attachments/assets/3e989159-5fa2-4b57-9fe4-523f5785e109)\n\nWith
data :
\n\n\n![image](https://github.com/user-attachments/assets/473f3254-32c2-4799-ba4b-51121932ab20)\n\n\nTesting
Steps : \n1. Checkout this PR\n2. Start the privmon engine :
`POST\nkbn:/api/entity_analytics/monitoring/engine/init`\n3. Add some
privileged users either using a CSV file or from dev\nconsole.\n4. Add
relevant data for different indexes using
the\nsecurity-documents-generator.\n6. Enable the risk score and Asset
criticality.\n7. Change filters for timerange or any KQL query to get
the desired\nresults.\n8. The tile visualisations on the privmon
dashboard should not display\nany errors. It should either display the
Count or `Data not available`.\n\n\n### Checklist\n\nCheck the PR
satisfies following conditions. \n\nReviewers should verify this PR
satisfies this list as well.\n\n- [ ] Any text added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[ ] The PR description includes the appropriate Release Notes
section,\nand the correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[ ] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"df7732aab8d3cb1ba494f9fea0445b2cb8d108bc"}}]}]
BACKPORT-->
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jul 14, 2025
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
…values gracefully for tiles on Privmon dashboard (elastic#226387)

## Summary

What changed:

Added error handling for PrivMon dashboard tiles when ES queries fail
(like missing ML indices)
Instead of showing broken visualizations, tiles now display a clean
"Data not available" message
The error tiles maintain consistent styling and layout with working
tiles

Added state tracking to detect when visualization loading completes
- Check for missing [tables] property in visualization response to
identify errors
- Render a styled error state using EUI components that matches the
design of working tiles
- Made error message i18n compliant for proper localization

Screenshot Ref : 


![image](https://github.com/user-attachments/assets/3e989159-5fa2-4b57-9fe4-523f5785e109)

With data : 


![image](https://github.com/user-attachments/assets/473f3254-32c2-4799-ba4b-51121932ab20)


Testing Steps : 
1. Checkout this PR
2. Start the privmon engine : `POST
kbn:/api/entity_analytics/monitoring/engine/init`
3. Add some privileged users either using a CSV file or from dev
console.
4. Add relevant data for different indexes using the
security-documents-generator.
6. Enable the risk score and Asset criticality.
7. Change filters for timerange or any KQL query to get the desired
results.
8. The tile visualisations on the privmon dashboard should not display
any errors. It should either display the Count or `Data not available`.


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:Entity Analytics Security Entity Analytics Team v9.1.0 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants