Hi all. We’re currently able to query our Timescale database for metrics and they show up correctly in the table. See below.
SELECT to_timestamp(start_time / 1000000.0 ) AS "time",
(
CASE
WHEN value >= lag(value) OVER w
THEN value - lag(value) OVER w
WHEN lag(value) OVER w IS NULL THEN NULL
ELSE value
END
) AS "requests"
FROM metricstable
WHERE to_timestamp(start_time / 1000000.0) > NOW() - INTERVAL '1 day'
WINDOW w AS (ORDER BY start_time)
ORDER BY start_time;
Resulting table:
However, this data is not displaying on Grafana:
How can I configure Grafana or tweak my SQL query to make it work with Grafana? This is to display the requests per time interval given.
Edit to add: whether the first line of the SQL statement is as is or as SELECT start_time AS "time"
does not alter the results in Grafana.
Thanks!