community.grafana
community.grafana copied to clipboard
Plugin Datasources aren't possible
SUMMARY
Currently the possible datasources are hardcoded so ds from plugins like camptocamp-prometheus-alertmanager-datasource aren't possible.
ISSUE TYPE
- Feature Idea
COMPONENT NAME
grafana_datasource
Possible solution:
- make ds_type str only
- check if ds_type plugin exists with api ( well, nope: https://community.grafana.com/t/get-installed-plugins-with-api/35083 )
- throw error if not
If it's not possible to get if the datasource type exists currently (at least not without cli access which should be a nogo for this module!) then I would pledge to just create it as provided. If the implement a way we can update the module.
maybe an approach to store the data source config as api exportable json config, much like wizzy does, and is being done for dashboards, this way it becomes very flexible and removes some of the magic from the ansible modue.
As custom and new data sources (jaeger example of unsupported by module) all need different settings, even es 7 does now. As well as new features such as custom http headers. This way maintenance and duplication needed here would be less. Could even support vars in the json, by simply running the json through the template engine, before applying to the grafana api.
{ "orgId": 1, "name": "raintank", "type": "graphite", "typeLogoUrl": "public/app/plugins/datasource/graphite/img/graphite_logo.png", "access": "proxy", "url": "https://tsdb-gw.raintank.io/graphite/", "password": "", "user": "", "database": "", "basicAuth": true, "isDefault": false, "jsonData": {}, "readOnly": false }
I would create a PR to implement json generic api plugin usage. Please let me know if this would supported from your side ?
Any progress on this? We had started using this module but when we were unable to create a Prometheus Alertmanager datasource, it kind of put us at a roadblock.