Skip to content

[Security Solution] Data Quality dashboard storage metrics#155581

Merged
andrew-goldstein merged 4 commits intoelastic:mainfrom
andrew-goldstein:data-quality-storage-metrics
Apr 25, 2023
Merged

[Security Solution] Data Quality dashboard storage metrics#155581
andrew-goldstein merged 4 commits intoelastic:mainfrom
andrew-goldstein:data-quality-storage-metrics

Conversation

@andrew-goldstein
Copy link
Copy Markdown
Contributor

[Security Solution] Data Quality dashboard storage metrics

storage_metrics_animated

Above: The new storage metrics treemap updates as indices are checked

storage_metrics

Above: Storage metrics in the Data Quality dashboard

Summary

This PR introduces storage metrics to the Data Quality dashboard

  • Multiple views are enhanced to display the size of indices

  • A new interactive treemap visualizes the relative sizes of indices

  • Markdown reports include the size of indices

  • The Data Quality dashboard Beta tag is removed

  • Inline action buttons replace the Take action popover

  • The Global stats panel remains visible when the Select one or more ILM phases help is displayed

  • Code coverage is improved throughout the dashboard

Details

Multiple views enhanced to display the size of indices

The following views have been enhanced to display the Size of indices, per the screenshots below:

  • The pattern table's Size column displays the size of a single index

04_size_column

  • The pattern table's Size tooltip

05_size_column_tooltip

  • The pattern rollup's Size stat displays the total size of indices in a pattern

06_pattern_rollups_size

  • The pattern rollup's Size stat tooltip

07_pattern_rollups_size_tooltip

  • The global stats rollup Size stat displays the total size of all the patterns

08_global_stats_rollup_size

  • The global stats rollup Size stat tooltip

09_global_stats_rollup_size_tooltip

New interactive treemap

A new interactive treemap visualizes the relative sizes of indices:

  • The color of indices in the treemap and its legend update as the data is checked

storage_metrics_animated

  • Clicking on an index in the treemap or the legend expands (and scrolls to) the index

Markdown reports include the Size of indices

Markdown reports are enhanced to include the new Size statistic in:

  • Pattern markdown tables
Result Index Docs Incompatible fields ILM Phase Size
auditbeat-7.14.2-2023.04.09-000001 48,077 (4.3%) 12 hot 41.3MB
auditbeat-7.3.2-2023.04.09-000001 48,068 (4.3%) 8 hot 31MB
auditbeat-7.11.2-2023.04.09-000001 48,064 (4.3%) 12 hot 40.8MB
  • Pattern rollup markdown tables
Incompatible fields Indices checked Indices Size Docs
164 26 26 899.3MB 1,118,155
  • The global stats markdown table
Incompatible fields Indices checked Indices Size Docs
166 32 32 9.2GB 20,779,245

Data Quality dashboard Beta tag removed

The Data Quality dashboard Beta tag is removed from the following views:

  • The Dashboards page

Before:

11_dashboards_before

After:

12_dashboards_after

  • Security Solution side navigation

Before:

13_side_navigation_before

After:

14_side_navigation_after

  • The Data Quality dashboard page header

Before:

15_page_header_before

After:

16_page_header_after

Inline action buttons replace the Take action popover

Inline Add to new case and Copy to clipboard action buttons replace the Take action popover, the previous home of these actions:

Before:

17_actions_before

After:

18_actions_after

Global stats panel remains visible when the Select one or more ILM phases help is displayed

The Global stats panel now remains visible when the Select one or more ILM phases help is displayed:

Before:

19_select_ilm_phases_before

After:

20_select_ilm_phases_after

Code coverage improvements

Code coverage is improved throughout the dashboard, as measured by running the following command:

node scripts/jest --watch x-pack/packages/kbn-ecs-data-quality-dashboard --coverage

