-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add macro similar to $rateColumns for counter like metrics #80
Comments
Hi @JiriHorky
Here we have a
Please, note some details:
Please, try this construction with your data. If it fits your need I'll add a new macros into plugin. |
Hi @hagen1778 , This query I want to create should produce a graph of CPU usage of the particular hosts and we want to be able to see the metric for several hosts. After a small adjustment I made it work with Grafana's variable I adjusted the query like this:
Where In ClickHouse we have table
You may notice that we did not receive data from host And here comes the issue:
I will get this:
But if I select just
As you can see in the last row the value we get for Could you please help me with that? Have you got any idea how to get rid of this? I tried to adjust the query for a while but unsuccessfully. In case you need any further info, please ask. |
Hi @MichalNedbalek, I guess I got the idea. Let's introduce updated data:
We see a little time gap for
The following operations:
gives us opportunity to compare values of the same type considering the time gaps. Also, the condition The result of the query could be easily displayed in Grafana, since plugin knows how to behave with null values. Anyway, you still have a possibility to manage the way of displaying the null values on panel: Hope that will help! |
Hi @hagen1778, This works perfectly, thank you very much. :) My final version of the query look like this:
Are going to create the macro for this? If so, I would wait for it, because I want to implement similar queries in some 20+ other graphs and the macro would make everything easier and faster. Thanks a lot. |
Yes, I will implement it. New release will published this week |
Thanks for info |
Hi @MichalNedbalek |
Hi @hagen1778 |
Currently I don't see an easy way to make customizable macros where you will be able to do
In the inner query we need to get max value for column (so it should be just it's name) and in second query apply runningDifference. I'm wondering how should I support passing extra operations here... The both $perSecond and $perSecondColumns are in the master right now. Could you test your queries with that update? |
I have to wait for a colleague who will update our Grafana and I'm going to test it tomorrow. Thanks for the macros. |
Hi @hagen1778 ,
Today we will try to install it to our testing Grafana and test it there. As for the Thanks |
Yep, my fault. Should be fixed now. Could you try it again? |
@MichalNedbalek ping |
Hi @hagen1778, Sorry for the delay and thank you for the fix. I finally got to the testing of your new macros. It looks ok from my point of view and it is perfectly usable (except for the special case higher where I'm gonna use the slightly complicated query because of the So what are the next steps now? Thanks |
Similarly to request in #78, please consider adding support for computing $perSecond for multiple series (hosts).
Currently, the $rateColumns computes something like:
Which does not produce correct results for metrics which only grows over time, as one needs to compute difference between two consequitive values
v
as well (not just time).Unfortunatelly, doing
runningDifference(a.2)/runningDifference(t/1000)
does not work, asa.2
gets materialized to different valuesv
between different columns (host
).I have been scratching my head for a while and I am not sure how to write such query in Clickhouse at all. I hope you know better :)
The text was updated successfully, but these errors were encountered: