Skip to content
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

Support for subsecond intervals #344

Closed
oplehto opened this issue May 5, 2021 · 4 comments
Closed

Support for subsecond intervals #344

oplehto opened this issue May 5, 2021 · 4 comments
Assignees
Milestone

Comments

@oplehto
Copy link

oplehto commented May 5, 2021

It seems that it's not possible to have sub-second precision on graphs. This looks like it's due to a hard limit of 1 second for the $timeSeries macro:
https://github.com/Vertamedia/clickhouse-grafana/blob/2f2d2e164848ac0c54d745ab8d7ec301dc2c948a/src/sql_query.ts#L530-L532

A workaround is to use $__interval_ms instead of $interval. For example:

(intDiv(toFloat64("_time") * 1000, $__interval_ms) * $__interval_ms) AS t,

Adding support for $interval to be < 1 would be handy but it might have some side-effects I didn't check for. Thus it may make more sense to change the $timeSeries to use $__interval_ms here:

https://github.com/Vertamedia/clickhouse-grafana/blob/2f2d2e164848ac0c54d745ab8d7ec301dc2c948a/src/sql_query.ts#L467

@Slach
Copy link
Collaborator

Slach commented May 5, 2021

I think we can apply $__interval_ms

@Slach Slach self-assigned this May 5, 2021
@Slach
Copy link
Collaborator

Slach commented Nov 29, 2021

@oplehto you can't select subsecond interval from grafana itself in range queries widget, so i not sure how it can be applicable
image

currently we implements $timeFilter64ByColumn which will release on 2.4.0

@Slach Slach added this to the 2.5.0 milestone Nov 29, 2021
@Slach
Copy link
Collaborator

Slach commented Nov 29, 2021

@oplehto could you provide more use-cases for your proposal?

@oplehto
Copy link
Author

oplehto commented Feb 23, 2022

@Slach It is possible to zoom into sub-second data ranges and we have data that has sub-second intervals. I don't understand what would

Others seem to have this issue as well #398

@Slach Slach closed this as completed in 961a0e0 Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants