-
Notifications
You must be signed in to change notification settings - Fork 0
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/dashboards
and set up a folder to house all of your dashboards - such asGEM Romania
. Remember this folder name, as you will need it later for theJupyter
notebook. - Now you will need to import the 6 dashboards of the website: 3 languages in 2 themes each.
- In the
jupyter
folder you will find 3.json
files, 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-light
at 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/apikeys
and generate anEditor
role 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
grafana
container 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
.css
files 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 31
replace build string in the.css
file path with yours - In
lines 267-271
replace build string in the.js
file paths with yours - In
lines 196-203
replacehref
attributes 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-2
replace build string in the.css
file 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.sh
bash 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.ipynb
and 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/datasources
and click on a new InfluxdDB data source.- Name it
InfluxDB
-
url
should behttp://influxdb:8086
- i.e. it connects to your InfluxDB instance through the Docker backend. -
Organization
isroeim
-
Database
isbase
-
User
isadmin
-
Password
is your InfluxDBadmin passwordaccess token - Click on
Save & Test
at the bottom of the page
- Name it
- Repeat the steps above for another InfluxDB data source, named
InfluxDB-long
, withDatabase
equal 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/org
set theHome Dashboard
to 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 GEM. You may, however, want to read further about π 4. Update.
π·π΄πΉππ Global Entrepreneurship Monitor Romania https://econ.ubbcluj.ro/entrepreneurship