isaozler / grafana-shift-selector

The shift selector allows you to adjust the time range of your grafana dashboard to one specific shift or a range of shifts.
Apache License 2.0
8 stars 6 forks source link

Auto shift selector not working #16

Closed tdekoning93 closed 11 months ago

tdekoning93 commented 1 year ago

Hey,

We wanted to start using the auto shift plugin, hoping it would help with automatically selecting the right shift. It doesn't seem to do that and I have no clue if thats due to us not using it correctly or something else being wrong. It also doesn't seem to change the timeframe even when having the auto refresh set to 5s.

We are still using Grafana 8.5.20. Any help would be appreciated.

image
isaozler commented 1 year ago

Hi Tim,

An ongoing bug in the real-time feature prevents the selector from changing shifts. I will refactor the plugin to solve this issue because a quick fix wasn't doable.

I hope to give updates on this as soon as possible.

tdekoning93 commented 1 year ago

Thanks for the reply. That would be great. Do you have any ETA on this? Don't want to push you, but I saw the last change to the shift selector was 10 months ago, so just curious if it's actively maintained. Then we can switch from your custom unpublished version to this published official one, haha.

isaozler commented 1 year ago

Just published the new version. With the new release v0.1.0 this should be fixed. Once the review of the plugin is done by Grafana you can directly install it from your dashboard, but in the meanwhile you can try it out by downloading and installing the latest release manually.

isaozler commented 1 year ago

@tdekoning93 Eventually refactored the whole codebase 🤣 it took a while to update the plugin. Sorry for that.

I hope this update helps everyone using this plugin. I will try to maintain the plugin more actively.

tdekoning93 commented 1 year ago

Thanks a lot! Will try it out. Big kudos from our side to you.

isaozler commented 1 year ago

Thanks, Tim! Please let me know if you stumble upon issues. The latest version should be released asap as it is reviewed and approved.

G3CK0za commented 1 year ago

Hi @isaozler,

I have tested the plug-in and it does auto-select shifts now. However, if I have auto-refresh set for the dashboard, the plug-in turns it off on shift change. Any idea what could be causing this?

Sourve commented 1 year ago

/src/module.ts file seems to be missing a reference to the refreshInterval variable that is showcased in the README file. This would be added with code similar to below:

.addTextInput({
      category: ['Behavior'],
      path: 'refreshInterval',
      showIf: (c: any) => c.isAutoSelectShift,
      name: 'Custom refresh interval',
      description:
        'Determine a custom dashboard refresh interval. The global refresh interval will overwrite this value',
      defaultValue: '5s',
    })

Not having this option is causing the panel to set the refresh interval to 'false' instead of a specified value. If i am mistaken on how to set the refresh interval please let me know. I have not worked with grafana plugins or compiling them so I cannot currently test if the code segment would fix this issue, I will try to test this if @isaozler doesn't respond.

isaozler commented 1 year ago

Thanks @Sourve I'll check next week if this resolves the issue.

fatbasstard commented 1 year ago

Another interesting thing related to this. It appears the Select group is actually mandatory. Leaving it blank results in the panel not working. Adding the value of the single group and it works

image

isaozler commented 1 year ago

Thanks for pointing out Frank @fatbasstard 🙏 I will add a fallback so it won't break 👍

fatbasstard commented 1 year ago

Any news on the progress @isaozler ? 😄

isaozler commented 1 year ago

Following Monday, I will start working again 😅 🏖️

isaozler commented 1 year ago

Released an update see changelog v0.1.3

isaozler commented 1 year ago

/src/module.ts file seems to be missing a reference to the refreshInterval variable that is showcased in the README file. This would be added with code similar to below:

.addTextInput({
      category: ['Behavior'],
      path: 'refreshInterval',
      showIf: (c: any) => c.isAutoSelectShift,
      name: 'Custom refresh interval',
      description:
        'Determine a custom dashboard refresh interval. The global refresh interval will overwrite this value',
      defaultValue: '5s',
    })

Not having this option is causing the panel to set the refresh interval to 'false' instead of a specified value. If i am mistaken on how to set the refresh interval please let me know. I have not worked with grafana plugins or compiling them so I cannot currently test if the code segment would fix this issue, I will try to test this if @isaozler doesn't respond.

@Sourve : This is done intentionally by Grafana. The refresh rate is automatically discarded when the dashboard has an absolute date range. See https://github.com/grafana/grafana/issues/12105#issuecomment-395137603

I created a workaround so that it's possible to have a refresh rate by selecting the refresh rate from the panel property "Behaviour > Custom refresh interval."

image

DasDepp commented 1 year ago

Hi @isaozler, thank you very much for contributing these nice Grafana Plugin. When there will be the new Grafana Plugin version package available to install it via the Grafana CLI plugin?

isaozler commented 1 year ago

It's currently under review by the Grafana Team; as soon as it's approved, it will be available to install. But you could also install it manually (unsigned) for testing. Usually, the review takes little time.

fatbasstard commented 1 year ago

Takes long, boring 😉

fatbasstard commented 1 year ago

Any news on the Grafana approval @isaozler ?

isaozler commented 1 year ago
image

I will be keeping an eye on this 👍

fatbasstard commented 1 year ago

image

😛

G3CK0za commented 1 year ago

Sad-Pablo-Escobar

fatbasstard commented 1 year ago

Am poking through Grafana support, our contacts at Grafana and everything.. You have a clue what's going on @isaozler ?

isaozler commented 1 year ago

I saw it was pending a new release because there was an issue. I have to submit a fixed version for a new review 😞 I will see if I can submit a new version by tomorrow.

fatbasstard commented 1 year ago

Any updates on the progress @isaozler ?

isaozler commented 1 year ago

👋 @fatbasstard Frank and all who are waiting, I just submitted the latest release for review at Grafana, containing all the fixes addressed by the Grafana Team. I know it took some time, but I'm doing my best to help you guys with this plugin.

image

isaozler commented 12 months ago

The latest release 0.1.4 is published 🙏

tdekoning93 commented 12 months ago

Thanks a lot for your efforts @isaozler