- What Grafana version and what operating system are you using?
v9.3.2, Linux
I am using the “Infinity” data source plugin to fetch records from my mongoDB database in the form of JSON objects, returned through REST API URLs
I want to visualize these in the form of self-updating timelines, using the “State Timelines” visual.
Here is a list of sample records:
[
{
"incidentName": "ES Economizer Inlet FW Temperature low",
"priority": "warning",
"startTime": "2022-11-04T16:53:00.000Z",
"endTime": "2022-11-05T14:06:00.000Z",
"systemName": [
"Pcfb"
],
"id": "6364ffb851a8a70007086acf"
},
{
"incidentName": "ES PFBC Furnace Pressure high",
"priority": "danger",
"startTime": "2022-11-04T17:35:00.000Z",
"endTime": "2022-11-05T14:06:00.000Z",
"systemName": [
"Pcfb"
],
"id": "636505253f5cc20006bcfc76"
},
{
"incidentName": "ES Furnace Pressure abnormal",
"priority": "warning",
"startTime": "2022-11-04T17:34:00.000Z",
"endTime": "2022-11-08T18:32:00.000Z",
"systemName": [
"Pcfb"
],
"id": "6365061e3f5cc20006bcfc90"
},
{
"incidentName": "Unit Performance not healthy",
"priority": "warning",
"startTime": "2023-06-11T21:58:00.000Z",
"systemName": [
"Unit Performance"
],
"id": "6485f8c770bd1400070a2013"
},
{
"incidentName": "Generator System not healthy",
"priority": "warning",
"startTime": "2023-06-11T22:04:00.000Z",
"systemName": [
"Generator System"
],
"id": "64860d3070bd1400070a20a6"
}
]
As you can see, the records contain two fields that are strings containing the “startTime” and “endTime”. Each records needs to be its own timeline. But the “state timelines” expects data in a long format rather than wide format. I tried using the Group to Matrix transformation, and got somewhat close to what I need - but, there are records where the “endTime” itself is missing and that causes the timelines to become incorrect.
- Did you follow any online instructions? If so, what is the URL?
State Timeline schema - #11 by sgammma