Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 31 additions & 51 deletions benchmark/Grafana-dashboard.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down Expand Up @@ -68,7 +37,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This diff is a little weird. I'm not sure if this happened because you missed a checkbox when you exported it or not.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure this was checked when exporting!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, this is intentional. I configured a datasource template that lets you choose the datasource, and also automatically selects the available prometheus one. If I didn't do that it didn't capture the datasource automatically.

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried a bit about how people will export updates to the dashboard. Can you add something to the readme that explains how that needs to happen now?

},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -154,7 +123,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"disableTextWrap": false,
"editorMode": "builder",
Expand All @@ -174,7 +143,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -261,7 +230,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"disableTextWrap": false,
"editorMode": "code",
Expand All @@ -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)",
Expand Down Expand Up @@ -307,7 +276,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -394,7 +363,7 @@
"refId": "A",
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
}
}
],
Expand All @@ -404,7 +373,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -491,7 +460,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "irate(firewood_remove[$__rate_interval])",
Expand All @@ -504,7 +473,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(irate(firewood_insert{merkle!=\"update\"}[$__rate_interval]))",
Expand All @@ -517,7 +486,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "irate(firewood_insert{merkle=\"update\"}[$__rate_interval])",
Expand Down Expand Up @@ -547,7 +516,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -629,7 +598,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"disableTextWrap": false,
"editorMode": "code",
Expand All @@ -649,7 +618,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -732,7 +701,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "node_memory_Dirty_bytes",
Expand All @@ -748,7 +717,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -839,7 +808,7 @@
"refId": "A",
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
}
}
],
Expand All @@ -849,7 +818,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -946,7 +915,7 @@
"refId": "A",
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
}
}
],
Expand All @@ -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",
Expand Down
40 changes: 40 additions & 0 deletions benchmark/setup-scripts/install-grafana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have wiki pages that say this password is "firewood_is_fast", so either change it here or find the wiki page.


# provision data source and dashboards
cat > /etc/grafana/provisioning/datasources/prometheus.yml <<EOF
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
orgId: 1
url: http://localhost:9090
isDefault: true
editable: true
EOF

cat > /etc/grafana/provisioning/dashboards/dashboards.yaml <<EOF
apiVersion: 1
providers:
- name: 'files'
orgId: 1
folder: 'Provisioned'
type: file
disableDeletion: false
editable: true
options:
path: /var/lib/grafana/dashboards
foldersFromFilesStructure: true
EOF

# add firewood's dashboard and also node exporter full
mkdir -p /var/lib/grafana/dashboards
# TODO(amin): replace this with script dir
wget -O /var/lib/grafana/dashboards/firewood.json https://github.com/ava-labs/firewood/raw/refs/heads/main/benchmark/Grafana-dashboard.json
wget -O /var/lib/grafana/dashboards/node_exporter_full.json https://grafana.com/api/dashboards/1860/revisions/latest/download

# configure prometheus to scrape firewood
if ! grep -q '^ - job_name: firewood$' /etc/prometheus/prometheus.yml; then
cat >> /etc/prometheus/prometheus.yml <<!
Expand Down