Keep Random Beacon | Node Monitoring | Part 2
**[EDIT: 30-Aug-2020]Added a new dashboard with KEEP Random Beacon Metrics and updated the instructions to get the latest dashboard.
This article is a follow up on Keep Random Beacon | Node Monitoring | Part 1. Instructions in this article require that you have already completed the instructions in part 1 to:
- Setup Prometheus with Node Exporter and cAdvisor
- Added a Prometheus job in prometheus.yml for scraping keep metrics
- Setup Loki and Loki log driver
- Create Grafana Cloud Starter account
In this article, we will see how you can configure Grafana to use stats and logs from Prometheus and Loki.
Grafana Login
Log into the Grafana cloud starter account you created by following Part 1. You will see a screen similar to the following.
Once you have logged in, click on the Log In button above to connect to the hosted Grafana instance from your browser. After a successful login you will see following screen.
Create Grafana Data Sources
In this section, we will see how you can create data sources in Grafana to connect to Loki and Prometheus servers we setup by following Part 1.
Create Prometheus Data Source
- Click on Data Source option as shown in the screen below from left-hand side menu of Grafana web UI.
- Click on Add Data Source
- Click “Select” on Prometheus data source
- Populate the fields on the form
Name: Keep Network - Random Beacon
URL: http://<your prometheus server IP|DNS>:9090/
You can leave rest of the fields with default values and click on Save and Test. It should be able to connect to the Prometheus server and show a success message.
Click on “Back” after the test is successful.
- You will see the newly created Prometheus data source
Create Loki Data Source (Using Prometheus DS in Grafana)
We will create a data source connected to Loki using Prometheus data store. This is because Grafana does not support alerting if you select Loki data store. Follow the steps to create a new data store as described in the previous section and add the following details on the data source creation page.
Name: Prometheus-Loki
URL: http://<your loki server IP|DNS>:3100/loki
Click on “Save & Test”. Click on “Back” after successful.
Create Loki Data Source (Using Loki DS in Grafana)
We will create a data source connected to Loki using Loki data store.
Follow the steps to create a new data store as described in the previous section and choose Loki instead of Prometheus data store.
Name: Keep Client - Loki
URL: http://<your loki server IP|DNS>:3100
Click on “Save & Test”. Click on “Back” after successful.
You will now see the 3 new data sources you just created.
Create Notification Channel
We have now configured the Prometheus and Loki data sources. We will now create a mail notification channel to send alerts.
Click on Alerts icon on left-hand side menu on the web UI to open the following screen.
Enter “Keep Network Mail Notification” and select “Email” from Type dropdown.
In email settings section provide the email address where you want the mail notifications to be sent. Save and go back.
Importing Dashboard
I have already created and shared the dashboard which on Grafana. You can get and use the dashboard from Grafana.
When you open the link to Grafana dashboard provided above it will open the following page.
You can get the Dashboard to your own Grafana instance either by Downloading the JSON and then importing to Grafana. Or you can simply copy the ID (12478) and use it to import.
The next steps show how you can import the dashboard using the dashboard ID.
Rollover the mouse on + icon on the left-hand side menu and click on “Import” as shown below. It will open the dashboard import screen.
Enter the dashboard ID (12920) in “Import via grafana.com” field and click on “Load”
It will load the dashboard and you will be able to see it in the list of dashboards at the Home page. You can click on Grafana icon in top left-hand side corner as seen on the screen-shot above to go back to the home page.
You can click the link (see highlighted in the red rectangle above) and it would open the dashboard.