From eca5ac48aba0e343bb8742c0edaa97bb26055b40 Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 2 Jan 2019 15:27:08 -0800 Subject: [PATCH 1/6] WIP: Setting grafana version to 5.4.2 --- docker-compose.yml | 2 +- install.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5a8e5ce..5575e44 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -72,7 +72,7 @@ services: mode: global grafana: - image: grafana/grafana:4.6.3 + image: grafana/grafana:5.4.2 depends_on: - prometheus ports: diff --git a/install.sh b/install.sh index ce0fd0d..ed60061 100755 --- a/install.sh +++ b/install.sh @@ -20,7 +20,7 @@ if [ -d "$DIRECTORY" ]; then rm -rf "$DIRECTORY" fi echo "Cloning Project" -git clone https://github.com/PagerTree/prometheus-grafana-alertmanager-example.git +git clone --single-branch --branch grafana-5.4.2 https://github.com/PagerTree/prometheus-grafana-alertmanager-example.git cd "$DIRECTORY" echo "Making Utility scripts executable" From 9ef817eb13944137b0d908b353cb9b1a995a55b3 Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 2 Jan 2019 16:06:03 -0800 Subject: [PATCH 2/6] Adds the provisioning folder --- grafana/provisioning/dashboards/default.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 grafana/provisioning/dashboards/default.yml diff --git a/grafana/provisioning/dashboards/default.yml b/grafana/provisioning/dashboards/default.yml new file mode 100644 index 0000000..3b978e6 --- /dev/null +++ b/grafana/provisioning/dashboards/default.yml @@ -0,0 +1,11 @@ +apiVersion: 1 + +providers: +- name: 'default' + orgId: 1 + folder: '' + type: file + disableDeletion: false + updateIntervalSeconds: 10 #how often Grafana will scan for changed dashboards + options: + path: /var/lib/grafana/dashboards From b0b517edcf0adcf01702dde2724ead21ebf0714f Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 2 Jan 2019 16:27:06 -0800 Subject: [PATCH 3/6] Adds the datasources --- config.monitoring | 3 +-- .../dashboards/{default.yml => all.yml} | 0 grafana/provisioning/datasources/all.yml | 20 +++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) rename grafana/provisioning/dashboards/{default.yml => all.yml} (100%) create mode 100644 grafana/provisioning/datasources/all.yml diff --git a/config.monitoring b/config.monitoring index 3c4822e..5778399 100644 --- a/config.monitoring +++ b/config.monitoring @@ -1,3 +1,2 @@ GF_SECURITY_ADMIN_PASSWORD=9uT46ZKE -GF_DASHBOARDS_JSON_ENABLED=true -GF_DASHBOARDS_JSON_PATH=/var/lib/grafana/dashboards +GF_PATHS_PROVISIONING=/var/lib/grafana/provisioning diff --git a/grafana/provisioning/dashboards/default.yml b/grafana/provisioning/dashboards/all.yml similarity index 100% rename from grafana/provisioning/dashboards/default.yml rename to grafana/provisioning/dashboards/all.yml diff --git a/grafana/provisioning/datasources/all.yml b/grafana/provisioning/datasources/all.yml new file mode 100644 index 0000000..b54bdf1 --- /dev/null +++ b/grafana/provisioning/datasources/all.yml @@ -0,0 +1,20 @@ +# config file version +apiVersion: 1 + +# list of datasources that should be deleted from the database +deleteDatasources: + - name: Prometheus + orgId: 1 + +# list of datasources to insert/update depending +# whats available in the database +datasources: + # name of the datasource. Required +- name: 'Prometheus' + type: 'prometheus' + access: 'proxy' + org_id: 1 + url: 'http://prometheus:9090' + is_default: true + version: 1 + editable: true From c04112eac08bc2c05192f8abdda60fa7cec40c4f Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 2 Jan 2019 16:32:21 -0800 Subject: [PATCH 4/6] Adds the grafana provisioning folder --- config.monitoring | 1 - docker-compose.yml | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/config.monitoring b/config.monitoring index 5778399..bfd4e48 100644 --- a/config.monitoring +++ b/config.monitoring @@ -1,2 +1 @@ GF_SECURITY_ADMIN_PASSWORD=9uT46ZKE -GF_PATHS_PROVISIONING=/var/lib/grafana/provisioning diff --git a/docker-compose.yml b/docker-compose.yml index 5575e44..bf486f6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -80,6 +80,7 @@ services: volumes: - grafana_data:/var/lib/grafana - ./grafana/dashboards:/var/lib/grafana/dashboards + - ./grafana/provisioning:/etc/grafana/provisioning env_file: - config.monitoring From ab49bac8496650b4ccc46f53da3c8bf4a437fc90 Mon Sep 17 00:00:00 2001 From: Austin Date: Thu, 3 Jan 2019 13:04:14 -0800 Subject: [PATCH 5/6] Remove the datasource configuration section --- README.md | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/README.md b/README.md index 1123f72..0a4aa11 100644 --- a/README.md +++ b/README.md @@ -58,21 +58,6 @@ Here's a list of all the services that are created: ## Post Configuration -### Datasource Configuration -Now we need to create the Prometheus Datasource in order to connect Grafana to Prometheus -* Click the `Grafana` Menu at the top left corner (looks like a fireball) -* Click `Data Sources` -* Click the green button `Add Data Source`. -* Input the following parameters **exactly as shown** - * Name - `Prometheus`, Default - `checked` - * Type - `Prometheus` - * HTTP settings - * URL - `http://prometheus:9090` - * Access - `proxy` -* Click `Save & Test` - -Add Data Source - ### Ping Configuration If you would like to add or change the Ping targets should be monitored you'll want to edit the `targets` section in [prometheus/prometheus.yml](prometheus/prometheus.yml) From 89a1ace9e23552176adc97148365054ea008ae55 Mon Sep 17 00:00:00 2001 From: Austin Date: Thu, 3 Jan 2019 13:12:19 -0800 Subject: [PATCH 6/6] Don't need to point to the 5.4.2 branch in the install script anymore --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index ed60061..ce0fd0d 100755 --- a/install.sh +++ b/install.sh @@ -20,7 +20,7 @@ if [ -d "$DIRECTORY" ]; then rm -rf "$DIRECTORY" fi echo "Cloning Project" -git clone --single-branch --branch grafana-5.4.2 https://github.com/PagerTree/prometheus-grafana-alertmanager-example.git +git clone https://github.com/PagerTree/prometheus-grafana-alertmanager-example.git cd "$DIRECTORY" echo "Making Utility scripts executable"