1

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.

Andrew
  • 81
  • 1
  • 9

2 Answers2

2

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

Andrew
  • 81
  • 1
  • 9
  • Thank you for this I was banging my head against a wall because I didn't include it in both plugins and datasources! – saranicole Mar 13 '23 at 14:00
0

I made some progress by discovering I could get onto the pod running grafana using:

  • kubectl exec -it --container grafana prometheus-grafana-5d844b67c6-5p46b -- /bin/sh

The one listed in kubectl get pods was the sidecar.

Then I could run:

  • kubectl exec -it --container grafana prometheus-grafana-5d844b67c6-5p46b -- grafana-cli plugins install camptocamp-prometheus-alertmanager-datasource

which did the required file installation. After deleting and recreating the pod, there is progress

Keen to hear any comments on the approach or better ideas!

Andrew
  • 81
  • 1
  • 9