meln5674 / grafana-mongodb-community-plugin

Open Source Grafana Plugin for querying MongoDB
GNU Affero General Public License v3.0
130 stars 17 forks source link

Not able to use Grafana variable in the collection field #31

Closed BbBaboo42 closed 6 months ago

BbBaboo42 commented 6 months ago

I created a grafana variable named collection. In my panel I tried putting $collection in the collection field but it does not work. From inspecting the query it seems like it takes it as is (i.e "$collection"). What can I do?

This works: image

But this do not: image

Grafana v10.3.1 Plugin version: 0.2.0

BbBaboo42 commented 6 months ago

I also tried ${collection} but it did not work either

meln5674 commented 6 months ago

The collection and database name fields currently don't support variables. I will look into supporting this later this week.

BbBaboo42 commented 6 months ago

Wow if you could do it that will be so amazing! It will make my dashboards extremely powerful! Thank you very much!

meln5674 commented 6 months ago

Please try v0.2.0+rc5 which now supports variables in the database and collection fields.

BbBaboo42 commented 6 months ago

OMG Thank you it works perfectly!