Skip to content

Commit df30b64

Browse files
committed
update dashboards and claude instructions
1 parent 5cdbc51 commit df30b64

File tree

3 files changed

+76
-3
lines changed

3 files changed

+76
-3
lines changed

claude/grafana-dashboard-sync-instructions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ python3 claude/tools/sync_dashboard.py
4848
This script will:
4949
- Use upstream dashboards as the base structure
5050
- Add K8s variables (env, service) to all dashboards - NO pod variable
51+
- Preserve dashboard-specific variables (e.g., interval) alongside K8s variables
5152
- Transform all PromQL queries to use service-only label selectors
5253
- Hardcode datasource UID `o59qe-zVz` in all panels
5354
- Preserve Scroll UIDs
@@ -167,6 +168,7 @@ All Scroll dashboards must include these variables (2 only - NO pod variable):
167168
**Important:**
168169
- No `pod` variable - queries aggregate by service only, enabling data continuity when pods are replaced
169170
- No `datasource` variable - datasource UID is hardcoded in all panels
171+
- **Dashboard-specific variables are preserved:** Some dashboards have additional variables (e.g., `interval` in reth-state-growth.json) that must be preserved alongside the K8s variables
170172

171173
### Hardcoded Datasource
172174

claude/tools/sync_dashboard.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,12 @@ def add_k8s_variables(dashboard: Dict, preserve_uid: str = None) -> Dict:
5353
if 'templating' not in dashboard:
5454
dashboard['templating'] = {'list': []}
5555

56-
# Replace ALL variables with ONLY K8s variables (env, pod, service)
57-
# This ensures we only have the 3 required K8s variables
58-
dashboard['templating']['list'] = k8s_vars
56+
# Preserve dashboard-specific variables (like interval for reth-state-growth)
57+
existing_vars = dashboard.get('templating', {}).get('list', [])
58+
preserved_vars = [v for v in existing_vars if v.get('name') in ['interval']]
59+
60+
# Replace with K8s variables + preserved dashboard-specific variables
61+
dashboard['templating']['list'] = k8s_vars + preserved_vars
5962

6063
# Preserve scroll UID if provided
6164
if preserve_uid:

etc/grafana/scroll/reth-state-growth.json

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,6 +1685,74 @@
16851685
"refresh": 1,
16861686
"regex": "(l[1|2]reth.*)",
16871687
"type": "query"
1688+
},
1689+
{
1690+
"current": {
1691+
"selected": true,
1692+
"text": "10m",
1693+
"value": "10m"
1694+
},
1695+
"hide": 0,
1696+
"includeAll": false,
1697+
"label": "Interval",
1698+
"multi": false,
1699+
"name": "interval",
1700+
"options": [
1701+
{
1702+
"selected": false,
1703+
"text": "5m",
1704+
"value": "5m"
1705+
},
1706+
{
1707+
"selected": true,
1708+
"text": "10m",
1709+
"value": "10m"
1710+
},
1711+
{
1712+
"selected": false,
1713+
"text": "30m",
1714+
"value": "30m"
1715+
},
1716+
{
1717+
"selected": false,
1718+
"text": "1h",
1719+
"value": "1h"
1720+
},
1721+
{
1722+
"selected": false,
1723+
"text": "6h",
1724+
"value": "6h"
1725+
},
1726+
{
1727+
"selected": false,
1728+
"text": "12h",
1729+
"value": "12h"
1730+
},
1731+
{
1732+
"selected": false,
1733+
"text": "1d",
1734+
"value": "1d"
1735+
},
1736+
{
1737+
"selected": false,
1738+
"text": "7d",
1739+
"value": "7d"
1740+
},
1741+
{
1742+
"selected": false,
1743+
"text": "14d",
1744+
"value": "14d"
1745+
},
1746+
{
1747+
"selected": false,
1748+
"text": "30d",
1749+
"value": "30d"
1750+
}
1751+
],
1752+
"query": "5m,10m,30m,1h,6h,12h,1d,7d,14d,30d",
1753+
"queryValue": "",
1754+
"skipUrlSync": false,
1755+
"type": "custom"
16881756
}
16891757
]
16901758
},

0 commit comments

Comments
 (0)