From 87882c5a4b89f02b00cf4cca168aceae9190af28 Mon Sep 17 00:00:00 2001 From: Thomas Durieux <5577568+tdurieux@users.noreply.github.com> Date: Sun, 15 Nov 2026 13:36:09 +0000 Subject: [PATCH] fix: use datasource-native regex variable interpolation --- deploy/logging/grafana/dashboards/investigation.json | 4 ++-- scripts/test-grafana-dashboard.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/logging/grafana/dashboards/investigation.json b/deploy/logging/grafana/dashboards/investigation.json index ebea0f0..1ce87b7 100644 --- a/deploy/logging/grafana/dashboards/investigation.json +++ b/deploy/logging/grafana/dashboards/investigation.json @@ -110,11 +110,11 @@ "targets": [ { "refId": "A", - "expr": "service:~${service:json} release:~${release:json} event:~${event:json}", + "expr": "service:~\"$service\" release:~\"$release\" event:~\"$event\"", "queryType": "instant", "editorMode": "code", "maxLines": 200, - "packJson": true + "packJson": false } ], "options": { diff --git a/scripts/test-grafana-dashboard.py b/scripts/test-grafana-dashboard.py index 8e1ea3a..550d6d2 100644 --- a/scripts/test-grafana-dashboard.py +++ b/scripts/test-grafana-dashboard.py @@ -34,7 +34,7 @@ def query(panel, target, start=None, end=None): for name in ['request_id', 'job_id', 'edge_id']: target['expr'] = target['expr'].replace('${' + name + ':json}', '"fixture-not-present"').replace('$' + name, 'fixture-not-present') for name in ['service', 'release', 'event']: - target['expr'] = target['expr'].replace('${' + name + ':json}', '".*"').replace('$' + name, '*') + target['expr'] = target['expr'].replace('${' + name + ':json}', '".*"').replace('$' + name, '.*') result = request('/api/ds/query', {'from': str(start or int((time.time()-3600)*1000)), 'to': str(end or int(time.time()*1000)), 'queries': [target]})['results'][target['refId']] assert not result.get('error'), (panel['title'], result.get('error'))