terraformdatasourcekubernetes-helmgrafanakube-prometheus-stack

Installing a custom grafana datasource through helm / terraform


I would like to install the alertmanager datasource (https://grafana.com/grafana/plugins/camptocamp-prometheus-alertmanager-datasource/) to my kube-prometheus-stack installation which is being built using terraform and the helm provider. I cannot work out how to get the plugin files to the node running grafana though.

Using a modified values.yaml and feeding to helm with -f values.yaml (please ignore values):

  additionalDataSources:
  - name: Alertmanager
    editable: false
    type: camptocamp-prometheus-alertmanager-datasource
    url: http://localhost:9093
    version: 1
    access: default
    # optionally
    basicAuth: false
    basicAuthUser:
    basicAuthPassword:

I can see the datasource in grafana but the plugin files do not exist.

Alertmanager visible in list of datasources

However, clicking on the datasource I see

Plugin not found, no installed plugin with that ID

Please note that the grafana pod seems to require a restart to pick up datasource changes as well which I would consider needs fixing at a higher level.


Solution

  • It's actually quite simple to get the files there and I cannot believe I overlooked the simplistic solution. Posting this here in the hope others find it useful.

    In the kube-prometheus-stack, values.yaml file, just override the grafana section as follows:

    grafana:
      .
      .
      .
      plugins:
        - camptocamp-prometheus-alertmanager-datasource
        - grafana-googlesheets-datasource
        - doitintl-bigquery-datasource
        - redis-datasource
        - xginn8-pagerduty-datasource
        - marcusolsson-json-datasource
        - grafana-kubernetes-app
        - yesoreyeram-boomtable-panel
        - savantly-heatmap-panel
        - bessler-pictureit-panel
        - grafana-polystat-panel
        - dalvany-image-panel
        - michaeldmoore-multistat-panel
    
      additionalDataSources:
      - name: Alertmanager
        editable: false
        type: camptocamp-prometheus-alertmanager-datasource
        url: http://prometheus-kube-prometheus-alertmanager.monitoring:9093
        version: 1
        access: default
        # optionally
        basicAuth: false
        basicAuthUser:
        basicAuthPassword:
    
    

    where the name / type of the plugin can be found on the installation instructions on the Grafana Plugins page