Auto-refresh behaviour on slow requests

Hello Grafana community, I’m currently struggling with the following problem and would request some helpful pointers.

Suppose that:

  • we have a plugin where every call to query triggers a this.backendSrv.datasourceRequest HTTP request that takes 8 seconds to complete (the server is slow in responding)
  • our Auto-Refresh is set to 5 seconds.

I’m using sync function query and this.backendSrv.datasourceRequest and currently I get the behaviour that the auto-refresh will trigger every 5 seconds without fail. This leads to cases where many unfinished requests are pilling up.

Is there a way to make the auto-refresh only trigger after a previous requests has successfully finished?

There’s no mechanism to prevent this situation directly in grafana and your datasource should handle this case internallty. for example you could implement your own debouncing mechanism in your datasource.

1 Like