Can't assign field name for dynamically many timeseries using JSON-API-Datasource

Hi everyone!
Via a JSON-API Datasource I receive dynamically many timeseries, each of dynamic length. I’ve been experimenting with various JSON-Path and transformation combinations. I can properly graph the timeseries, but i can’t find a configuration, where the names are also properly assigned to the fields.
Anyone some ideas? Been struggling for quite some time now.

Here some Screenshots:
a) My current config, if only those name values could be assigned to the fields, without breaking the rest


b) The current data frames

c) The incoming data (Could also be adjusted if absolutly necessary)

Even though the requirements feel quite specific, they shouldn’t be that much of a corner case, right?

Thanks so much in advance,
Steffen

Welcome to forum @steffen2303

Please post your sample json here

{
 "foo": "Chocolate Factory"
}
1 Like
{
  "id": "50637c55.GridBuy",
  "name": "Grid Buy",
  "entries": [
    {
      "time": "2024-03-10T23:40:00Z",
      "value": 0
    },
    {
      "time": "2024-03-11T00:00:00Z",
      "value": 0
    }
  ]
}
1 Like

I would recommend you use infinity plugin that allows you to do pivoting

https://grafana.github.io/grafana-infinity-datasource/docs/uql

Or use the grafana transformation of group by matrix

Thanks so much for the quick response!
I believe the transformation of group by matrix does not work here, since for “Cell Value” i can only pick a single field, right?
And in my use-case i’d even need dynamically many.
The example was just simplified data, the use case looks more like this:

If i’m wrong and it could be solved by transformations, that’d be the much prefered solution.

If you provide data without a disclaimer stating that it is simplified data, then hard to help you when you are piece mealing your requirements. Please provide the whole truth and nothing but the whole truth

Simplified data = simplified solution :wink:

Okay sorry for the missunderstanding, i wrote in the text and also in the question itself, that my key requirement is that we’re having dynamically many timeseries.

But i get it, data is more beautiful than words :smiley: It’s an IT thing and it should have especially clear in a data visualization forum.
(Then again, no example data ever would have represented, that the use case is that the example data size is prior unkown)

So, any ideas on how to crack that nut? :slight_smile:

still waiting for data that matches your requirements

I have an array with dynamically many time series objects. Heres are two examples, with 1 and with 2 objects, but it could be any number.

//example with 1 object:
[
{
    "id": "50637c55.GridBuy",
    "name": "Grid Buy",
    "entries": [
      {
        "time": "2024-03-10T23:40:00Z",
        "value": 0
      },
      {
        "time": "2024-03-11T00:00:00Z",
        "value": 0
      }
    ]
  }
  ]
//example with 2 objects:
  [
{
    "id": "50637c55.GridBuy",
    "name": "Grid Buy",
    "entries": [
      {
        "time": "2024-03-10T23:40:00Z",
        "value": 1
      },
      {
        "time": "2024-03-11T00:00:00Z",
        "value": 3
      }
    ]
  },
  {
    "id": "50637c55.GridBuy",
    "name": "Grid Sell",
    "entries": [
      {
        "time": "2024-03-10T23:40:00Z",
        "value": 2
      },
      {
        "time": "2024-03-11T00:00:00Z",
        "value": 4
      }
    ]
  }
  ]