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

Query Option "Relative time" and "Time shift" not working #79

Open
PhilippSchultze opened this issue Mar 25, 2022 · 2 comments
Open

Query Option "Relative time" and "Time shift" not working #79

PhilippSchultze opened this issue Mar 25, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@PhilippSchultze
Copy link

Describe the bug
I want to show data from yesterday in a stats panel. If I use "relative time" or "time shift" option, both are ignored.
It doesn't matter what I try to insert in the two fields

Expected behavior
The options have an impact on the GraphQL query.

Screenshots
image

@PhilippSchultze PhilippSchultze added the bug Something isn't working label Mar 25, 2022
@retzkek
Copy link
Contributor

retzkek commented Mar 28, 2022

Apparently this is a feature/limitation of the $__from and $__to variables, they are globally scoped to the dashboard (see grafana/grafana#38954). There are still the older datasource-specific $timeFrom and $timeTo variables that we deprecated, which should still work and may include the panel adjustments, but they are epoch timestamps only (see #10, which was closed with the recommendation to use the global variables).

So we'll need to look again at providing a datasource-specific macro for configurable timestamps.

@PhilippSchultze
Copy link
Author

Thank you for your answer.
In addition, I have tested the behavior with the PostgreSQL data source.
The PostgreSQL plugin uses a time filter macro in the where part of the query:
image

The dashboard uses the global time scope, but you can add a time shift to a single panel to show an other time.
With this feature, you can for example show the data from today (selected with the global dashboard range) in addition with a panel in the dashboard, that shows the data from yesterday.

I would really appreciate this feature for the GraphQL data source plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants