|
| 1 | +# Dashboard - Basic RUM |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +This is the visualization component of Basic RUM. It's nothing more than [Grafana](https://grafana.com/), few third-party Grafana plugins, Grafana dashboards configurations and a build script that puts everything together. |
| 6 | + |
| 7 | +With the help of this project we keep the Grafana dashboards in source control and build Docker images that are used when we run all the Basic RUM components together. |
| 8 | + |
| 9 | +**Docker repository:** https://hub.docker.com/r/basicrum/dashboard |
| 10 | + |
| 11 | +## Third-Party Grafana plugins |
| 12 | + |
| 13 | + * Plotly panel - https://grafana.com/grafana/plugins/ae3e-plotly-panel/ |
| 14 | + * By AE3E - https://github.com/ae3e/ae3e-plotly-panel |
| 15 | + * Altinity plugin for ClickHouse - https://grafana.com/grafana/plugins/vertamedia-clickhouse-datasource/ |
| 16 | + * By Altinity - https://altinity.com |
| 17 | + |
| 18 | +## Local development |
| 19 | + |
| 20 | +### Prerequisites |
| 21 | + |
| 22 | + * Docker |
| 23 | + * Docker Compose |
| 24 | + * Node JS |
| 25 | + |
| 26 | +### What do we run locally? |
| 27 | + |
| 28 | +Locally with the help of Docker Compose we run our own image/build of Grafana and in addition we spin a Docker container for [ClickHouse](https://clickhouse.com/). We use ClickHouse as a data store that is being used for feeding with data the Grafana dashboards. |
| 29 | + |
| 30 | +### File structure |
| 31 | + |
| 32 | + * `.github/workflows` - GitHub actions for running tests and automatic push to Docker Hub. |
| 33 | + * `artefacts` - Static files like icons and logos used during the build process for adding branding information. |
| 34 | + * `build` - This folder doesn't exist when we clone this repository. The folder is used during the build process to keep dashboards and datasources configurations. |
| 35 | + * `dashboards/defs` - Definitions/metadata information about the dashboards we are building. |
| 36 | + * `setup/ch` - Contains file used for provisioning ClickHouse locally. When the files are used required users and tables are being created in ClickHouse. |
| 37 | + * `src/lib` - Utility classes used for the dashboards build process. |
| 38 | + * `templates` - Contains configurations, SQL statements and Plotly JS specific JavaScript. The files in this folder are being used during the build process for creating the configuration for each individual Grafana panel. |
| 39 | + |
| 40 | +## Local development workflow |
| 41 | + |
| 42 | +We have a simple build script `build.js` based on Node JS. We need to make sure that the required Node JS modules are installed. |
| 43 | + |
| 44 | +Run: |
| 45 | +``` |
| 46 | +npm install |
| 47 | +``` |
| 48 | + |
| 49 | +Once we are sure that we have initialized the Node JS part of the project we follow this workflow: |
| 50 | + |
| 51 | + 1. Change things in `dashboards` or `templates` folders. |
| 52 | + 2. Run `node build.js` . |
| 53 | + 3. Run `make up` ... this is a wrapper around Docker Compose commands and will build and run the required Docker container. |
| 54 | + 4. Load in the browser `http://localhost:3300/` in order to verify the changes. |
| 55 | + 1. If you see a login screen type: |
| 56 | + 1. Username: `admin` |
| 57 | + 2. Password: `password` |
| 58 | + |
0 commit comments