I just installed Grafana 6.7.3 on Windows Server 2008r2, and want to use it to visualize data in a PostgreSQL 12.2 database (on same Windows Server) .
I have a table with this structure:
CREATE TABLE eventsrun ( datetimestamp timestamp with time zone, amplitude integer, runtimeabs integer, runtime interval, deltainterval interval );
A line of the CSV data that was imported into the table looks like this:
"2010-06-23 18:33:29+0000","1926","1122","7.96 seconds ","04 hours 10 minutes 50 seconds"
When I create a query for a Grafana panel, the Select field offers two choices for column: amplitude, and runtimeabs. I understand why datetimestamp would not be offered since it is the X-Axis.
However, for this data, runtime and deltainterval are values that vary with each event, and need to be plotted.
How can I override the default treatment as the time axis, and move them out of the Time column and into the Select column?
Edit: I tried the query text edit mode and edited the query to force the time interval deltainterval into the column:
SELECT datetimestamp AS "time", deltainterval FROM eventsrun WHERE $__timeFilter(datetimestamp) ORDER BY 1
This still doesn’t work. I get the error
Value column must have numeric datatype, column: deltainterval type: string value: 17:54:11
It appears that Grafana is interpreting the SQL data type of interval as a string value?
How can I present this data as a duration? The values range from 30 seconds to weeks.
I could potentially change the table to make deltainterval an integer of type seconds, but then how would Grafana be able to display in a human readable form? I would like to plot the deltainterval on a logarithmic axis of seconds, minutes, hours, days. Is that possible?