grafana/grafana-json-datasource

Fields have different Lengths

satyamtpatel opened this issue · 1 comments

Hi,

I am getting fields have different length error with below JSON response

{
"response": [
    {
      "_id": "62837572f71a77a7332dfbe2",
      "systemId": "336",
      "deviceName": "Tapco third Party",
      "groupName": "Central Office",
      "deviceProvider": "Tapco",
      "firmwareName": "test",
      "deviceAlert": [
        {
          "reportedTime": "2023-02-06T22:51:27.544Z",
          "resolutionTime": "2023-02-06T22:56:12.759Z",
          "detectedTime": "2023-02-06T22:51:27.567Z",
          "status": "Communication Error"
        },
        {
          "reportedTime": "2023-02-06T22:51:12.505Z",
          "resolutionTime": "2023-02-06T22:51:27.564Z",
          "detectedTime": "2023-02-06T22:51:12.531Z",
          "status": "Unhealthy"
        },
        {
          "reportedTime": "2023-02-06T22:46:27.633Z",
          "resolutionTime": "2023-02-06T22:51:12.526Z",
          "detectedTime": "2023-02-06T22:46:27.657Z",
          "status": "Communication Error"
        },
        {
          "reportedTime": "2023-02-06T22:46:12.593Z",
          "resolutionTime": "2023-02-06T22:46:27.651Z",
          "detectedTime": "2023-02-06T22:46:12.618Z",
          "status": "Healthy"
        },
        {
          "reportedTime": "2023-02-06T22:41:28.042Z",
          "resolutionTime": "2023-02-06T22:46:12.611Z",
          "detectedTime": "2023-02-06T22:41:28.066Z",
          "status": "Communication Error"
        },
        {
          "reportedTime": "2023-02-06T22:41:13.002Z",
          "resolutionTime": "2023-02-06T22:41:28.062Z",
          "detectedTime": "2023-02-06T22:41:13.027Z",
          "status": "Healthy"
        },
        {
          "reportedTime": "2023-02-06T22:36:27.468Z",
          "resolutionTime": "2023-02-06T22:41:13.021Z",
          "detectedTime": "2023-02-06T22:36:27.493Z",
          "status": "Communication Error"
        },
        {
          "reportedTime": "2023-02-06T22:36:12.428Z",
          "resolutionTime": "2023-02-06T22:36:27.488Z",
          "detectedTime": "2023-02-06T22:36:12.452Z",
          "status": "Healthy"
        },
        {
          "reportedTime": "2023-02-06T22:31:27.453Z",
          "resolutionTime": "2023-02-06T22:36:12.446Z",
          "detectedTime": "2023-02-06T22:31:27.476Z",
          "status": "Communication Error"
        },
        {
          "reportedTime": "2023-02-06T22:31:12.411Z",
          "resolutionTime": "2023-02-06T22:31:27.472Z",
          "detectedTime": "2023-02-06T22:31:12.439Z",
          "status": "Healthy"
        },
        {
          "reportedTime": "2023-02-06T22:26:27.295Z",
          "resolutionTime": "2023-02-06T22:31:12.434Z",
          "detectedTime": "2023-02-06T22:26:27.323Z",
          "status": "Communication Error"
        },
        {
          "reportedTime": "2023-02-06T22:26:12.260Z",
          "resolutionTime": "2023-02-06T22:26:27.319Z",
          "detectedTime": "2023-02-06T22:26:12.282Z",
          "status": "Healthy"
        },
        {
          "reportedTime": "2023-02-06T22:21:27.469Z",
          "resolutionTime": "2023-02-06T22:26:12.276Z",
          "detectedTime": "2023-02-06T22:21:27.491Z",
          "status": "Communication Error"
        },
        {
          "reportedTime": "2023-02-06T22:21:12.433Z",
          "resolutionTime": "2023-02-06T22:21:27.487Z",
          "detectedTime": "2023-02-06T22:21:12.456Z",
          "status": "Healthy"
        },
        {
          "reportedTime": "2023-02-06T22:16:27.256Z",
          "resolutionTime": "2023-02-06T22:21:12.451Z",
          "detectedTime": "2023-02-06T22:16:27.280Z",
          "status": "Communication Error"
        },
        {
          "reportedTime": "2023-02-06T22:16:12.218Z",
          "resolutionTime": "2023-02-06T22:16:27.275Z",
          "detectedTime": "2023-02-06T22:16:12.242Z",
          "status": "Healthy"
        },
        {
          "reportedTime": "2023-02-06T22:11:28.413Z",
          "resolutionTime": "2023-02-06T22:16:12.236Z",
          "detectedTime": "2023-02-06T22:11:28.434Z",
          "status": "Communication Error"
        },
        {
          "reportedTime": "2023-02-06T22:11:13.374Z",
          "resolutionTime": "2023-02-06T22:11:28.430Z",
          "detectedTime": "2023-02-06T22:11:13.399Z",
          "status": "Healthy"
        },
        {
          "reportedTime": "2023-02-06T22:06:27.270Z",
          "resolutionTime": "2023-02-06T22:11:13.394Z",
          "detectedTime": "2023-02-06T22:06:27.292Z",
          "status": "Communication Error"
        },
        {
          "reportedTime": "2023-02-06T22:06:12.233Z",
          "resolutionTime": "2023-02-06T22:06:27.288Z",
          "detectedTime": "2023-02-06T22:06:12.256Z",
          "status": "Healthy"
        },
        {
          "reportedTime": "2023-02-06T22:01:27.491Z",
          "resolutionTime": "2023-02-06T22:06:12.250Z",
          "detectedTime": "2023-02-06T22:01:27.516Z",
          "status": "Communication Error"
        },
        {
          "reportedTime": "2023-02-06T22:01:12.448Z",
          "resolutionTime": "2023-02-06T22:01:27.512Z",
          "detectedTime": "2023-02-06T22:01:12.477Z",
          "status": "Healthy"
        },
        {
          "reportedTime": "2023-02-06T21:56:27.604Z",
          "resolutionTime": "2023-02-06T22:01:12.471Z",
          "detectedTime": "2023-02-06T21:56:27.628Z",
          "status": "Communication Error"
        },
        {
          "reportedTime": "2023-02-06T21:56:12.568Z",
          "resolutionTime": "2023-02-06T21:56:27.624Z",
          "detectedTime": "2023-02-06T21:56:12.590Z",
          "status": "Unhealthy"
        }
      ]
    }
  ]
}

image

By design, all the fields should return same number of fields. In you case first field return 10+ values where the second field return only one value.

Instead, Can you try this with Infinity datasource plugin?

image