JamesOsgood / mongodb-grafana

MongoDB plugin for Grafana
MIT License
468 stars 213 forks source link

Cannot get plugin to show up in grafana after installation #120

Open guitargod32 opened 3 years ago

guitargod32 commented 3 years ago

Running rhel 7 and the latest version of grafana, using the command line I installed the package in the plugins folder, ran npm install, got the mongodb server running, and it still does not show up as an option for data sources. Am I missing something obvious or does this plugin not work with grafana 8.1.0?

Thanks

kidharb commented 3 years ago

I got the same and fixed it by mounting by docker volume as below

-v ./plugins/mongodb-grafana/src:/var/lib/grafana/plugins:z

I then go the "unsigned plugin" message in Grafana which you can fix with by setting an environment variable as follows

GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=grafana-mongodb-datasource

But then I got an error in Grafana

Unable to dynamically transpile ES module A loader plugin needs to be configured viaSystemJS.config({ transpiler: 'transpiler-module' }). Instantiating http://zadsdcrapp1435:3000/public/plugins/grafana-mongodb-datasource/module.js Loading plugins/grafana-mongodb-datasource/module

Anyway my full docker command is below

sudo docker run --name grafana -v ./plugins/mongodb-grafana/src:/var/lib/grafana/plugins:z --rm -p 3000:3000 -e GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=grafana-mongodb-datasource grafana/grafana

yvangarc commented 3 years ago

The same error after selecting MongoDB datasource: Unable to dynamically transpile ES module A loader plugin needs to be configured via SystemJS.config({ transpiler: 'transpiler-module' }).

Any idea how to solve It?

mrherman commented 3 years ago

I got the same and fixed it by mounting by docker volume as below

-v ./plugins/mongodb-grafana/src:/var/lib/grafana/plugins:z

I then go the "unsigned plugin" message in Grafana which you can fix with by setting an environment variable as follows

GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=grafana-mongodb-datasource

But then I got an error in Grafana

Unable to dynamically transpile ES module A loader plugin needs to be configured viaSystemJS.config({ transpiler: 'transpiler-module' }). Instantiating http://zadsdcrapp1435:3000/public/plugins/grafana-mongodb-datasource/module.js Loading plugins/grafana-mongodb-datasource/module

Anyway my full docker command is below

sudo docker run --name grafana -v ./plugins/mongodb-grafana/src:/var/lib/grafana/plugins:z --rm -p 3000:3000 -e GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=grafana-mongodb-datasource grafana/grafana

Following your instructions I don't see an error message about the transpile (maybe I am not looking in the right spot), but I also don't get any thing in the settings panel when I go to add mongodb-grafana as a data source (see picture). Do you get the same thing there?

Looking at the plugin page for mongodb-grafana on the grafana hosted site, it seems to be a mix of the official mongodb for enterprise users and this plugin (for example it shows all the versions for the enterprise edition but instructions for this external plugin). I wonder if that is causing an issue (but if it was wouldn't others be having the same issue?)

image

My Dockerfile:

FROM grafana/grafana

USER root

RUN apk update && \
    apk upgrade && \
    apk add --no-cache npm && \ 
    wget https://github.com/JamesOsgood/mongodb-grafana/archive/master.tar.gz -O - | tar xz -C $GF_PATHS_PLUGINS && \
    cd  $GF_PATHS_PLUGINS/mongodb-grafana-master && \
    npm install --silent && \
    npm cache clean --force && \
     echo "finished"

USER grafana

ENTRYPOINT ["/bin/sh", "-c" , "npm run server --prefix $GF_PATHS_PLUGINS/mongodb-grafana-master & /run.sh"]
sagarpandav commented 2 years ago

I have tried using the same with docker stack on the ubuntu server. This issue seems to be with the newer versions of grafana images. However, for me, this plugin is working with grafana version 7.1.5. Furthermore, I have checked with more latest versions one by one on the stable release of grafana and for up to Version 8.3.0, this plugin is working without any error as before.

You can check below in the screenshot, Select button is available in version 8.3.0 image