community.grafana icon indicating copy to clipboard operation
community.grafana copied to clipboard

Plugin Datasources aren't possible

Open rockaut opened this issue 5 years ago • 5 comments

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

rockaut avatar Aug 11 '20 07:08 rockaut

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.

rockaut avatar Aug 13 '20 09:08 rockaut

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 avatar Aug 18 '20 09:08 michaelpearce-gain

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

michaelpearce-gain avatar Aug 18 '20 09:08 michaelpearce-gain

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

michaelamattes avatar Aug 18 '21 06:08 michaelamattes

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.

keithf4 avatar Jun 24 '24 18:06 keithf4