Provisioning a datasource from an app

We are using Grafana in a way where we provision all of our data-sources and dashboards upon launch using the excellent Provisioning service. This ensures that we can have a very stateless Docker image which is exactly what we’re looking for.

But, we’ve run into a bit of a snag: We want to use the Zabbix integration (http://docs.grafana-zabbix.org). This integration is bundled as a application with a data-source, panel-type etc.

It’s quite easy to use GF_INSTALL_PLUGINS to automate the installation of the integration upon launch. Where it becomes more complicated is in the provisioning of the datasource itself.

This is because application has to be enabled before the datasource becomes available – and as far as I can see, there’s currently no way of ensuring this happens on start-up, so that I can later provision both an instance of the datasource and dashboards that uses this datasource.

Is there any way to automate the enabling of an application, so that I can provision instances of the data-source it provides? Or is there any other way to programatically, upon start-up, enable a application?

There’s some attempts at using the API to programatically enable the app on https://github.com/alexanderzobnin/grafana-zabbix/issues/398 – but that requires Grafana to be fully launched and listening on it’s web-port. And then I don’t think there is a way to use provisioning to instantiate the data-source – right?

Kind regards
Morten

No that is currently not possible

Okay – do you know if that’s something that’s on the roadmap, or if there’s even an issue to follow?

I might try to take a stab at creating this, since it would be very nice to be able to provision apps and their provided datasources.

No it’s not on the roadmap

If I can figure out how to create a PR, is there any chance of it making it in?

As I see it, there are two ways to achieve it: Either a new grafana-cli command to enable apps (like there is to install apps/plugins), or using the provisioning yaml-files – do you have a guess which one has the highest chance of being accepted?

If you’re ok going the API route, I think you should be able to also provision datasources via the API after enabling the plugin (http://docs.grafana.org/http_api/data_source/#create-data-source)

Yeah, I think that’ll end up being a (temporary?) work-around until it’s possible to either use the CLI to enable before launching Grafana, or until you can use the provisioning YAML-files to do it as part of the Grafana-launch provisioning.