Skip to content

Commit 60eb472

Browse files
authored
chore(l1): filter instances in grafana through (#5088)
**Motivation** We want to filter instances based on their current network in our grafana Dashboard **Description** This PR reorder variables and make instance match the current network, also fixes an issue with duplicated pie charts due to more than one instance locally (which was causing issues also for this change) and is now solved. Closes #5087, #5049
1 parent 4ee0a46 commit 60eb472

File tree

3 files changed

+31
-9
lines changed

3 files changed

+31
-9
lines changed

metrics/docker-compose-metrics-l1.overrides.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ services:
3131
- ./provisioning/grafana/dashboards:/etc/grafana/provisioning/dashboards
3232
environment:
3333
- GF_SECURITY_ADMIN_PASSWORD=admin
34+
extra_hosts:
35+
- "host.docker.internal:host-gateway"

metrics/provisioning/grafana/dashboards/common_dashboards/ethrex_l1_perf.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2496,35 +2496,37 @@
24962496
"text": "",
24972497
"value": ""
24982498
},
2499-
"definition": "label_values({__name__=~\"(gigagas|eth_con_beacon_slot)\"},instance)",
2499+
"definition": "label_values(eth_con_spec_config_name,name)",
25002500
"includeAll": true,
25012501
"multi": true,
2502-
"name": "instance",
2502+
"name": "network",
25032503
"options": [],
25042504
"query": {
25052505
"qryType": 1,
2506-
"query": "label_values({__name__=~\"(gigagas|eth_con_beacon_slot)\"},instance)",
2506+
"query": "label_values(eth_con_spec_config_name,name)",
25072507
"refId": "PrometheusVariableQueryEditor-VariableQuery"
25082508
},
25092509
"refresh": 1,
2510-
"regex": "/^(?<text>[^:]+)(?::\\d+)?$/",
2510+
"regex": "",
25112511
"type": "query"
25122512
},
25132513
{
25142514
"current": {
25152515
"text": "",
25162516
"value": ""
25172517
},
2518-
"definition": "label_values(eth_con_spec_config_name,name)",
2519-
"name": "network",
2518+
"definition": "label_values(eth_con_spec_config_name{name=~\"$network\"},instance)",
2519+
"includeAll": true,
2520+
"multi": true,
2521+
"name": "instance",
25202522
"options": [],
25212523
"query": {
25222524
"qryType": 1,
2523-
"query": "label_values(eth_con_spec_config_name,name)",
2525+
"query": "label_values(eth_con_spec_config_name{name=~\"$network\"},instance)",
25242526
"refId": "PrometheusVariableQueryEditor-VariableQuery"
25252527
},
25262528
"refresh": 1,
2527-
"regex": "",
2529+
"regex": "/^(?<text>[^:]+)(?::\\d+)?$/",
25282530
"type": "query"
25292531
},
25302532
{
@@ -2568,4 +2570,4 @@
25682570
"title": "Ethrex L1 - Perf Dashboard",
25692571
"uid": "beoru4vp59yiof",
25702572
"version": 29
2571-
}
2573+
}

metrics/provisioning/prometheus/prometheus_l1_sync_docker.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ scrape_configs:
55
- job_name: "ethrex L1"
66
static_configs:
77
- targets: ["host.docker.internal:3701"]
8+
labels:
9+
# We need to collapse all the instances under the same name
10+
# for the dashboard to work properly locally as it works distributed
11+
# the port is needed just to match the regex in the dashboard, so
12+
# 0000 is just a placeholder.
13+
instance: "localhost:0000"
814
scrape_interval: 10s
915
metrics_path: /metrics
1016

@@ -17,11 +23,23 @@ scrape_configs:
1723
- job_name: "ethereum-metrics-exporter"
1824
static_configs:
1925
- targets: ["ethereum-metrics-exporter:9093"]
26+
labels:
27+
# We need to collapse all the instances under the same name
28+
# for the dashboard to work properly locally as it works distributed
29+
# the port is needed just to match the regex in the dashboard, so
30+
# 0000 is just a placeholder.
31+
instance: "localhost:0000"
2032
scrape_interval: 5s
2133
metrics_path: /metrics
2234

2335
- job_name: 'node_exporter'
2436
static_configs:
2537
- targets: ['host.docker.internal:9122']
38+
labels:
39+
# We need to collapse all the instances under the same name
40+
# for the dashboard to work properly locally as it works distributed
41+
# the port is needed just to match the regex in the dashboard, so
42+
# 0000 is just a placeholder.
43+
instance: "localhost:0000"
2644
scrape_interval: 5s
2745
metrics_path: /metrics

0 commit comments

Comments
 (0)