Infinity plugin: Parse nested array of JSON and create time series out of this

Infinity plugin: Parse nested array of JSON and create time series out of this

{
    "component_test":[
    {
      "swversion": "2.67.0",
      "passed": [
        {
          "testcasename": "test_TestTargetFirst",
          "testcaseexecutiontime": "4.006"
        },
        {
          "testcasename": "test_TestTargetSecond",
          "testcaseexecutiontime": "2.002"
        },
        {
          "testcasename": "test_CapiDbus_diagAsClient",
          "testcaseexecutiontime": "3.241"
        }
      ]
    },
    {
      "swversion": "2.68.0",
      "passed": [
        {
          "testcasename": "test_TestTargetFirst",
          "testcaseexecutiontime": "9.005"
        },
        {
          "testcasename": "test_TestTargetSecond",
          "testcaseexecutiontime": "8.001"
        },
        {
          "testcasename": "test_CapiDbus_diagAsClient",
          "testcaseexecutiontime": "7.273"
        }
      ]
    }
  ]
}

I tried with inifinity data source with UQL type

parse-json | mv-expand “passed_testcases”=“passed” | project “swversion”, “key”=“passed_testcases.testcasename”, “value”=“passed_testcases.testcaseexecutiontime”

Able to display contents but what I want is to display the time series chart like on x-axis “swversion” on y-axis “testcaseexecutiotime” on series testcase name. but here it displayed different. Even in suggestions not able view time series. And when I select timeseries getting “Data is missing in time field”. Can anyone help here.

Hi,

The UQL query didn’t work for me with your data :confused: (getting no data) Can you share data / UQL query that would produce the same output you have?

Also, time series visualization requires you to have one time field and at least one data field. You don’t have any fields of type time, hence lack of suggestions. What do you want to display? What I see from here is either two different data series (version) and three points (test case name) or reverse, but it won’t be time series - could be bar chart (stacked or not) or probably Trend chart

1 Like

might also want to look into jsonata feature of infinity UQL

https://try.jsonata.org/tLOSC_xbn

Hi
I have updated the post now, if the “swversion” is of number then only i am able to view the proper fields. what is data field means [number] ?

And with same UQL query and i have added two more “Transformations” as shown in picture. Able to view the series but here as i converted the field “testcaseexecutiontime” to time field it looks different in the time format along with the considered ms which mentioned in JSON file.
And as the transformation is multiframe on series it is showing along with test case name it is showing “swversion” text as shown in right side of the picture.
Now i need to make it beautiful.

Uploading: internet.png…

timeseries requires something that can be converted into datetime. testcaseexecutiontime is not such a field and cannot be converted to date time as is.

ok. If I want to display average of “testcaseexecutiontime” of latest “swversion” by using same infinity data source is possible?

Want to edit the dashboard page with some text[Like to add description about eh dashboard with some Legend data]? Is it possible with the Grafana OSS on localhost with default admin login.