You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a question regarding STH / temporal API and visualization with Grafana. When I use STH instead of QL+Subscriptions there is another table structure in Time-Series-Database that is not very self-descriptive.
QL+Subscriptions
For QL + subscriptions table structure and queries for time series data are documented very well (see here): We will have to use table 'et', time column 'time_index' and metric column 'entity_type' for example. I tested the scenario successfully and had no issues with that.
STH
When I want to visualize data with Grafana using STH it is more complicated as the data from temporal API is spreaded across different tables (I guess due to performance reasons). I also attached a picture of table design for Scorpio, but the issue with complex table design is quite similar when I try to use Orion-LD context broker.
I can successfully query data using temporal API e.g. with Scorpio:
But due to the table design I can't find the entity 'Animal' or attribute e.g. 'heartrate' anywhere in the postgres table design. I also attached table content as csv from most promising table names (entitiy, temporalentity and temporalentityattrinstance), but it just includes buildings and farms.
Question
Could you assist how data can be queried from time-series-database when I use Grafana instead of temporal API? Where are the entities and their temporal data stored in case of STH?
The text was updated successfully, but these errors were encountered:
Okay I think I got it - There will be used different databases for different tenants in postgres. So relevant data from farm tutorial will be in database ngb<tenant-name> instead of database ngb. So I have been able to find all relevant data in database names 'ngbopeniot'.
There you can find all temporal data in the two tables temporalentity and temporalentityattrinstance in case of Scorpio.
In order to visualize your data with Grafana you will need to:
connect to correct tenant db (here: nbgopeniot)
Perform a query where you
Select observedat, temporalentity_id and value
Filter by kind of entites you want to visualize (here for example pig014 and only non-empty values)
SELECT
observedat AS "time",
temporalentity_id AS metric,
value
FROM temporalentityattrinstance
WHERE
$__timeFilter(observedat) AND
temporalentity_id = 'urn:ngsi-ld:Animal:pig014' AND
value = value
ORDER BY 1,2
Add a transformation to the query so that the value field will be converted to a numeric field (otherwise this field is String by default and can't be visualized by Grafana as a graph [just table])
I have a question regarding STH / temporal API and visualization with Grafana. When I use STH instead of QL+Subscriptions there is another table structure in Time-Series-Database that is not very self-descriptive.
QL+Subscriptions
For QL + subscriptions table structure and queries for time series data are documented very well (see here): We will have to use table 'et', time column 'time_index' and metric column 'entity_type' for example. I tested the scenario successfully and had no issues with that.
STH
When I want to visualize data with Grafana using STH it is more complicated as the data from temporal API is spreaded across different tables (I guess due to performance reasons). I also attached a picture of table design for Scorpio, but the issue with complex table design is quite similar when I try to use Orion-LD context broker.
I can successfully query data using temporal API e.g. with Scorpio:
Response:
But due to the table design I can't find the entity 'Animal' or attribute e.g. 'heartrate' anywhere in the postgres table design. I also attached table content as csv from most promising table names (entitiy, temporalentity and temporalentityattrinstance), but it just includes buildings and farms.
Question
Could you assist how data can be queried from time-series-database when I use Grafana instead of temporal API? Where are the entities and their temporal data stored in case of STH?
The text was updated successfully, but these errors were encountered: