Skip to content

Commit

Permalink
Use job name to differentiate beacon and validator metrics (#4952)
Browse files Browse the repository at this point in the history
Grafana dashboards now use the "job" default label instead of "scrape_location"
custom label to differentiate between beacon and validator metrics.

The prometheus config files are updated to use the expected job name.
  • Loading branch information
nflaig committed Jan 12, 2023
1 parent 995d2a5 commit 0582f41
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 33 deletions.
4 changes: 2 additions & 2 deletions dashboards/lodestar_block_processor.json
Original file line number Diff line number Diff line change
Expand Up @@ -2757,7 +2757,7 @@
{
"matcher": {
"id": "byName",
"options": "beacon_fork_choice_errors_total{group=\"beta\", instance=\"contabo-13\", job=\"beacon\", scrape_location=\"beacon\"}"
"options": "beacon_fork_choice_errors_total{group=\"beta\", instance=\"contabo-13\", job=\"beacon\"}"
},
"properties": [
{
Expand Down Expand Up @@ -2993,7 +2993,7 @@
{
"matcher": {
"id": "byName",
"options": "{instance=\"beacon_node:8008\", job=\"Lodestar\"}"
"options": "{job=\"beacon\"}"
},
"properties": [
{
Expand Down
20 changes: 10 additions & 10 deletions dashboards/lodestar_summary.json
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "rate(process_cpu_user_seconds_total{scrape_location=\"beacon\"} [1m])",
"expr": "rate(process_cpu_user_seconds_total{job=\"beacon\"} [1m])",
"interval": "",
"legendFormat": "",
"refId": "A"
Expand Down Expand Up @@ -629,7 +629,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "process_heap_bytes{scrape_location=\"beacon\"}",
"expr": "process_heap_bytes{job=\"beacon\"}",
"interval": "",
"legendFormat": "",
"refId": "A"
Expand Down Expand Up @@ -687,7 +687,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "process_start_time_seconds{scrape_location=\"beacon\"}*1000",
"expr": "process_start_time_seconds{job=\"beacon\"}*1000",
"instant": false,
"interval": "",
"legendFormat": "",
Expand Down Expand Up @@ -815,7 +815,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "lodestar_version{scrape_location=\"beacon\"}",
"expr": "lodestar_version{job=\"beacon\"}",
"format": "time_series",
"instant": true,
"interval": "",
Expand Down Expand Up @@ -869,7 +869,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "lodestar_version{scrape_location=\"beacon\"}",
"expr": "lodestar_version{job=\"beacon\"}",
"format": "time_series",
"instant": true,
"interval": "",
Expand Down Expand Up @@ -932,7 +932,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "nodejs_version_info{scrape_location=\"beacon\"}",
"expr": "nodejs_version_info{job=\"beacon\"}",
"instant": true,
"interval": "",
"legendFormat": "{{version}}",
Expand Down Expand Up @@ -1553,7 +1553,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "sum(rate(nodejs_gc_duration_seconds_sum{scrape_location=\"beacon\"} [$rate_interval])) by (instance)",
"expr": "sum(rate(nodejs_gc_duration_seconds_sum{job=\"beacon\"} [$rate_interval])) by (instance)",
"hide": false,
"interval": "",
"legendFormat": "gc_duration_sum",
Expand All @@ -1565,7 +1565,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "sum(rate(nodejs_gc_pause_seconds_total{scrape_location=\"beacon\"} [$rate_interval])) by (instance)",
"expr": "sum(rate(nodejs_gc_pause_seconds_total{job=\"beacon\"} [$rate_interval])) by (instance)",
"hide": false,
"interval": "",
"legendFormat": "gc_pause_sum",
Expand Down Expand Up @@ -1687,7 +1687,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "avg_over_time( scrape_duration_seconds{scrape_location=\"beacon\"} [$rate_interval])",
"expr": "avg_over_time( scrape_duration_seconds{job=\"beacon\"} [$rate_interval])",
"hide": false,
"interval": "",
"legendFormat": "prometheus_beacon_scrape_roundtrip",
Expand All @@ -1699,7 +1699,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "avg_over_time( scrape_duration_seconds{scrape_location=\"validator\"} [$rate_interval])",
"expr": "avg_over_time( scrape_duration_seconds{job=\"validator\"} [$rate_interval])",
"hide": false,
"interval": "",
"legendFormat": "prometheus_validator_scrape_roundtrip",
Expand Down
10 changes: 5 additions & 5 deletions dashboards/lodestar_validator_client.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "lodestar_version{scrape_location=\"validator\"}",
"expr": "lodestar_version{job=\"validator\"}",
"format": "time_series",
"instant": true,
"interval": "",
Expand Down Expand Up @@ -328,7 +328,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "nodejs_version_info{scrape_location=\"validator\"}",
"expr": "nodejs_version_info{job=\"validator\"}",
"instant": true,
"interval": "",
"legendFormat": "{{version}}",
Expand Down Expand Up @@ -393,7 +393,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "lodestar_version{scrape_location=\"validator\"}",
"expr": "lodestar_version{job=\"validator\"}",
"format": "time_series",
"instant": true,
"interval": "",
Expand Down Expand Up @@ -522,7 +522,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "process_heap_bytes{scrape_location=\"validator\"}",
"expr": "process_heap_bytes{job=\"validator\"}",
"interval": "",
"legendFormat": "",
"refId": "A"
Expand Down Expand Up @@ -586,7 +586,7 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": false,
"expr": "nodejs_heap_size_used_bytes{scrape_location=\"validator\"}",
"expr": "nodejs_heap_size_used_bytes{job=\"validator\"}",
"interval": "",
"legendFormat": "",
"refId": "A"
Expand Down
6 changes: 2 additions & 4 deletions dashboards/lodestar_validator_monitor.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,7 @@
"group": false,
"instance": true,
"job": true,
"network": false,
"scrape_location": true
"network": false
},
"indexByName": {
"Time": 1,
Expand All @@ -231,8 +230,7 @@
"index": 0,
"instance": 4,
"job": 5,
"network": 6,
"scrape_location": 7
"network": 6
},
"renameByName": {}
}
Expand Down
10 changes: 5 additions & 5 deletions dashboards/lodestar_vm_host.json
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@
{
"matcher": {
"id": "byName",
"options": "{instance=\"beacon_node:8008\", job=\"Lodestar\"}"
"options": "{job=\"beacon\"}"
},
"properties": [
{
Expand Down Expand Up @@ -2474,7 +2474,7 @@
"expr": "avg_over_time(scrape_duration_seconds[$rate_interval])",
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{scrape_location}}",
"legendFormat": "{{job}}",
"refId": "A"
},
{
Expand All @@ -2486,7 +2486,7 @@
"expr": "rate(lodestar_metrics_scrape_seconds_sum[$rate_interval])\n/\nrate(lodestar_metrics_scrape_seconds_count[$rate_interval])",
"hide": false,
"interval": "",
"legendFormat": "{{scrape_location}} internal",
"legendFormat": "{{job}} internal",
"refId": "B"
}
],
Expand Down Expand Up @@ -2562,7 +2562,7 @@
{
"matcher": {
"id": "byName",
"options": "{instance=\"beacon_node:8008\", job=\"Lodestar\"}"
"options": "{job=\"beacon\"}"
},
"properties": [
{
Expand Down Expand Up @@ -2605,7 +2605,7 @@
"exemplar": false,
"expr": "1-up",
"interval": "",
"legendFormat": "{{scrape_location}}",
"legendFormat": "{{job}}",
"refId": "A"
}
],
Expand Down
18 changes: 12 additions & 6 deletions docker/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
global:
scrape_interval: 20s
scrape_timeout: 20s

# Tags (values starting with #) have to be replaced in the Dockerfile with sed
# Modified datasource to work with a network_mode: host
scrape_configs:
- job_name: Lodestar
scrape_interval: 20s
scrape_timeout: 20s
- job_name: beacon
metrics_path: /metrics
static_configs:
# This tag is to be replaced in the Dockerfile with sed
# Modified datasource to work with a network_mode: host
- targets: ["#BEACON_URL", "#VC_URL"]
- targets: ["#BEACON_URL"]
- job_name: validator
metrics_path: /metrics
static_configs:
- targets: ["#VC_URL"]
2 changes: 1 addition & 1 deletion prometheus.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
scrape_configs:
- job_name: Lodestar
- job_name: beacon
scrape_interval: 5s
metrics_path: /metrics
static_configs:
Expand Down

0 comments on commit 0582f41

Please sign in to comment.