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

add support for grafana global builtin-variables #3

Open
lilvinz opened this issue Nov 30, 2018 · 2 comments
Open

add support for grafana global builtin-variables #3

lilvinz opened this issue Nov 30, 2018 · 2 comments

Comments

@lilvinz
Copy link

lilvinz commented Nov 30, 2018

http://docs.grafana.org/reference/templating/#global-built-in-variables

Being able to use $__interval in custom queries would drasically improve query performance when changing the displayed time interval.

@joente
Copy link
Member

joente commented Dec 3, 2018

Did you try to use $__interval in a custom query? My guess is that it should work since the time format matches with the SiriDB time format. (I believe that in Grafana you can click on the "menu" button to edit the raw query)

@lilvinz
Copy link
Author

lilvinz commented Dec 3, 2018

It seems not to be resolved. The query inspector shows $__interval in the request.
Maybe resolving has to be done at the plugin layer?

Or maybe i am misunderstanding basic grafana concepts.

{
  "xhrStatus": "complete",
  "request": {
    "method": "POST",
    "url": "api/datasources/proxy/1/query",
    "data": {
      "query": "select\nmean($__interval)\nfrom\n`test_group`\nbetween 1543856539s and 1543856839s"
    }
  },
  "response": {
    "error": "Internal Server Error",
    "response": "Query error at position 0. Expecting date/time_string, now, single_quote_str, double_quote_str, integer, ( or )\n",
    "message": "Internal Server Error"
  }
}

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