grafana / grafana-json-datasource

A data source plugin for loading JSON APIs into Grafana.
Apache License 2.0
270 stars 66 forks source link

A variable can't take another variable's value as a http request parameter if it starts with "1" #413

Open Dize-core opened 8 months ago

Dize-core commented 8 months ago

At some API link (/api) i get JSON like that:

[
  {
    "id": 1,
    "object_name": "value1",
    "field": "text"
  },
  {
    "id": 2,
    "object_name": "value2",
    "field": "text"
  },
  {
    "id": 3,
    "object_name": "value3",
    "field": "text"
  },
  {
    "id": 10,
    "object_name": "value10",
    "field": "text"
  }
]

At (/api?id=1) i'm getting:

{
  "id": 1,
  "object_name": "value1",
  "field": "text"
}

My first variable with JSON API query image image image

So i created a second variable to get field from the array's object I need by his ID image image

And it works but not with objects that have id 1 or 10. When i choose object from list with id=1/10, "field" variable gets whole array (making http request with empty "id" parameter)

UPD: it works with ids 11-19, but not with 1 or 10 and maybe not with 100 e.t.c.