-
Notifications
You must be signed in to change notification settings - Fork 68
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
Not possible to use the "auto" interval #528
Comments
If it wasn't for the requirement of overriding the interval, I would suggest using the time interval macros:
I think it would be useful to have the |
Does the |
The suggested macro would allow queries to use Grafana intervals by converting it to the ClickHouse syntax. |
use i added materialized views with time-aggregated data by different time slices. to change the table suffix according my time interval i added extra query vars that calculate best time-aggregated table and minutes per datapoint for different sizes of visualizations. maybe it could be done with better way (recently i noticed 'interval' variable type in dashboard, but not yet played with it)
minutesInSlice1of4 query var
visualization query example
btw, nested select is ok due to very small amount of data |
I think the function is a simpler workaround for now, it would be easy to add the suggested macro. That is a good note on the timeframes though, since it can be hard to find the start of calendar weeks/months |
I checked the ClickHouse dashboard "ClickHouse - Query Analysis", which are automatically displayed in Grafana after installing the Clickhouse plugin, and as it turned out - the interval is already working, and there is also a compact filter by time.
And "Min interval" in "Query options" works too |
Yep! We have a macro for this. See the first response in this thread. This issue is related to the user wanting to override the interval, and needing a function to convert Grafana syntax to ClickHouse syntax |
I couldn't figure out how to achieve this, hope I haven't missed something obvious 😅
What happened:
I want to use the "auto" interval option in Grafana so that the interval adjusts itself, but I also want the user to be able to to override it by selecting an interval.
What you expected to happen:
The auto interval should be be compatible with the Clickhouse interval format.
How to reproduce it (as minimally and precisely as possible):
Configure an "interval" variable and pass it to any query, e.g.
Since the interval format in Grafana isn't compatible with Clickhouse this fails (e.g. Grafana passes in
1m
):It was fairly simple to work around this using a Clickhouse function:
But it would be great if the plugin had a macro for this so you could write something like:
Environment:
The text was updated successfully, but these errors were encountered: