I have a need to provide access to different datasets in influxdb for different users (kind of multi-tenancy)
Most common route without touching Grafana code would be to automatically (via API or plugin) create datasource for each user after oauth log in (I could even provide separate influxdb privileges, received from OAuth attributes). However I would prefer to keep no configuration in Grafana, if possible, that it would be stateless (everything required to use it would be configured automatically via OAuth login procedure)
There are those dynamic template variables, maybe something could be done with them? But I see they are handled in frontend, so IMO its unfeasible to use them in this case because of security.
Another way for my use case would be to somehow extend data proxy - that it would pass dabase linked with user instead of value in datasource. Or write my own data proxy.
Does anyone have good practices while using Grafana in multi-tenant environment? Maybe it is possible to write something that would work for general use case?