Grafana Http API

I am using Grafana 8.1.1 and Http API to get a dashboard via dashboard version API.
GET /api/dashboards/id/:dashboardId/versions/:id:

The dashboard is returned, but the response does not contain an attribute “MetricNamespace” for a panel target of type Azure Monitor Datasource.

When using Settings/JsonModel of the dashboard in the UI it is existing.
It seams the GET method omits attributes of the dashboard json model.

Can you please share snippets of those two JSONs, @dirkbollmeyerexterna ?

sure, please find below:

panelui: the json for the panel when inspected via UI

{
“id”: 10,
“gridPos”: {
“h”: 8,
“w”: 12,
“x”: 0,
“y”: 8
},
“type”: “graph”,
“title”: “EventHubMessages 001”,
“thresholds”: ,
“pluginVersion”: “8.1.1”,
“links”: ,
“legend”: {
“alignAsTable”: true,
“avg”: false,
“current”: false,
“max”: false,
“min”: false,
“show”: true,
“total”: false,
“values”: false
},
“aliasColors”: {},
“dashLength”: 10,
“fill”: 1,
“lines”: true,
“linewidth”: 1,
“nullPointMode”: “null”,
“options”: {
“alertThreshold”: true
},
“pointradius”: 2,
“renderer”: “flot”,
“seriesOverrides”: ,
“spaceLength”: 10,
“targets”: [
{
“appInsights”: {
“metricName”: “select”,
“rawQuery”: false,
“rawQueryString”: “”,
“spliton”: “”,
“timeGrainType”: “auto”,
“yaxis”: “”,
“timeGrain”: “auto”,
“timeColumn”: “timestamp”,
“dimension”: [
“none”
]
},
“azureLogAnalytics”: {
“query”: “AzureMetrics\r\n| where Resource in (“removed”)\r\n| where MetricName in (“IncomingMessages”, “OutgoingMessages”)\r\n| summarize Total=sum(Total) by bin(TimeGenerated, 30m), MetricName\r”,
“resultFormat”: “time_series”,
“workspace”: “removed”
},
“azureMonitor”: {
“aggOptions”: [
“None”,
“Average”,
“Minimum”,
“Maximum”,
“Total”,
“Count”
],
“aggregation”: “Total”,
“dimension”: “None”,
“dimensionFilter”: “",
“dimensions”: [
{
“text”: “None”,
“value”: “None”
},
{
“text”: “EntityName”,
“value”: “EntityName”
}
],
“metricDefinition”: “Microsoft.EventHub/namespaces”,
“metricName”: “IncomingMessages”,
“resourceGroup”: “removed”,
“resourceName”: “removed”,
“timeGrain”: “auto”,
“timeGrains”: [
{
“text”: “auto”,
“value”: “auto”
},
{
“text”: “1 minute”,
“value”: “PT1M”
},
{
“text”: “5 minutes”,
“value”: “PT5M”
},
{
“text”: “15 minutes”,
“value”: “PT15M”
},
{
“text”: “30 minutes”,
“value”: “PT30M”
},
{
“text”: “1 hour”,
“value”: “PT1H”
},
{
“text”: “6 hours”,
“value”: “PT6H”
},
{
“text”: “12 hours”,
“value”: “PT12H”
},
{
“text”: “1 day”,
“value”: “P1D”
}
],
“metricNamespace”: “Microsoft.EventHub/namespaces”,
“top”: “10”,
“allowedTimeGrainsMs”: [
60000,
300000,
900000,
1800000,
3600000,
21600000,
43200000,
86400000
],
“dimensionFilters”: []
},
“queryType”: “Azure Monitor”,
“refId”: “A”,
“subscription”: “removed”,
“azureResourceGraph”: {
“resultFormat”: “table”
},
“insightsAnalytics”: {
“query”: “”,
“resultFormat”: “time_series”
},
“subscriptions”: [
“removed”
]
},
{
“appInsights”: {
“metricName”: “select”,
“rawQuery”: false,
“rawQueryString”: “”,
“spliton”: “”,
“timeGrainType”: “auto”,
“yaxis”: “”,
“timeGrain”: “auto”,
“timeColumn”: “timestamp”,
“dimension”: [
“none”
]
},
“azureLogAnalytics”: {
“query”: “AzureMetrics\r\n| where Resource in (“removed”)\r\n| where MetricName in (“IncomingMessages”, “OutgoingMessages”)\r\n| summarize Total=sum(Total) by bin(TimeGenerated, 30m), MetricName\r”,
“resultFormat”: “time_series”,
“workspace”: “removed”
},
“azureMonitor”: {
“aggOptions”: [
“None”,
“Average”,
“Minimum”,
“Maximum”,
“Total”,
“Count”
],
“aggregation”: “Total”,
“dimension”: “None”,
“dimensionFilter”: "
”,
“dimensions”: [
{
“text”: “None”,
“value”: “None”
},
{
“text”: “EntityName”,
“value”: “EntityName”
}
],
“metricDefinition”: “Microsoft.EventHub/namespaces”,
“metricName”: “OutgoingMessages”,
“resourceGroup”: “removed”,
“resourceName”: “removed”,
“timeGrain”: “auto”,
“timeGrains”: [
{
“text”: “auto”,
“value”: “auto”
},
{
“text”: “1 minute”,
“value”: “PT1M”
},
{
“text”: “5 minutes”,
“value”: “PT5M”
},
{
“text”: “15 minutes”,
“value”: “PT15M”
},
{
“text”: “30 minutes”,
“value”: “PT30M”
},
{
“text”: “1 hour”,
“value”: “PT1H”
},
{
“text”: “6 hours”,
“value”: “PT6H”
},
{
“text”: “12 hours”,
“value”: “PT12H”
},
{
“text”: “1 day”,
“value”: “P1D”
}
],
“metricNamespace”: “Microsoft.EventHub/namespaces”,
“top”: “10”,
“allowedTimeGrainsMs”: [
60000,
300000,
900000,
1800000,
3600000,
21600000,
43200000,
86400000
],
“dimensionFilters”:
},
“queryType”: “Azure Monitor”,
“refId”: “B”,
“subscription”: “removed”,
“azureResourceGraph”: {
“resultFormat”: “table”
},
“insightsAnalytics”: {
“query”: “”,
“resultFormat”: “time_series”
},
“subscriptions”: [
“removed”
]
}
],
“timeRegions”: ,
“tooltip”: {
“shared”: true,
“sort”: 0,
“value_type”: “individual”
},
“xaxis”: {
“buckets”: null,
“mode”: “time”,
“name”: null,
“show”: true,
“values”:
},
“yaxes”: [
{
“format”: “short”,
“label”: null,
“logBase”: 1,
“max”: null,
“min”: null,
“show”: true
},
{
“format”: “short”,
“label”: null,
“logBase”: 1,
“max”: null,
“min”: null,
“show”: true
}
],
“yaxis”: {
“align”: false,
“alignLevel”: null
},
“bars”: false,
“dashes”: false,
“fillGradient”: 0,
“hiddenSeries”: false,
“percentage”: false,
“points”: false,
“stack”: false,
“steppedLine”: false,
“timeFrom”: null,
“timeShift”: null,
“datasource”: null
}

