You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered an issue where Grafana exhibits inconsistent behavior when generating queries for ClickHouse using the $__timeFilter macro. The same panel occasionally produces different underlying queries for ClickHouse, which I will refer to as Result 1 and Result 2. This is a problem because Result 1 doesn't return any records, while Result 2 does. Am I missing something or is this a bug?
Query
select count(visit_result) as "Total Visits", count(distinct person_name) as "Total Persons"
from visits
where $__timeFilter(visit_timestamp)
Result 1
select count(visit_result) as "Total Visits", count(distinct person_name) as "Total Persons"
from visits
where visit_timestamp >= toDateTime64(1701417600000/1000, 3) AND visit_timestamp <= toDateTime64(1704095999000/1000, 3)
Result 2
select count(visit_result) as "Total Visits", count(distinct person_name) as "Total Persons"
from visits
where visit_timestamp >= '1701417600' AND visit_timestamp <= '1704095999'
Environment:
Grafana version: Grafana v10.1.1 (0cfa76b22d)
ClickHouse Plugin version: 3.3.0
ClickHouse DB version: 20.3.11.97
The text was updated successfully, but these errors were encountered:
Result 1 looks like a query that would've been generated from version 4.0.0, but result 2 looks like it's from 3.3.0. Could you provide more details on the setup?
For example, is this a query from 3.x that you're opening in 4.x? Are there different datasources being used on this dashboard? How did you update the plugin (if at all)? Did you edit an existing panel, or copy the query into a new one?
Version 4.0.3 is available, and fixes how $__timeFilter works. Now there's 2 separate macros, $__timeFilter and $__timeFilter_ms. The first one will cast the dashboard time range to a DateTime while the latter casts to DateTime64.
I've encountered an issue where Grafana exhibits inconsistent behavior when generating queries for ClickHouse using the
$__timeFilter
macro. The same panel occasionally produces different underlying queries for ClickHouse, which I will refer to as Result 1 and Result 2. This is a problem because Result 1 doesn't return any records, while Result 2 does. Am I missing something or is this a bug?Query
Result 1
Result 2
Environment:
The text was updated successfully, but these errors were encountered: