Open hungnt61h opened 1 year ago
@isaozler Could you review my PR https://github.com/isaozler/grafana-shift-selector/pull/39 ? Could we discuss more about this?
The main reason behinding this feature is that I need the shift changes automatically, but the calculation of the time range which the plugin overrides does not work with Prometheus. PromQL cannot limit data between 2 points, one from the past and one from the future. It can only calculate a metric limited by a point in the past and now or 2 points in the past.
There is a problem that when I enabled the Real-time shift auto-select option, the "to" parameter on url was sought to the end time of a shift. That was not really helpful while I was querying PromQL that calculated a sum of data point in a time range like from the start time of the shift till now. To solve this problem, I have modified your code to add a new option like below.
So my query is able to calculate the sum of data points from the start time of a shift till present.
I hope you would approve this feature and guide me how to contribute my work to your plugin. By the way, I would suggest another feature that is adding a shift countdown. It would appear below the shift selector on the same panel.