@andrew-goldstein andrew-goldstein added release_note:enhancement backport:skip This PR does not require backporting Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Investigations Security Solution Threat Hunting Investigations Team v8.8.0 labels Apr 24, 2023
@andrew-goldstein andrew-goldstein requested a review from a team as a code owner April 24, 2023 02:10
@andrew-goldstein andrew-goldstein self-assigned this Apr 24, 2023
@andrew-goldstein andrew-goldstein requested a review from a team as a code owner April 24, 2023 02:10
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@andrew-goldstein
Copy link
Copy Markdown
Contributor Author

Files by Code Owner

elastic/security-threat-hunting-explore

  • x-pack/plugins/security_solution/public/overview/links.ts
  • x-pack/plugins/security_solution/public/overview/pages/data_quality.tsx

@andrew-goldstein andrew-goldstein force-pushed the data-quality-storage-metrics branch from ba5f1d2 to 64b3bb6 Compare April 24, 2023 09:16
Copy link
Copy Markdown
Contributor

@semd semd left a comment

Choose a reason for hiding this comment

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

Explore changes LGTM!

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.

these inline comments for what's changed are helpful 👌🏾

Copy link
Copy Markdown
Contributor

@michaelolo24 michaelolo24 Apr 24, 2023

Choose a reason for hiding this comment

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

it's the same thing, but you could do patterns[i + 1] ? (<Spacer>) : null or maybe just patterns[i + 1] && <Spacer>

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.

Nit and def not necessary, but with discussions around alerts index name changes, may be better to use the ${DEFAULT_ALERTS_INDEX}-default here.

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.

i'm reluctant to use ${DEFAULT_ALERTS_INDEX}-default in the context of these tests (and others) because artifacts of the current value, .alerts-security.alerts-default, are ubiquitous in the mock (stats and ILM) data, and in most of the tests.

In most contexts, there's nothing magic about .alerts-security.alerts-default other than it's currently a "foreign key" in the mock data. If the value behind the ${DEFAULT_ALERTS_INDEX}-default changes, tests may start failing (with false positives) unless the mock data is manually updated via search & replace.

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.

Yea, took me a sec to realize all of these are just in test files, so doesn't really matter what it is as long as it aligns with the mocks. Ignore me...I've been seeing the index pattern everywhere so I'm very sensitive to it 😂

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.

You can use orderBy to sort in descending order without the additional reverse. Not sure which is more performant though

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.

nice catch

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.

you can use orderBy in this function as well

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.

SUPER random thought, but you can have a space-builder so it's easier to get an idea of the numerical spacing.

Something like ${addSpace(8)} and const addSpace = (spaces: number) => Array(spaces).fill('-').join('');. DEFINITELY over-engineered, but couldn't help myself

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'll stop commenting on these after this.. re the orderBy vs sort().reverse(). And once again, not sure which would be more performant

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.

Do you need to pass the reason=""? or keep it the same as line 143?

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.

nit: you should be able to just pass grow

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.

nit: missed the 'n' in unallowed for the name of this file :) and file path :)

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.

Is there ever a scenario where we would want to show partial results if one of the indices didn't return a value? Not necessary now, but just a thought. We'll see how often users run into this scenario...

Copy link
Copy Markdown
Contributor

@michaelolo24 michaelolo24 left a comment

Choose a reason for hiding this comment

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

The test coverage here is excellent. Thank you for adding them. Desk tested locally across multiple spaces with all ilm phases selected and de-selected and it works great! The tooltips all have the text as expected and there are no signs of the beta tag as far as I can tell. Nice work! 🚀 Just added some minor nits and questions.

![storage_metrics_animated](https://user-images.githubusercontent.com/4459398/233871314-6894b380-63ac-4622-b64f-965752a96019.gif)

_Above: The new storage metrics treemap updates as indices are checked_

![storage_metrics](https://user-images.githubusercontent.com/4459398/233880225-8242733a-4bd6-40b3-bffa-e283ce0d77cd.png)

_Above: Storage metrics in the Data Quality dashboard_

## Summary

This PR introduces [storage metrics](elastic/security-team#6047) to the _Data Quality_ dashboard

- Multiple views are enhanced to display the size of indices

- A new interactive treemap visualizes the relative sizes of indices

- Markdown reports include the size of indices

- The Data Quality dashboard `Beta` tag is removed

- Inline action buttons replace the `Take action` popover

- The Global stats panel remains visible when the `Select one or more ILM phases` help is displayed

- Code coverage is improved throughout the dashboard

## Details

### Multiple views enhanced to display the size of indices

The following views have been enhanced to display the `Size` of indices, per the screenshots below:

- The pattern table's `Size` column displays the size of a single index

![04_size_column](https://user-images.githubusercontent.com/4459398/233870161-d86eadbd-9f01-4ed6-aa6f-98f6044a4f57.png)

- The pattern table's `Size` tooltip

![05_size_column_tooltip](https://user-images.githubusercontent.com/4459398/233868732-08059ba9-5e4b-4f68-a152-eb4b41db6f96.png)

- The pattern rollup's `Size` stat displays the total size of indices in a pattern

![06_pattern_rollups_size](https://user-images.githubusercontent.com/4459398/233868817-babc96eb-c0aa-4b7f-bb45-54e3039d06f2.png)

- The pattern rollup's `Size` stat tooltip

![07_pattern_rollups_size_tooltip](https://user-images.githubusercontent.com/4459398/233868858-14a43aa2-324f-40bd-a185-1cb7ac15c81b.png)

- The global stats rollup `Size` stat displays the total size of all the patterns

![08_global_stats_rollup_size](https://user-images.githubusercontent.com/4459398/233868900-e3cbc00b-3b5a-4756-8246-cb31a1b8bac8.png)

- The global stats rollup `Size` stat tooltip

![09_global_stats_rollup_size_tooltip](https://user-images.githubusercontent.com/4459398/233868952-b9c27432-c8a4-4ad5-9dda-5e1aa903758c.png)

### New interactive treemap

A new interactive treemap visualizes the relative sizes of indices:

- The color of indices in the treemap and its legend update as the data is checked

![storage_metrics_animated](https://user-images.githubusercontent.com/4459398/233871314-6894b380-63ac-4622-b64f-965752a96019.gif)

- Clicking on an index in the treemap or the legend expands (and scrolls to) the index

### Markdown reports include the `Size` of indices

Markdown reports are enhanced to include the new `Size` statistic in:

- Pattern markdown tables

| Result | Index | Docs | Incompatible fields | ILM Phase | Size |
|--------|-------|------|---------------------|-----------|------|
| ❌ | auditbeat-7.14.2-2023.04.09-000001 | 48,077 (4.3%) | 12 | `hot` | 41.3MB |
| ❌ | auditbeat-7.3.2-2023.04.09-000001 | 48,068 (4.3%) | 8 | `hot` | 31MB |
| ❌ | auditbeat-7.11.2-2023.04.09-000001 | 48,064 (4.3%) | 12 | `hot` | 40.8MB |

- Pattern rollup markdown tables

| Incompatible fields | Indices checked | Indices | Size | Docs |
|---------------------|-----------------|---------|------|------|
| 164 | 26 | 26 | 899.3MB | 1,118,155 |

- The global stats markdown table

| Incompatible fields | Indices checked | Indices | Size | Docs |
|---------------------|-----------------|---------|------|------|
| 166 | 32 | 32 | 9.2GB | 20,779,245 |

### Data Quality dashboard `Beta` tag removed

The Data Quality dashboard `Beta` tag is removed from the following views:

- The `Dashboards` page

**Before:**

![11_dashboards_before](https://user-images.githubusercontent.com/4459398/233869434-d4d2ed14-4e6f-4eab-bae6-a9c9b976e20f.png)

**After:**

![12_dashboards_after](https://user-images.githubusercontent.com/4459398/233869088-9dc62d7d-44cb-46cb-8880-976a7b7e9c56.png)

- Security Solution side navigation

**Before:**

![13_side_navigation_before](https://user-images.githubusercontent.com/4459398/233869467-e7725285-1199-40e1-ac65-054bea8b02f6.png)

**After:**

![14_side_navigation_after](https://user-images.githubusercontent.com/4459398/233869146-7b89cb47-3509-478e-8675-9f1653749b18.png)

- The Data Quality dashboard page header

**Before:**

![15_page_header_before](https://user-images.githubusercontent.com/4459398/233869404-0b04c2ec-3d2e-4ba8-9520-68013f80e43a.png)

**After:**

![16_page_header_after](https://user-images.githubusercontent.com/4459398/233869219-b54ee61e-07b7-470d-a668-b4f5ed4327e6.png)

### Inline action buttons replace the `Take action` popover

Inline `Add to new case` and `Copy to clipboard` action buttons replace the `Take action` popover, the previous home of these actions:

**Before:**

![17_actions_before](https://user-images.githubusercontent.com/4459398/233869306-0182145f-affc-4ad1-b63f-72e43d34234c.png)

**After:**

![18_actions_after](https://user-images.githubusercontent.com/4459398/233869345-754b7448-9d28-4253-9186-5b2389acf4ff.png)

### Global stats panel remains visible when the `Select one or more ILM phases` help is displayed

The Global stats panel now remains visible when the `Select one or more ILM phases` help is displayed:

**Before:**

![19_select_ilm_phases_before](https://user-images.githubusercontent.com/4459398/233869754-2067fa5d-7153-407b-aa45-65332b16bc7a.png)

**After:**

![20_select_ilm_phases_after](https://user-images.githubusercontent.com/4459398/233869762-38d069de-3191-4e28-8692-df42ab3b21a5.png)

### Code coverage improvements

Code coverage is improved throughout the dashboard, as measured by running the following command:

```sh
node scripts/jest --watch x-pack/packages/kbn-ecs-data-quality-dashboard --coverage
```
@andrew-goldstein andrew-goldstein force-pushed the data-quality-storage-metrics branch from 01b06fc to 177eed0 Compare April 25, 2023 01:06
@andrew-goldstein andrew-goldstein enabled auto-merge (squash) April 25, 2023 01:17
@kibana-ci
Copy link
Copy Markdown

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 3847 3853 +6

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.1MB 9.1MB +11.6KB
Unknown metric groups

ESLint disabled line counts

id before after diff
@kbn/ecs-data-quality-dashboard 2 6 +4
enterpriseSearch 17 19 +2
securitySolution 397 400 +3
total +9

Total ESLint disabled count

id before after diff
@kbn/ecs-data-quality-dashboard 2 6 +4
enterpriseSearch 18 20 +2
securitySolution 477 480 +3
total +9

History

  • 💔 Build #122504 failed 01b06fc3587c4b387926c51d1d8fc18d96f3d2ea
  • 💚 Build #122328 succeeded 2413edd131d06f507fe78f5a055c8ca7d243a6d0
  • 💔 Build #122264 failed ba5f1d24970483414342ecbd47cd29cd93b2afce

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

cc @andrew-goldstein

@andrew-goldstein andrew-goldstein merged commit 67322fe into elastic:main Apr 25, 2023
@andrew-goldstein andrew-goldstein deleted the data-quality-storage-metrics branch April 25, 2023 02:29
@dhru42
Copy link
Copy Markdown

dhru42 commented May 11, 2023

@andrew-goldstein could we use the following screenshot in the 8.8 release blog?
image

@andrew-goldstein
Copy link
Copy Markdown
Contributor Author

@andrew-goldstein could we use the following screenshot in the 8.8 release blog?

yes @dhru42, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:enhancement Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Investigations Security Solution Threat Hunting Investigations Team v8.8.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants