ansible-collections / community.grafana

Grafana Collection for Ansible
http://galaxy.ansible.com/community/grafana
GNU General Public License v3.0
131 stars 83 forks source link

Plugin Datasources aren't possible #114

Open rockaut opened 4 years ago

rockaut commented 4 years ago
SUMMARY

Currently the possible datasources are hardcoded so ds from plugins like camptocamp-prometheus-alertmanager-datasource aren't possible.

ISSUE TYPE
COMPONENT NAME

grafana_datasource

rockaut commented 4 years ago

Possible solution:

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.

michaelpearce-gain commented 4 years ago

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.

michaelpearce-gain commented 4 years ago

{ "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 }

michaelamattes commented 3 years ago

I would create a PR to implement json generic api plugin usage. Please let me know if this would supported from your side ?

keithf4 commented 4 months ago

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.