- What Grafana version and what operating system are you using?
v8.3.5 -
What are you trying to achieve?
To build time series from JSON formatted data. I would like to use one base table panel with almost “real-time” orders data. I use Infinity plugin for getting the metrics from API. Data is provided by API every 10 minutes which returns JSON . Example JSON:
[
{
"order_id": "US-123",
"store": "USA-1",
"total_amount": "12.25",
"items_ordered": "1",
"timestamp": "1648119600"
},
{
"order_id": "US-235",
"store": "USA-1",
"total_amount": "24.25",
"items_ordered": "2",
"timestamp": "1648119600"
},
{
"order_id": "DE-212",
"store": "Germany-1",
"total_amount": "43.25",
"items_ordered": "2",
"timestamp": "1648634400"
},
{
"order_id": "AT-452",
"store": "Austria-1",
"total_amount": "125.12",
"items_ordered": "5",
"timestamp": "1648641600"
},
{
"order_id": "AT-245",
"store": "Austria-1",
"total_amount": "62.23",
"items_ordered": "3",
"timestamp": "1648641600"
},
{
"order_id": "CA-321",
"store": "Canada-1",
"total_amount": "90.55",
"items_ordered": "3",
"timestamp": "1648846800"
}
]
I would like to use this panel as a parent for all other time series panels like:
hourly order count by stores, hourly order total amount by stores and etc.
-
How are you trying to achieve it?
I successfully created a filled table from API. Now I try to inherit the results in other panel “orders hourly”. In “orders hourly” panel I used “Organize fields”
transformation and hide unnecessary fields for this panel: order_id, total_amount, items_ordered. Also I used “Convert Field Type” transformation to format the timestamp to hourly based format like (YYYY-MM-DD HH). So only “timestamp” and “store” left in the “orders hourly” panel. -
What happened?
I can’t seem to find how to group by “timestamp” AND “store” to have a total orders count by store in each hour. I tried to use “Group By” transformation for timestamp field, and it grouped the timestamp, but I lose the store count information. -
What did you expect to happen?
To have a matrix from timestamp and store. Count orders by store for every hour.
The question can confuse, so please let me know if you need more information.