Wrong current value on graph or table but correct in query inspector
See original GitHub issueHello, My case is really specific but hope that someone could help me.
So in short, i have materialized view with summary information on amount of mailed users of my service. Example:
As i need optional aggregation (by day, week, month, year) - i’m generating timeseries this way:
(intDiv(toUInt32(toStartOfDay(send_time)), 1200) * 1200) * 1000 AS period_day,
(intDiv(toUInt32(toStartOfDay(toStartOfWeek(send_time))), 1200) * 1200) * 1000 AS period_week,
(intDiv(toUInt32(toStartOfDay(toStartOfMonth(send_time))), 1200) * 1200) * 1000 AS period_month,
(intDiv(toUInt32(toStartOfDay(toStartOfYear(send_time))), 1200) * 1200) * 1000 AS period_year
Here is example of query:
SELECT
multiIf('$period_of_aggregation' = 'week', period_week, '$period_of_aggregation' = 'month', period_month,
'$period_of_aggregation' = 'year', period_year, period_day) as t,
sum(sent) as sent
FROM dc.mails_aggregated
WHERE
$timeFilter
AND status = 'sent'
AND dispatch_type in ($dispatch_type)
AND domain in ($domains)
GROUP BY t
ORDER BY t
Issue: point of graph (or line in table) for current day differs value, returned by query inspector if picked timerange is more than 7days, if it’s 7days or less - value is correct.
Example: Table:
If i pick time range 7 days - value for current day becomes correct (105.24 K)
Same behavior is for graph representation.
I tried this on different grafana and CH-plugin versions, including latest. I’m ablre to reproduce this everywhere.
I will be grateful for your thoughts and advice.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top GitHub Comments
value for last N datapoint in
time series
format extrapolated it’s described on FAQ https://github.com/Vertamedia/clickhouse-grafana#faq maybe this behavior should be optionalThank you @Slach for explanation! And yes I think too that this behavior should be optional (or off by default) because it produce wrong numbers.