azure-data-explorer-datasource icon indicating copy to clipboard operation
azure-data-explorer-datasource copied to clipboard

ADX Data Source doesn't produce appropriate Key/Value pairs when used as a variable

Open MSDkuznetsov opened this issue 2 years ago • 2 comments

I am able to reproduce the following case.

  1. If I use "Custom" Variable type = CORRECT

image

shows up like:

Val = ${adxdsDeploymentModels2} Text = ${adxdsDeploymentModels2:text} Text = ${adxdsDeploymentModels2:cccc} Value = ${adxdsDeploymentModels2:value} Value = ${adxdsDeploymentModels2:Value}

image

  1. If I use Azure Monitor Data Source CORRECT:

image

Shows as :

image

AM

Val = ${amdsDeploymentModels3} Text = ${amdsDeploymentModels3:text} Text = ${amdsDeploymentModels3:cccc} Value = ${amdsDeploymentModels3:value} Value = ${amdsDeploymentModels3:Value}

However, if I use ADX data source for this, then it doesn't work !

image

Shows as :


ADX

Val = ${adxdsDeploymentModels3} Text = ${adxdsDeploymentModels3:text} Text = ${adxdsDeploymentModels3:cccc} Value = ${adxdsDeploymentModels3:value} Value = ${adxdsDeploymentModels3:Value}

image

What happened:

The ADX Data source here , doesn't extract value from Key/Value pair like other data sources do.

What you expected to happen:

Should work like other mentioned data sources, when data query results returns columns "text","value", these should be returned as key/value pairs.

How to reproduce it (as minimally and precisely as possible):

  1. Go to variables on a dashboard
  2. Select ADX data source for the Query variable
  3. Either make a query against real data or use datatable like this:
let data = datatable(text:string, value:string)
[
    "node1","A",
    "node2","B",
    "node3","C"
];
data
  1. Read variable text and value from any panel. Key/Value pairs can't be extracted. Only the "first" column will be returned always.

Environment:

  • Grafana version: v9.4.12
  • Plugin version: don't know
  • OS Grafana is installed on: Azure Managed Grafana

MSDkuznetsov avatar Jun 13 '23 10:06 MSDkuznetsov

I can reproduce this in 9.4.12 and on main. Essentially creating a variable using datatable KQL results in a variable where the key is sent even if you explicitly set ${query0:value} in your query.

asimpson avatar Jun 16 '23 20:06 asimpson