Hi,
I have several query variables that I use to filter content. Until Grafana 7, everything was working just fine. I decided to try Grafana 11 Enterprise. I successfully imported my dashboard into Grafana 11 using a small Python script. After making a few adjustments, I managed to get the basic functionality working.
All variables (both custom and query ones) are functioning correctly in the browser, but they are not being submitted to any panel on the page. Below is the JSON submitted to the backend. Notice the scopedVars
section, which does not include any user-defined variables.
{
“request”: {
“url”: “api/datasources/proxy/uid/be6poyxr3vym8e/query”,
“data”: {
“app”: “dashboard”,
“requestId”: “SQR103”,
“timezone”: “browser”,
“range”: {
“from”: “2024-09-19T00:37:31.955Z”,
“to”: “2024-12-18T00:37:31.955Z”,
“raw”: {
“from”: “now-90d”,
“to”: “now”
}
},
“interval”: “2h”,
“intervalMs”: 7200000,
“targets”: [
{
“data”: {
“version”: “1.08”,
“query_id”: “fe6b33a6-5fc5-4d6a-913f-d70eda7f6ad3”,
“ttl”: “60000”
},
“datasource”: {
“type”: “simpod-json-datasource”,
“uid”: “be6poyxr3vym8e”
},
“hide”: false,
“refId”: “A”,
“target”: “Anomalias”,
“type”: “table”
}
],
“maxDataPoints”: 974,
“scopedVars”: {
“undefined”: {
“text”: “?”,
“value”: “?”
},
“__sceneObject”: {
“text”: “__sceneObject”
},
“__interval”: {
“text”: “2h”,
“value”: “2h”
},
“__interval_ms”: {
“text”: “7200000”,
“value”: 7200000
}
},
“startTime”: 1734482286223,
“rangeRaw”: {
“from”: “now-90d”,
“to”: “now”
},
“dashboardUID”: “HHnqEbemz”,
“panelId”: 10,
“panelPluginId”: “table”,
“scopes”: ,
“adhocFilters”: ,
“endTime”: 1734482291748
},
“method”: “POST”,
“withCredentials”: false,
“hideFromInspector”: false
},
“response”: [
{
“columns”: [
{
“text”: “Conta”,
“type”: “string”
},
{
“text”: “accid”,
“type”: “string”
},
{
“text”: “Data Anterior”,
“type”: “date”
},
{
“text”: “Data Anomalia”,
“type”: “date”
},
{
“text”: “Custo Anterior”,
“type”: “double”
},
{
“text”: “Custo Atual”,
“type”: “double”
},
{
“text”: “Var_Mensal”,
“type”: “double”
},
{
“text”: “Variação”,
“type”: “double”
}
],
“rows”: ,
“type”: “table”
}
]
}
Here is the JSON template:
{
“annotations”: {
“list”: [
{
“builtIn”: 1,
“datasource”: {
“type”: “datasource”,
“uid”: “grafana”
},
“enable”: true,
“hide”: true,
“iconColor”: “rgba(0, 211, 255, 1)”,
“name”: “Annotations & Alerts”,
“type”: “dashboard”
}
]
},
“editable”: true,
“fiscalYearStartMonth”: 0,
“graphTooltip”: 0,
“id”: 225,
“links”: ,
“panels”: [
{
“description”: “”,
“fieldConfig”: {
“defaults”: {},
“overrides”:
},
“gridPos”: {
“h”: 2,
“w”: 24,
“x”: 0,
“y”: 0
},
“id”: 8,
“options”: {
“code”: {
“language”: “plaintext”,
“showLineNumbers”: false,
“showMiniMap”: false
},
“content”: “\n\n\n<div class="divTable darkTable">\n<div class="divTableBody">\n<div class="divTableRow">\n<div class="divTableCell"><div id="divAccountGroup">\n\n\n”,
“mode”: “html”
},
“pluginVersion”: “11.4.0”,
“title”: “”,
“transparent”: true,
“type”: “text”
},
{
“datasource”: {
“type”: “simpod-json-datasource”,
“uid”: “be6poyxr3vym8e”
},
“description”: “Os custos de todos os painéis de anomalias diárias apenas levam em conta os custos de usage. Não incluem reservas, taxas, suporte, entre outros\n”,
“fieldConfig”: {
“defaults”: {
“color”: {
“mode”: “thresholds”
},
“custom”: {
“align”: “auto”,
“cellOptions”: {
“type”: “auto”
},
“filterable”: false,
“inspect”: false
},
“mappings”: ,
“thresholds”: {
“mode”: “absolute”,
“steps”: [
{
“color”: “green”,
“value”: null
},
{
“color”: “red”,
“value”: 80
}
]
}
},
“overrides”: [
{
“matcher”: {
“id”: “byName”,
“options”: “Var_Mensal”
},
“properties”: [
{
“id”: “unit”,
“value”: “time: DD-MM-YYYY”
},
{
“id”: “displayName”,
“value”: “Projeção mensal”
},
{
“id”: “custom.align”
},
{
“id”: “custom.width”,
“value”: 116
},
{
“id”: “custom.align”
},
{
“id”: “custom.width”,
“value”: 103
}
]
},
{
“matcher”: {
“id”: “byName”,
“options”: “Custo Anomalia”
},
“properties”: [
{
“id”: “unit”,
“value”: “currencyUSD”
},
{
“id”: “decimals”,
“value”: 2
},
{
“id”: “custom.align”
}
]
},
{
“matcher”: {
“id”: “byRegexp”,
“options”: “/Custo*/”
},
“properties”: [
{
“id”: “unit”,
“value”: “currencyUSD”
},
{
“id”: “decimals”,
“value”: 2
},
{
“id”: “custom.align”
}
]
},
{
“matcher”: {
“id”: “byName”,
“options”: “Data Anomalia”
},
“properties”: [
{
“id”: “unit”,
“value”: “short”
},
{
“id”: “decimals”,
“value”: 2
},
{
“id”: “unit”,
“value”: “time: DD-MM-YYYY”
},
{
“id”: “links”,
“value”: [
{
“targetBlank”: false,
“title”: “”,
“url”: “/d/clvJekgZk/anomalias-diarias-motivos-da-anomalia?orgId=1&var-targetDate=${__cell:raw}&var-targetAccount=${__cell_1:raw}&var-accountGroup=$accountGroup”
}
]
},
{
“id”: “custom.align”
},
{
“id”: “custom.width”,
“value”: 162
}
]
},
{
“matcher”: {
“id”: “byName”,
“options”: “Variação”
},
“properties”: [
{
“id”: “unit”,
“value”: “percentunit”
},
{
“id”: “thresholds”,
“value”: {
“mode”: “absolute”,
“steps”: [
{
“color”: “#56A64B”,
“value”: null
},
{
“color”: “semi-dark-orange”,
“value”: 0.51
},
{
“color”: “#E02F44”,
“value”: 1
}
]
}
},
{
“id”: “custom.cellOptions”,
“value”: {
“mode”: “gradient”,
“type”: “color-background”
}
},
{
“id”: “custom.align”
},
{
“id”: “custom.width”,
“value”: 77
}
]
},
{
“matcher”: {
“id”: “byName”,
“options”: “Var_Mensal”
},
“properties”: [
{
“id”: “unit”,
“value”: “currencyUSD”
},
{
“id”: “decimals”,
“value”: 2
}
]
},
{
“matcher”: {
“id”: “byName”,
“options”: “accid”
},
“properties”: [
{
“id”: “custom.width”,
“value”: 119
}
]
},
{
“matcher”: {
“id”: “byName”,
“options”: “Custo Anterior”
},
“properties”: [
{
“id”: “custom.width”,
“value”: 108
}
]
},
{
“matcher”: {
“id”: “byName”,
“options”: “Custo Atual”
},
“properties”: [
{
“id”: “custom.width”,
“value”: 102
}
]
},
{
“matcher”: {
“id”: “byName”,
“options”: “Variação mensal”
},
“properties”: [
{
“id”: “custom.width”,
“value”: 154
}
]
},
{
“matcher”: {
“id”: “byName”,
“options”: “Data Anterior”
},
“properties”: [
{
“id”: “custom.width”,
“value”: 103
}
]
},
{
“matcher”: {
“id”: “byName”,
“options”: “accid”
},
“properties”: [
{
“id”: “displayName”,
“value”: “Número da Conta”
}
]
},
{
“matcher”: {
“id”: “byName”,
“options”: “Número da Conta”
},
“properties”: [
{
“id”: “custom.width”,
“value”: 125
}
]
}
]
},
“gridPos”: {
“h”: 12,
“w”: 16,
“x”: 0,
“y”: 2
},
“id”: 10,
“options”: {
“cellHeight”: “sm”,
“footer”: {
“countRows”: false,
“fields”: “”,
“reducer”: [
“sum”
],
“show”: false
},
“showHeader”: true,
“sortBy”:
},
“pluginVersion”: “11.4.0”,
“targets”: [
{
“data”: “{\n "version": "1.08",\n "query_id": "fe6b33a6-5fc5-4d6a-913f-d70eda7f6ad3",\n "ttl": "60000"}”,
“datasource”: {
“type”: “simpod-json-datasource”,
“uid”: “be6poyxr3vym8e”
},
“hide”: false,
“refId”: “A”,
“target”: “Anomalias”,
“type”: “table”
}
],
“title”: “Lista de Anomalias”,
“transformations”: [
{
“id”: “merge”,
“options”: {
“reducers”:
}
}
],
“type”: “table”
},
{
“datasource”: {
“type”: “simpod-json-datasource”,
“uid”: “be6poyxr3vym8e”
},
“fieldConfig”: {
“defaults”: {},
“overrides”:
},
“gridPos”: {
“h”: 12,
“w”: 8,
“x”: 16,
“y”: 2
},
“id”: 12,
“options”: {
“alertThreshold”: true
},
“pluginVersion”: “11.4.0”,
“targets”: [
{
“data”: “{\n "version": "1.08",\n "query_id": "7c5d25b0-1855-45a7-9342-d0426fdb4a58",\n "ttl": "60000"}”,
“datasource”: {
“type”: “simpod-json-datasource”,
“uid”: “be6poyxr3vym8e”
},
“hide”: false,
“refId”: “B”,
“target”: “Custos por dia”,
“type”: “timeseries”
},
{
“data”: “{\n "version": "1.08",\n "query_id": "d3614bdd-0bf1-46ff-ae55-92826efb03fd",\n "ttl": "60000"}”,
“datasource”: {
“type”: “simpod-json-datasource”,
“uid”: “be6poyxr3vym8e”
},
“hide”: false,
“refId”: “A”,
“target”: “Anomalias”,
“type”: “timeseries”
}
],
“title”: “”,
“type”: “graph”
},
{
“datasource”: {
“type”: “simpod-json-datasource”,
“uid”: “be6poyxr3vym8e”
},
“description”: “Anomalias de serviços independente do valor total da conta”,
“fieldConfig”: {
“defaults”: {
“custom”: {
“align”: “auto”,
“cellOptions”: {
“type”: “auto”
},
“filterable”: false,
“inspect”: false
},
“mappings”: ,
“thresholds”: {
“mode”: “absolute”,
“steps”: [
{
“color”: “green”,
“value”: null
},
{
“color”: “red”,
“value”: 80
}
]
}
},
“overrides”: [
{
“matcher”: {
“id”: “byName”,
“options”: “Projeção mensal”
},
“properties”: [
{
“id”: “unit”,
“value”: “currencyUSD”
},
{
“id”: “decimals”,
“value”: 2
}
]
},
{
“matcher”: {
“id”: “byName”,
“options”: “Custo Ant”
},
“properties”: [
{
“id”: “unit”,
“value”: “currencyUSD”
},
{
“id”: “decimals”,
“value”: 2
}
]
},
{
“matcher”: {
“id”: “byName”,
“options”: “Custo Atual”
},
“properties”: [
{
“id”: “unit”,
“value”: “currencyUSD”
},
{
“id”: “decimals”,
“value”: 2
}
]
},
{
“matcher”: {
“id”: “byName”,
“options”: “Data Anterior”
},
“properties”: [
{
“id”: “unit”,
“value”: “date: DD-MM-YYYY”
}
]
},
{
“matcher”: {
“id”: “byName”,
“options”: “Data Anomalia”
},
“properties”: [
{
“id”: “unit”,
“value”: “date: DD-MM-YYYY”
}
]
},
{
“matcher”: {
“id”: “byName”,
“options”: “%”
},
“properties”: [
{
“id”: “color”,
“value”: {
“mode”: “thresholds”
}
},
{
“id”: “thresholds”,
“value”: {
“mode”: “absolute”,
“steps”: [
{
“color”: “green”,
“value”: null
},
{
“color”: “semi-dark-orange”,
“value”: 50
},
{
“color”: “red”,
“value”: 100
}
]
}
},
{
“id”: “unit”,
“value”: “percent”
},
{
“id”: “custom.cellOptions”,
“value”: {
“mode”: “gradient”,
“type”: “color-background”
}
}
]
}
]
},
“gridPos”: {
“h”: 9,
“w”: 24,
“x”: 0,
“y”: 14
},
“id”: 23,
“options”: {
“cellHeight”: “sm”,
“footer”: {
“countRows”: false,
“fields”: “”,
“reducer”: [
“sum”
],
“show”: false
},
“showHeader”: true
},
“pluginVersion”: “11.4.0”,
“targets”: [
{
“data”: “{\n "version": "1.08",\n "query_id": "bbbf4779-22aa-42ee-8f81-07af49cf8675-1634833931273",\n "ttl": "36012"}”,
“datasource”: {
“type”: “simpod-json-datasource”,
“uid”: “be6poyxr3vym8e”
},
“hide”: false,
“refId”: “A”,
“target”: “Anomalias”,
“type”: “table”
}
],
“title”: “Anomalias de Serviços”,
“transformations”: [
{
“id”: “organize”,
“options”: {
“excludeByName”: {},
“indexByName”: {},
“renameByName”: {
“Conta”: “”,
“Service”: “Serviço”,
“Var_Mensal”: “Projeção mensal”,
“accid”: “Número da conta”
}
}
}
],
“type”: “table”
}
],
“preload”: false,
“refresh”: false,
“schemaVersion”: 40,
“tags”: [
“anomalias”
],
“templating”: {
“list”: [
{
“current”: {
“text”: “@all”,
“value”: “@all”
},
“hide”: 2,
“label”: “Contas”,
“name”: “accountGroup”,
“options”: ,
“query”: “$accountGroup”,
“type”: “custom”
},
{
“allValue”: “$__all”,
“current”: {
“text”: “All”,
“value”: [
“$__all”
]
},
“datasource”: {
“type”: “simpod-json-datasource”,
“uid”: “be6poyxr3vym8e”
},
“definition”: “command=query|d8f226a4-51d4-4e69-8304-93e0018ce62e|vars|accountGroup=$accountGroup|target=some value”,
“includeAll”: true,
“label”: “Sub-Conta”,
“multi”: true,
“name”: “S_account_name”,
“options”: ,
“query”: {
“format”: “string”,
“query”: “command=query|d8f226a4-51d4-4e69-8304-93e0018ce62e|vars|accountGroup=$accountGroup|target=some value”
},
“refresh”: 1,
“regex”: “”,
“type”: “query”
},
{
“allValue”: “$__all”,
“current”: {
“text”: “All”,
“value”: [
“$__all”
]
},
“datasource”: “Athena Data Source V2.0”,
“definition”: “command=query|348c6524-17c0-450f-ae04-a3bf609bf605|vars|accountGroup=$accountGroup|target=some value”,
“includeAll”: true,
“label”: “Grupo”,
“multi”: true,
“name”: “S_grupo”,
“options”: ,
“query”: “command=query|348c6524-17c0-450f-ae04-a3bf609bf605|vars|accountGroup=$accountGroup|target=some value”,
“refresh”: 1,
“regex”: “”,
“type”: “query”
},
{
“current”: {
“text”: “?”,
“value”: “?”
},
“description”: “”,
“hide”: 2,
“name”: “target”,
“options”: ,
“query”: “$target”,
“type”: “custom”
}
]
},
“time”: {
“from”: “now-90d”,
“to”: “now”
},
“timepicker”: {
“refresh_intervals”: [
“1d”
]
},
“timezone”: “browser”,
“title”: “Anomalias Diárias”,
“uid”: “HHnqEbemz”,
“version”: 90,
“weekStart”: “”
}
Any Ideias of what is going on?