select labels as metric
, time
, value
from metrics
where name = 'httpjson_metrics_connections_count_count'
and $__timeFilter(time) -- <<<<<<<<-------------------------
and value <> 'NaN'
order by time
https://grafana.com/docs/features/datasources/postgres/#macros