I’m a beginner to Grafana and databasse and I’m trying to use grafana to chart some data from a Postgresql database.
I’ve set up the datasource OK, but I’m having trouble creating a chart. The data in the database looks like the following (I’ve left off the rest of the columns). The created_at column is a string and I’ve tried to convert it to a datetime in Grafana but I’m really struggling. I basically want to count the number of rows created each day and chart this on a histogram.
|id|created_at| |1|2017-06-15 07:12:07 UTC| |2|2017-06-15 07:12:08 UTC| |3|2017-06-15 07:12:08 UTC|
TO_TIMESTAMP(created_at,‘YYYY-MM-DD HH24:MI:SS’) AS time,
count(created_at) As entry_count
The above query works but groups the entries by the second. I’ve tried using timegroups and have been through the docs. But can’t get this to work. Any idea where I’m going wrong and how I can get this to work?