Discussion: Dynamically fetch data instead of page reload for monitoring dashboard
Problem to solve
Improve the Monitoring dashboard user experience by dynamically loading content instead of reloading the page every time a dropdown control is updated.
Further details
The current dropdown controls to change the dashboard, environment, and date time picker reloads the entire page when a new value is selected. We should definitely take advantage of the fact that the page is entirely built-in Vue and make it more responsive by exploring other client-side data fetching strategies when controls are updated and not reload the page.
Other applications like Grafana have a similar experience in cases where the time range of a dashboard is changed.
Pros
- HTML/JS/CSS and other resources are loaded only once.
- Seamless and linear user experience with minimal page reloads.
- This will enable us to implement future features like auto-refreshing dashboards and also with integration testing (IMO).
- More opportunity to cache results.
Cons
- Might make the Vuex state management a bit tricky.
- Results caching may lead to memory-leak situations (if not handled properly)
Proposal
- Listen to change events (in Vuex) on the aforementioned dashboard dropdown controls and fetch data instead of reloading page
- Use HTML5 History API to manage changes in
fromandtodatetime URL params. - The backend currently passes a bunch of params like feature flags, Prometheus endpoints that do not dynamically change and not need any changes. However, params like
prometheus_statusmight require change.
Documentation
No change required.
Testing
This would involve writing more state management tests. The existing component specs would require minimal to no changes.