cognitedata/cognite-grafana-datasource

Move timeseries out of the queryTarget object

Closed this issue · 2 comments

We currently store all timeseries rooted at an asset in the QueryTarget object. This was fine as that object was only really visible through the JSON section. However, it really should not be there as that object should just be for properties that remain constant between reloads of the page (ie not for storage)

Grafana 6.0.0 also introduces the explore section, which puts the querytarget object in the url, and this can cause issues if we try to store a lot of timeseries.

I forgot that we do actually require the timeseries array for 'Select Timeseries from Asset' so we can't completely remove it...
We may want to look into only storing whether or not a timeseries is selected in the QueryTarget object, that way we can still reduce its size.

We now only keep the timeseries array for 'Select Timeseries from Asset' and no longer in 'Custom Query', and also limit the size of that array. This has been fixed to the point that explore is usable and the QueryTarget object is smaller, so I'm closing this issue.