Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MSDkuznetsov opened this issue Jun 13, 2023 · 1 comment
Labels

Comments

@MSDkuznetsov
Copy link

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
@asimpson
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

3 participants