Query DeviceChain telemetry from SQL and BI tools
DeviceChain stores telemetry in TimescaleDB, which is PostgreSQL, so there is nothing to export. Any tool that speaks Postgres or JDBC can query your telemetry directly: Metabase, Grafana, Power BI through the PostgreSQL or ODBC driver, psql, a notebook, or your own reporting job. There is no second data store to keep in sync.
A read role that is safe to hand out
The platform's own database credentials would give a BI tool every tenant's data and write access to the operational store, so the analytics surface exists so you never hand those out. A reader is a PostgreSQL login role named analytics_ followed by the tenant id. The tenant is taken from the role name, so a role for one tenant reads that tenant's analytics rows and nothing else.
The analytics views
Readers connect to the event store and query the analytics schema. It holds one view per event relation: the base event envelope, named numeric measurements with unit and data type, per-minute rollups of sum, minimum, maximum and count per device and metric, device-reported alerts, the connect and disconnect timeline, and the relationship anchors stamped on each event when it was written.
Positions are in a separate view that needs its own grant. The rollup is usually the one to start with, because it is already bucketed and cheap to scan over long ranges, and it keeps the current bucket live.
The tenant boundary
Every view is filtered to the reader's own tenant automatically. The views carry a tenant_id column, but you never need to filter on it, there is no view to pick per tenant, and nothing a query can do widens the result. Applications that need more than reporting use the GraphQL API instead.
What it does not do.
- The surface is created on every install but has no readers until you declare one.
- The views are read-only analytics views. They are not a way to write telemetry.