kibana/packages/kbn-formatters
mohamedhamed-ahmed 98536eba48
[Dataset quality] Implement Summary Panel (#175994)
closes https://github.com/elastic/kibana/issues/170247

## 📝  Summary

This PR introduces a new state machine for controlling the new Dataset
Quality Summary Panel.
As part of this work, we had to introduce a new endpoint to fetch and
calculate the Estimated Data in last 24h.

## 💡For Reviewers

### State Machine

The new state machine introduces 3 parallel states to fetch the values
displayed in the summary panel.
In case of failures in any of them, a retry mechanism is introduced to
try the fetch 1 more time after 5 seconds interval.
If the fetch fails again, we display an error toast notification.

![Screenshot 2024-02-08 at 09 01
34](f1db05f7-fd68-41f5-a950-533fd73aec27)

### New Endpoint

A new endpoint `GET
/internal/dataset_quality/data_streams/estimated_data` has been
introduced to calculate the Estimated Data in last 24h.
The endpoint first retrieves the doc count and total size in bytes for
`logs-*` and uses them to calculate the average size per doc which is
then multiplied by the number of total doc in the last 24h to get an
estimate of data in last 24h.


##   Testing

1) Navigate to /app/observability-logs-explorer/dataset-quality
2) The summary panel is displayed at the top of the table
3) Filterations shouldn't affect the data displayed as the panel is
completely isolated

## 🎥 Demos

- Normal Scenario


c88c3e73-973e-4dd2-babe-63e2c6ae2dda


- Retry On Failures


b952963a-5d67-472a-bd69-9cd9e49b0ed1


- Failing Again After Max Retries


31cb2e4c-cb90-4490-8bcc-ccb11994f9fa

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-02-13 14:41:32 +02:00
..
src/bytes_formatter [Dataset quality] Implement Summary Panel (#175994) 2024-02-13 14:41:32 +02:00
index.ts [Dataset quality] Implement Summary Panel (#175994) 2024-02-13 14:41:32 +02:00
jest.config.js [Dataset quality] Implement Summary Panel (#175994) 2024-02-13 14:41:32 +02:00
kibana.jsonc [Dataset quality] Implement Summary Panel (#175994) 2024-02-13 14:41:32 +02:00
package.json [Dataset quality] Implement Summary Panel (#175994) 2024-02-13 14:41:32 +02:00
REASDME.md [Dataset quality] Implement Summary Panel (#175994) 2024-02-13 14:41:32 +02:00
tsconfig.json [Dataset quality] Implement Summary Panel (#175994) 2024-02-13 14:41:32 +02:00