Git Product home page Git Product logo

Comments (6)

hagen1778 avatar hagen1778 commented on June 11, 2024

Hi @fr05t1k
Series Overrides in Grafana allows to change only visual aspects, but not time range. I guess, there is misleading value for alias or regex in example.

If you are looking for time shifting - plz take a look on time range tab

from clickhouse-grafana.

fr05t1k avatar fr05t1k commented on June 11, 2024

Hi @hagen1778
As I understand Time range allow to shift all metrics. I'm trying to do smth like this

from clickhouse-grafana.

fr05t1k avatar fr05t1k commented on June 11, 2024

I got it. Seems like he has 2 metrics which are shifted manually

from clickhouse-grafana.

fr05t1k avatar fr05t1k commented on June 11, 2024

But when I do smth like this

SELECT
    $timeSeries as t,
    count() as users
FROM $table
WHERE 
  registeredDate BETWEEN toDate($from - 3600 * 24 * 30) and toDate($to - 3600 * 24 * 30) and 
  registeredAt BETWEEN toDateTime($from - 3600 * 24 * 30) and toDateTime($to - 3600 * 24 * 30) 
GROUP BY t
ORDER BY t

The data becomes outside of time range.

from clickhouse-grafana.

hagen1778 avatar hagen1778 commented on June 11, 2024

You will also need to override $timeSeries as following:

SELECT
   (intDiv(toUInt32(registeredAt + 3600 * 24 * 30), 3600) * 3600) * 1000 as t,
    count() as users
....

When Grafana provides $from and $to values, it also adjusts the panel for that timerange. So when you querying the data with timestamps that are outside of Grafana's timerange it would be impossible to display them. So you need to fake those timestamps.

Another option is Grafana's time shifting where it will be done automatically

from clickhouse-grafana.

fr05t1k avatar fr05t1k commented on June 11, 2024

Yes. That's what I need. Thanks ;)

from clickhouse-grafana.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.