From bdad91b7002913a8bb6ec08982752685b2c5b604 Mon Sep 17 00:00:00 2001 From: greged93 <82421016+greged93@users.noreply.github.com> Date: Mon, 21 Oct 2024 11:42:46 +0200 Subject: [PATCH] docs: update grafana docs (#11908) --- etc/README.md | 41 +++++++++++++++-------------------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/etc/README.md b/etc/README.md index 28c71b046..4f4ce7f20 100644 --- a/etc/README.md +++ b/etc/README.md @@ -19,55 +19,41 @@ the [docker docs](/book/installation/docker.md#using-docker-compose). #### Adding a new metric to Grafana -To set up a new metric in Reth and its Grafana dashboard: +To set up a new metric in Reth and its Grafana dashboard (this assumes running Reth and Grafana instances): 1. Add the metric to the codebase following the [metrics section](../docs/design/metrics.md#creating-metrics) documentation. -2. Build the Reth image: - - ```bash - docker build . -t reth:local - ``` - - Modify the [docker-compose](./docker-compose.yml) file to use your locally built image for the Reth service. - -3. Run Docker Compose: - - ```bash - docker compose -f etc/docker-compose.yml -f etc/lighthouse.yml up -d - ``` - -4. Access Grafana: +1. Access Grafana: - Open `http://localhost:3000/` in a browser - Log in with username and password `admin` - Navigate to the `Dashboards` tab -5. Create or modify a dashboard: +1. Create or modify a dashboard: - Select an existing dashboard or create a new one - Click `Add` > `Visualization` to create a new panel -6. Configure your metric panel: +1. Configure your metric panel: - Set a panel title and description - Select metric(s) from the `Metrics browser` or use the `PromQL` terminal - Document your metric(s) by setting units, legends, etc. - When adding multiple metrics, use field overwrites if needed -7. Save and arrange: +1. Save and arrange: - Click `Apply` to save the panel - Drag the panel to desired position on the dashboard -8. Export the dashboard: +1. Export the dashboard: - Click `Share` > `Export` - Toggle `Export for sharing externally` - Click `Save to file` -9. Update dashboard file: +1. Update dashboard file: - Replace the content of the corresponding file in the [dashboards folder](./grafana/dashboards) with the exported JSON @@ -75,15 +61,18 @@ Your new metric is now integrated into the Reth Grafana dashboard. #### Import Grafana dashboards -In order to import new Grafana dashboards or update a dashboard: +If you are running Reth and Grafana outside of docker, and wish to import new Grafana dashboards or update a dashboard: 1. Go to `Home` > `Dashboards` -2. Click `New` > `Import` +1. Click `New` > `Import` -3. Drag the JSON dashboard file to import it +1. Drag the JSON dashboard file to import it -4. If updating an existing dashboard, you will need to change the name and UID of the imported dashboard in order to +1. If updating an existing dashboard, you will need to change the name and UID of the imported dashboard in order to avoid conflict -5. Delete the old dashboard +1. Delete the old dashboard + +If you are running Reth and Grafana using docker, after having pulled the updated dashboards from `main`, restart the +Grafana service. This will update all dashboards. \ No newline at end of file