Skip to content

Commit

Permalink
Add dashboard variables to customize beacon/validator job name (#5211)
Browse files Browse the repository at this point in the history
Hard coded job names need to be kept to work with dashboard provisioning
as for some reason grafana does not use default values when dashboard
is automatically provisioned.

See grafana/grafana#10786
  • Loading branch information
nflaig authored Mar 1, 2023
1 parent ec78af1 commit 734de8a
Show file tree
Hide file tree
Showing 4 changed files with 164 additions and 24 deletions.
32 changes: 30 additions & 2 deletions dashboards/lodestar_block_processor.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
},
{
"name": "VAR_BEACON_JOB",
"type": "constant",
"label": "Beacon node job name",
"value": "beacon",
"description": ""
}
],
"__elements": {},
Expand Down Expand Up @@ -3717,7 +3724,7 @@
{
"matcher": {
"id": "byName",
"options": "beacon_fork_choice_errors_total{group=\"beta\", instance=\"contabo-13\", job=\"beacon\"}"
"options": "beacon_fork_choice_errors_total{group=\"beta\", instance=\"contabo-13\", job=~\"$beacon_job|beacon\"}"
},
"properties": [
{
Expand Down Expand Up @@ -3967,7 +3974,7 @@
{
"matcher": {
"id": "byName",
"options": "{job=\"beacon\"}"
"options": "{job=~\"$beacon_job|beacon\"}"
},
"properties": [
{
Expand Down Expand Up @@ -4153,6 +4160,27 @@
"name": "Filters",
"skipUrlSync": false,
"type": "adhoc"
},
{
"description": "Job name used in Prometheus config to scrape Beacon node",
"hide": 2,
"label": "Beacon node job name",
"name": "beacon_job",
"query": "${VAR_BEACON_JOB}",
"skipUrlSync": false,
"type": "constant",
"current": {
"value": "${VAR_BEACON_JOB}",
"text": "${VAR_BEACON_JOB}",
"selected": false
},
"options": [
{
"value": "${VAR_BEACON_JOB}",
"text": "${VAR_BEACON_JOB}",
"selected": false
}
]
}
]
},
Expand Down
76 changes: 66 additions & 10 deletions dashboards/lodestar_summary.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
},
{
"name": "VAR_BEACON_JOB",
"type": "constant",
"label": "Beacon node job name",
"value": "beacon",
"description": ""
},
{
"name": "VAR_VALIDATOR_JOB",
"type": "constant",
"label": "Validator client job name",
"value": "validator",
"description": ""
}
],
"__elements": {},
Expand Down Expand Up @@ -645,7 +659,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "rate(process_cpu_user_seconds_total{job=\"beacon\"} [1m])",
"expr": "rate(process_cpu_user_seconds_total{job=~\"$beacon_job|beacon\"} [1m])",
"interval": "",
"legendFormat": "",
"refId": "A"
Expand Down Expand Up @@ -705,7 +719,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "process_heap_bytes{job=\"beacon\"}",
"expr": "process_heap_bytes{job=~\"$beacon_job|beacon\"}",
"interval": "",
"legendFormat": "",
"refId": "A"
Expand Down Expand Up @@ -769,7 +783,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "process_start_time_seconds{job=\"beacon\"}*1000",
"expr": "process_start_time_seconds{job=~\"$beacon_job|beacon\"}*1000",
"instant": false,
"interval": "",
"legendFormat": "",
Expand Down Expand Up @@ -913,7 +927,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "lodestar_version{job=\"beacon\"}",
"expr": "lodestar_version{job=~\"$beacon_job|beacon\"}",
"format": "time_series",
"instant": true,
"interval": "",
Expand Down Expand Up @@ -973,7 +987,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "lodestar_version{job=\"beacon\"}",
"expr": "lodestar_version{job=~\"$beacon_job|beacon\"}",
"format": "time_series",
"instant": true,
"interval": "",
Expand Down Expand Up @@ -1042,7 +1056,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "nodejs_version_info{job=\"beacon\"}",
"expr": "nodejs_version_info{job=~\"$beacon_job|beacon\"}",
"instant": true,
"interval": "",
"legendFormat": "{{version}}",
Expand Down Expand Up @@ -1704,7 +1718,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "sum(rate(nodejs_gc_duration_seconds_sum{job=\"beacon\"} [$rate_interval])) by (instance)",
"expr": "sum(rate(nodejs_gc_duration_seconds_sum{job=~\"$beacon_job|beacon\"} [$rate_interval])) by (instance)",
"hide": false,
"interval": "",
"legendFormat": "gc_duration_sum",
Expand All @@ -1716,7 +1730,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "sum(rate(nodejs_gc_pause_seconds_total{job=\"beacon\"} [$rate_interval])) by (instance)",
"expr": "sum(rate(nodejs_gc_pause_seconds_total{job=~\"$beacon_job|beacon\"} [$rate_interval])) by (instance)",
"hide": false,
"interval": "",
"legendFormat": "gc_pause_sum",
Expand Down Expand Up @@ -1845,7 +1859,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "avg_over_time( scrape_duration_seconds{job=\"beacon\"} [$rate_interval])",
"expr": "avg_over_time( scrape_duration_seconds{job=~\"$beacon_job|beacon\"} [$rate_interval])",
"hide": false,
"interval": "",
"legendFormat": "prometheus_beacon_scrape_roundtrip",
Expand All @@ -1857,7 +1871,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "avg_over_time( scrape_duration_seconds{job=\"validator\"} [$rate_interval])",
"expr": "avg_over_time( scrape_duration_seconds{job=~\"$validator_job|validator\"} [$rate_interval])",
"hide": false,
"interval": "",
"legendFormat": "prometheus_validator_scrape_roundtrip",
Expand Down Expand Up @@ -3073,6 +3087,48 @@
"name": "Filters",
"skipUrlSync": false,
"type": "adhoc"
},
{
"description": "Job name used in Prometheus config to scrape Beacon node",
"hide": 2,
"label": "Beacon node job name",
"name": "beacon_job",
"query": "${VAR_BEACON_JOB}",
"skipUrlSync": false,
"type": "constant",
"current": {
"value": "${VAR_BEACON_JOB}",
"text": "${VAR_BEACON_JOB}",
"selected": false
},
"options": [
{
"value": "${VAR_BEACON_JOB}",
"text": "${VAR_BEACON_JOB}",
"selected": false
}
]
},
{
"description": "Job name used in Prometheus config to scrape Validator client",
"hide": 2,
"label": "Validator client job name",
"name": "validator_job",
"query": "${VAR_VALIDATOR_JOB}",
"skipUrlSync": false,
"type": "constant",
"current": {
"value": "${VAR_VALIDATOR_JOB}",
"text": "${VAR_VALIDATOR_JOB}",
"selected": false
},
"options": [
{
"value": "${VAR_VALIDATOR_JOB}",
"text": "${VAR_VALIDATOR_JOB}",
"selected": false
}
]
}
]
},
Expand Down
38 changes: 33 additions & 5 deletions dashboards/lodestar_validator_client.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
},
{
"name": "VAR_VALIDATOR_JOB",
"type": "constant",
"label": "Validator client job name",
"value": "validator",
"description": ""
}
],
"__elements": {},
Expand Down Expand Up @@ -270,7 +277,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "lodestar_version{job=\"validator\"}",
"expr": "lodestar_version{job=~\"$validator_job|validator\"}",
"format": "time_series",
"instant": true,
"interval": "",
Expand Down Expand Up @@ -339,7 +346,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "nodejs_version_info{job=\"validator\"}",
"expr": "nodejs_version_info{job=~\"$validator_job|validator\"}",
"instant": true,
"interval": "",
"legendFormat": "{{version}}",
Expand Down Expand Up @@ -406,7 +413,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "lodestar_version{job=\"validator\"}",
"expr": "lodestar_version{job=~\"$validator_job|validator\"}",
"format": "time_series",
"instant": true,
"interval": "",
Expand Down Expand Up @@ -539,7 +546,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "process_heap_bytes{job=\"validator\"}",
"expr": "process_heap_bytes{job=~\"$validator_job|validator\"}",
"interval": "",
"legendFormat": "",
"refId": "A"
Expand Down Expand Up @@ -605,7 +612,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "nodejs_heap_size_used_bytes{job=\"validator\"}",
"expr": "nodejs_heap_size_used_bytes{job=~\"$validator_job|validator\"}",
"interval": "",
"legendFormat": "",
"refId": "A"
Expand Down Expand Up @@ -2179,6 +2186,27 @@
"name": "Filters",
"skipUrlSync": false,
"type": "adhoc"
},
{
"description": "Job name used in Prometheus config to scrape Validator client",
"hide": 2,
"label": "Validator client job name",
"name": "validator_job",
"query": "${VAR_VALIDATOR_JOB}",
"skipUrlSync": false,
"type": "constant",
"current": {
"value": "${VAR_VALIDATOR_JOB}",
"text": "${VAR_VALIDATOR_JOB}",
"selected": false
},
"options": [
{
"value": "${VAR_VALIDATOR_JOB}",
"text": "${VAR_VALIDATOR_JOB}",
"selected": false
}
]
}
]
},
Expand Down
Loading

0 comments on commit 734de8a

Please sign in to comment.