Our postgres data source stores data within json blobs, and so the SQL necessary to extract what we want to visualize in Grafana is somewhat complex. We’d prefer not to have to duplicate that complexity in every graph.
What we want to be able to do is present the data to whoever is building the graphs in a simpler form - a simple tabular structure. This can be done in Postgres VIEWs, but we don’t want to bake these into the DB since they are specific to the Grafana work. (Also want to minimize direct DB access
Here is a simplified example of what we want to do:
DEFINE table_view AS ( SELECT json_blob->>time AS time, json_blob->some->deeply->nested->object->var AS var, ... etc FROM table )
So that then in a bunch of graphs we can just do:
SELECT time, var FROM table_view
Is there a way to replicate this type of behavior in Grafana - transforming the data into a simpler form? I see mentions of
variables in the documentation, but none of those seem to create a reusable view of the data that can be shared between graphs.