valiton / grafana-mongodb-atlas-datasource

Grafana Datasource for MongoDB Atlas/Public Cloud Metrics (Process, Database and Disk)
MIT License
48 stars 18 forks source link

Plugin doesn't work on Grafana 8 #44

Closed large-epsilon closed 3 years ago

large-epsilon commented 3 years ago

Describe the bug On grafana 8, the plugin doesn't load correctly.

To Reproduce

  1. Install the plugin on docker (grafana/grafana:8.0.1) via the GF_INSTALL_PLUGINS env variable
  2. Create a mongo atlas data source
  3. hit save & test
  4. observe the green checkmark displayed next to a "plugin is not working" message
  5. have no data
  6. cry

Expected behavior Plugin is saved, works, and data flows freely and bountifully

This may be related to the grafanaVersion string in src/plugin.json, which specifies 7.x.x. The grafana docs say this is deprecated and grafanaDependency should be used instead, probably set to ">=7.0.0"

CapChrisCap commented 3 years ago

Hello @large-epsilon , thank you for your bug report. I can confirm the issue but unfortunately could not resolve the issue quickly because we need to rewrite the whole plugin because it bases on the old Grafana API version 1 (see https://talk.plesk.com/threads/metric-request-error.361053/).

We hope that we can provide a new plugin upgrade soon for Grafana version >= 8.0.0. Until then, we would suggest you to downgrade to version 7.x.x.

Cheers, Christoph

large-epsilon commented 3 years ago

Thanks for looking into this!

CapChrisCap commented 3 years ago

Small update: we are in the last phase of optimisation. The main functionality already works but some features are still WIP like:

image

CapChrisCap commented 3 years ago

Hey @large-epsilon , the first release candidate is finished and can be tested:

docker run -p 3000:3000 \
  -e GF_INSTALL_PLUGINS="https://github.com/valiton/grafana-mongodb-atlas-datasource/releases/download/v3.0.0-rc1/valiton-mongodb-atlas-datasource.zip;valiton-mongodb-atlas-datasource" \
  -e "GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=valiton-mongodbatlas-datasource" \
  grafana/grafana:8.0.0
large-epsilon commented 3 years ago

Ah, thank you! I'll give it a try tomorrow and let you know.

marcogreiveldinger commented 3 years ago

Thanks a lot! At the first sight it is working nicely.

Two things I noticed that the datasource config parameters have changed slighty from atlasPublicKey to publicKey (also for the private) and the plugin does not support alerting yet like the old version did.

Error:

The datasource does not support alerting queries

CapChrisCap commented 3 years ago

Hey @marcogreiveldinger3798 , thank you for your feedback. We moved back the parameter names and enabled the alerting feature again with rc2.

docker run -p 3000:3000 \
  -e GF_INSTALL_PLUGINS="https://github.com/valiton/grafana-mongodb-atlas-datasource/releases/download/v3.0.0-rc2/valiton-mongodb-atlas-datasource.zip;valiton-mongodb-atlas-datasource" \
  -e "GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=valiton-mongodbatlas-datasource" \
  grafana/grafana:8.0.0

Additional feedback is always appreciated :-)

Cheers

marcogreiveldinger commented 3 years ago

Hey @CapChrisCap another thing I noticed (RC1) is that when using the metric Disk Measurement I am only able to chose the dimension data and not a single node from the cluster

grafana

Whereas I can still choose the node at the metric Database and Process Measurement level. Also in the previous version this was possible at the metric Disk Measurement . Did something change here in the plugin or in the metrics API of atlas?

CapChrisCap commented 3 years ago

Hey @marcogreiveldinger3798 , oh, this was really still a bug, thank you for pointing this out. We added again the mongo/node selection field so that we are again compliant with the Data Measurements API.

image

You can access the new fix with

docker run -p 3000:3000 \
  -e GF_INSTALL_PLUGINS="https://github.com/valiton/grafana-mongodb-atlas-datasource/releases/download/v3.0.0-rc3/valiton-mongodb-atlas-datasource.zip;valiton-mongodb-atlas-datasource" \
  -e "GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=valiton-mongodbatlas-datasource" \
  grafana/grafana:8.0.0

Btw: I really appreciate your feedback, this really helps us to get faster feedback and release the version sooner! :-)

marcogreiveldinger commented 3 years ago

Hey @CapChrisCap , you're welcome! As I am constantly using the plugin I am happy to give at least something back :-)

I can confirm that everything is working again as before. The only thing I had to to manually was to 're-apply' the panels as they kinda broke after the upgrade from grafana 7 to 8 in the first update step. But this could also be the case because of that different naming of the parameters.

CapChrisCap commented 3 years ago

New version is released, thanks for your help! :-)

Will close this issue now, feel free to open a new issue when you discover something else 👍