diff --git a/benchmark/Grafana-dashboard.json b/benchmark/Grafana-dashboard.json index 718216cf7..195df7b24 100644 --- a/benchmark/Grafana-dashboard.json +++ b/benchmark/Grafana-dashboard.json @@ -1,35 +1,4 @@ { - "__inputs": [ - { - "name": "DS_PROMETHEUS", - "label": "prometheus", - "description": "", - "type": "datasource", - "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__elements": {}, - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "11.5.1" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "timeseries", - "name": "Time series", - "version": "" - } - ], "annotations": { "list": [ { @@ -68,7 +37,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "fieldConfig": { "defaults": { @@ -154,7 +123,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "disableTextWrap": false, "editorMode": "builder", @@ -174,7 +143,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "fieldConfig": { "defaults": { @@ -261,7 +230,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "disableTextWrap": false, "editorMode": "code", @@ -277,7 +246,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "editorMode": "code", "expr": "100 * sum(increase(firewood_cache_freelist{type=\"hit\"}[$__rate_interval])) by (name) / sum(increase(firewood_cache_freelist[$__rate_interval])) by (name)", @@ -307,7 +276,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "fieldConfig": { "defaults": { @@ -394,7 +363,7 @@ "refId": "A", "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" } } ], @@ -404,7 +373,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "fieldConfig": { "defaults": { @@ -491,7 +460,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "editorMode": "code", "expr": "irate(firewood_remove[$__rate_interval])", @@ -504,7 +473,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "editorMode": "code", "expr": "sum(irate(firewood_insert{merkle!=\"update\"}[$__rate_interval]))", @@ -517,7 +486,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "editorMode": "code", "expr": "irate(firewood_insert{merkle=\"update\"}[$__rate_interval])", @@ -547,7 +516,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "fieldConfig": { "defaults": { @@ -629,7 +598,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "disableTextWrap": false, "editorMode": "code", @@ -649,7 +618,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "fieldConfig": { "defaults": { @@ -732,7 +701,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "editorMode": "code", "expr": "node_memory_Dirty_bytes", @@ -748,7 +717,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "fieldConfig": { "defaults": { @@ -839,7 +808,7 @@ "refId": "A", "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" } } ], @@ -849,7 +818,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "fieldConfig": { "defaults": { @@ -946,7 +915,7 @@ "refId": "A", "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" } } ], @@ -958,7 +927,18 @@ "schemaVersion": 40, "tags": [], "templating": { - "list": [] + "list": [ + { + "includeAll": false, + "label": "Data Source", + "name": "datasource", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "type": "datasource" + } + ] }, "time": { "from": "now-1h", diff --git a/benchmark/setup-scripts/install-grafana.sh b/benchmark/setup-scripts/install-grafana.sh index 36e05c81e..829fd22d2 100644 --- a/benchmark/setup-scripts/install-grafana.sh +++ b/benchmark/setup-scripts/install-grafana.sh @@ -46,6 +46,46 @@ if ! grep -q '^http_port = 80$' /etc/grafana/grafana.ini; then perl -pi -e 's/^;?http_port = .*/http_port = 80/' /etc/grafana/grafana.ini fi +# configure username and password +# TODO(amin): auto-generate some password for more security +# TODO(amin): another possible option here is enabling google oauth, and this could give access +# to anyone within our org emails +sed -i -E "s|^;?\s*admin_user\s*=.*|admin_user = admin|" /etc/grafana/grafana.ini +sed -i -E "s|^;?\s*admin_password\s*=.*|admin_password = firewoodisfast|" /etc/grafana/grafana.ini + +# provision data source and dashboards +cat > /etc/grafana/provisioning/datasources/prometheus.yml < /etc/grafana/provisioning/dashboards/dashboards.yaml <> /etc/prometheus/prometheus.yml <