panelapi: the json received via API method.

{
“id”: 10,
“gridPos”: {
“h”: 8,
“w”: 12,
“x”: 0,
“y”: 8
},
“type”: “graph”,
“title”: “EventHubMessages 001”,
“thresholds”: ,
“pluginVersion”: “8.1.1”,
“links”: ,
“legend”: {
“alignAsTable”: true,
“avg”: false,
“current”: false,
“max”: false,
“min”: false,
“show”: true,
“total”: false,
“values”: false
},
“aliasColors”: {},
“dashLength”: 10,
“fill”: 1,
“lines”: true,
“linewidth”: 1,
“nullPointMode”: “null”,
“options”: {
“alertThreshold”: true
},
“pointradius”: 2,
“renderer”: “flot”,
“seriesOverrides”: ,
“spaceLength”: 10,
“targets”: [
{
“appInsights”: {
“metricName”: “select”,
“rawQuery”: false,
“rawQueryString”: “”,
“spliton”: “”,
“timeGrainType”: “auto”,
“yaxis”: “”,
“timeGrain”: “auto”,
“timeColumn”: “timestamp”,
“dimension”: [
“none”
]
},
“azureLogAnalytics”: {
“query”: “AzureMetrics\r\n| where Resource in (“removed”)\r\n| where MetricName in (“IncomingMessages”, “OutgoingMessages”)\r\n| summarize Total=sum(Total) by bin(TimeGenerated, 30m), MetricName\r”,
“resultFormat”: “time_series”,
“workspace”: “removed”
},
“azureMonitor”: {
“aggOptions”: [
“None”,
“Average”,
“Minimum”,
“Maximum”,
“Total”,
“Count”
],
“aggregation”: “Total”,
“dimension”: “None”,
“dimensionFilter”: “",
“dimensions”: [
{
“text”: “None”,
“value”: “None”
},
{
“text”: “EntityName”,
“value”: “EntityName”
}
],
“metricDefinition”: “Microsoft.EventHub/namespaces”,
“metricName”: “IncomingMessages”,
“resourceGroup”: “removed”,
“resourceName”: “removed”,
“timeGrain”: “auto”,
“timeGrains”: [
{
“text”: “auto”,
“value”: “auto”
},
{
“text”: “1 minute”,
“value”: “PT1M”
},
{
“text”: “5 minutes”,
“value”: “PT5M”
},
{
“text”: “15 minutes”,
“value”: “PT15M”
},
{
“text”: “30 minutes”,
“value”: “PT30M”
},
{
“text”: “1 hour”,
“value”: “PT1H”
},
{
“text”: “6 hours”,
“value”: “PT6H”
},
{
“text”: “12 hours”,
“value”: “PT12H”
},
{
“text”: “1 day”,
“value”: “P1D”
}
],
“metricNamespace”: “Microsoft.EventHub/namespaces”,
“top”: “10”,
“allowedTimeGrainsMs”: [
60000,
300000,
900000,
1800000,
3600000,
21600000,
43200000,
86400000
],
“dimensionFilters”: []
},
“queryType”: “Azure Monitor”,
“refId”: “A”,
“subscription”: “removed”,
“azureResourceGraph”: {
“resultFormat”: “table”
},
“insightsAnalytics”: {
“query”: “”,
“resultFormat”: “time_series”
},
“subscriptions”: [
“removed”
]
},
{
“appInsights”: {
“metricName”: “select”,
“rawQuery”: false,
“rawQueryString”: “”,
“spliton”: “”,
“timeGrainType”: “auto”,
“yaxis”: “”,
“timeGrain”: “auto”,
“timeColumn”: “timestamp”,
“dimension”: [
“none”
]
},
“azureLogAnalytics”: {
“query”: “AzureMetrics\r\n| where Resource in (“removed”)\r\n| where MetricName in (“IncomingMessages”, “OutgoingMessages”)\r\n| summarize Total=sum(Total) by bin(TimeGenerated, 30m), MetricName\r”,
“resultFormat”: “time_series”,
“workspace”: “removed”
},
“azureMonitor”: {
“aggOptions”: [
“None”,
“Average”,
“Minimum”,
“Maximum”,
“Total”,
“Count”
],
“aggregation”: “Total”,
“dimension”: “None”,
“dimensionFilter”: "
”,
“dimensions”: [
{
“text”: “None”,
“value”: “None”
},
{
“text”: “EntityName”,
“value”: “EntityName”
}
],
“metricDefinition”: “Microsoft.EventHub/namespaces”,
“metricName”: “OutgoingMessages”,
“resourceGroup”: “removed”,
“resourceName”: “removed”,
“timeGrain”: “auto”,
“timeGrains”: [
{
“text”: “auto”,
“value”: “auto”
},
{
“text”: “1 minute”,
“value”: “PT1M”
},
{
“text”: “5 minutes”,
“value”: “PT5M”
},
{
“text”: “15 minutes”,
“value”: “PT15M”
},
{
“text”: “30 minutes”,
“value”: “PT30M”
},
{
“text”: “1 hour”,
“value”: “PT1H”
},
{
“text”: “6 hours”,
“value”: “PT6H”
},
{
“text”: “12 hours”,
“value”: “PT12H”
},
{
“text”: “1 day”,
“value”: “P1D”
}
],
“metricNamespace”: “Microsoft.EventHub/namespaces”,
“top”: “10”,
“allowedTimeGrainsMs”: [
60000,
300000,
900000,
1800000,
3600000,
21600000,
43200000,
86400000
],
“dimensionFilters”:
},
“queryType”: “Azure Monitor”,
“refId”: “B”,
“subscription”: “removed”,
“azureResourceGraph”: {
“resultFormat”: “table”
},
“insightsAnalytics”: {
“query”: “”,
“resultFormat”: “time_series”
},
“subscriptions”: [
“removed”
]
}
],
“timeRegions”: ,
“tooltip”: {
“shared”: true,
“sort”: 0,
“value_type”: “individual”
},
“xaxis”: {
“buckets”: null,
“mode”: “time”,
“name”: null,
“show”: true,
“values”:
},
“yaxes”: [
{
“format”: “short”,
“label”: null,
“logBase”: 1,
“max”: null,
“min”: null,
“show”: true
},
{
“format”: “short”,
“label”: null,
“logBase”: 1,
“max”: null,
“min”: null,
“show”: true
}
],
“yaxis”: {
“align”: false,
“alignLevel”: null
},
“bars”: false,
“dashes”: false,
“fillGradient”: 0,
“hiddenSeries”: false,
“percentage”: false,
“points”: false,
“stack”: false,
“steppedLine”: false,
“timeFrom”: null,
“timeShift”: null,
“datasource”: null
}

You will see that MetricNamespace is only part if panelui
Also Top is not returned.