question-mark

Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong current value on graph or table but correct in query inspector

See original GitHub issue

Issue Description

Hello, 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: Selection_086

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: Selection_087

Selection_088

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:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
Slachcommented, May 11, 2020

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 optional

0reactions
kirikcommented, May 11, 2020

Thank you @Slach for explanation! And yes I think too that this behavior should be optional (or off by default) because it produce wrong numbers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Value and graph mismatch - Grafana Community
I am using Graph but the current value (which is the correct value) is higher than what is displayed on the graph.
Read more >
Time Series: different values/timestamps in table view ... - GitHub
Grafana displays the data correctly in the table and in the query inspector with the correct time zone settings. In the graph view,...
Read more >
Wrong data on the chart - Microsoft Power BI Community
On the chart this column is showed by date and every value from the column of Power query is divided on 2 on...
Read more >
SQL query in Grafana is not showing results in graph
To do this, at the bottom of the query by Format as select Table , then in Visualization select Table . In addition,...
Read more >
Why My Values are Not Showing Correctly in Power BI?
Values that Exists Only in One Table. When you get a value which you can only fetch from one table, there is no...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found