-
Notifications
You must be signed in to change notification settings - Fork 5
3. Run
- Navigate to your server's Grafana address (e.g.
grafana.myserv.er). Here you should see a barebones Grafana running. In order to create dashboards, you will to access the login page atgrafana.myserv.er/login. The default login isadmin/admin- change this to something of your choice. - Navigate to
grafana.myserv.er/dashboardsand set up a folder to house all of your dashboards - such asCOVID-19 Romania. Remember this folder name, as you will need it later for theJupyternotebook. - Now you will need to import the 6 dashboards of the website: 3 languages in 2 themes each.
- In the
jupyterfolder you will find 3.jsonfiles, import these one by one, preserving the dashboard IDs and always importing into your Grafana folder that you have just created. After they have been imported, create one copy of each, and add-lightat the end of their IDs upon import. You should end up with 6 dashboards in total:HU, RO, EN, HU-light, RO-light, EN-light. You may, of course, change this structure - but then make sure you take that into account in Jupyter, too.
- In the
- Next you will need to create an API key for you to be able to control Grafana through python from Jupyter.
- Navigate to
grafana.myserv.er/org/apikeysand generate anEditorrole key.
- Navigate to
- Now you should have some dashboards nicely showing up - although not quite styled the correct way yet. We will fix that in a minute. First, we will need to find out what is the build string of your Grafana installation.
- Back in the terminal either enter the
grafanacontainer and run 'find /usr/share/grafana/public/build -type f -name "*.css"` - Alternatively, you can directly:
docker exec -it grafana find /usr/share/grafana/public/build -type f -name "*.css" - You should see two
.cssfiles listed, with a build string betweendark(light) and.css. Copy this.
- Back in the terminal either enter the
- Next we need to insert the correct build string into Grafana's
index.html.- In your folder structure, edit the file
html/style/grafana/index.html- In
line 31replace build string in the.cssfile path with yours - In
lines 267-271replace build string in the.jsfile paths with yours - In
lines 196-203replacehrefattributes of the links with your site's address - (These instructions are valid for
Grafana v7.0, they may change for later versions)
- In
- Next, edit the file
html/style/grafana/style.sh- In
lines 1-2replace build string in the.cssfile paths with yours
- In
- In your folder structure, edit the file
- Then, run the following commands to install the custom CSS styles into your dashboard:
chmod -x html/style/grafana/style.shbash html/style/grafana/style.sh
- Now your dahsboards look pretty - but they still hold no data..
Navigate to your server's Jupyter address (jupyter.myserv.er) and log in with the Jupyter password you have set up in the Dockerfile. Then a Jupyter Lab interface will start. Navigate into the work folder.
- Create a folder named
auth- Here you will need to create 4 files:
-
influx.txt- containing only your InfluxDBadmin password stringaccess token -
mapbox.txt- containing your Mapbox API key -
grafana.txt- containing only your Grafana API key -
sheet.txt- containing only your Google Sheet ID (if applicable)
-
- Here you will need to create 4 files:
- Start the
formatter.ipynband run the first 7 cells - until the InfluxDB databases are created.
Initiate the Inflxud Next task is to set up the the InflxuDB as a data source in Grafana.
- Navigate to
grafana.myserv.er/datasourcesand click on a new InfluxdDB data source.- Name it
InfluxDB -
urlshould behttp://influxdb:8086- i.e. it connects to your InfluxDB instance through the Docker backend. -
Organizationisroeim -
Databaseisbase -
Userisadmin -
Passwordis your InfluxDBadmin passwordaccess token - Click on
Save & Testat the bottom of the page
- Name it
- Repeat the steps above for another InfluxDB data source, named
InfluxDB-long, withDatabaseequal tolong.
Back to the Jupyter, you should be able to run the rest of the cells to achieve a full data update of the site. At the end of the operation, all panels in Grafana should show correct values. The last thing you will need to do is to set up the default dashboard Grafana will show you upon login:
- On the Grafana homepage, you will see a dashboard list. Star one or or more of the dashboards.
- In the
grafana.myserv.er/orgset theHome Dashboardto your preferred dashboard.
It is worth mentioning that by default, all dashboards are updated using the Jupyter script taking the HU dashboard as the reference. You may change this in the Grafana section of the formatter.ipynb Jupyter notebook.
This is all you need to be up and running with a full setup of your RoEIM. You may, however, want to read further about π 4. Update.
π·π΄πΉππ COVID-19 - Romanian Economic Impact Monitor https://econ.ubbcluj.ro/coronavirus