-
Notifications
You must be signed in to change notification settings - Fork 33
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
Provide other formats for time ranges #10
Comments
If we were going to support more or arbitrary formats, maybe we should follow the convention Grafana uses for template variables, e.g. |
I definitely like the idea of using the standard way of substituting that Grafana has with stuff like Maybe instead of using a regex to replace the necessary fields, we could use a more standard way. More info here: https://grafana.com/docs/grafana/latest/reference/templating/ I don't think this is too difficult and I don't think it would break any existing queries if we stopped using regex. I assume there's a library function to use like you said. |
Rather embarrassingly I've just been informed by @marcusolsson that there's global variables for the dashboard time range in epoch-millis since 6.0, so we should definitely promote using those, and work with core Grafana to support other formats instead of trying to invent our own. |
So could this issue be renamed to something like "Use standard template variables for everything", since we eventually should stop using regex to replace stuff and use Grafana's way. Or this issue could be closed and we create a new issue. And of course maybe another issue to rewrite examples and default queries. |
I've updated the README. I'm going to leave this issue open since it's pretty important for this datasource, probably moreso than for others. I found an issue requesting time range variables in seconds, I'll chime in there to request ISO8601 (and others) as well.
I've opened #18 for that. |
Good news everyone, this was added in 7.1.2: grafana/grafana#26466 |
Different APIs will expect different time formats, so we need to provide a way to specify the format for
$timeFrom
and$timeTo
. At a minimum there should be a way to get ISO8601 formatted strings. I'm not sure if we need or want to go as far as supporting arbitrary format strings.Maybe just add
$time{From|To}ISO
for now?The text was updated successfully, but these errors were encountered: