grafana-discrete-panel icon indicating copy to clipboard operation
grafana-discrete-panel copied to clipboard

support postgres range type (int4range)

Open kdorsel opened this issue 4 years ago • 1 comments

Hi,

I would like to display availability of a resource. I use postgres with int4range rows to show a resource is busy using epoch.

https://www.postgresql.org/docs/11/rangetypes.html

What would it take to display this? Can you point me in the general direction and I can take a look at adding support

kdorsel avatar Mar 16 '20 16:03 kdorsel

I was able to change the postgres query to make this work as is. For future reference

select to_timestamp(lower(sched)) as time, 'metric ' || slot::text as metric, 1 as val
from temp
union
select to_timestamp(upper(sched)) as time, 'metric ' || slot::text as metric, 0 as val
from temp
order by 1

kdorsel avatar Mar 16 '20 20:03 kdorsel