MongoDB configuration in grafana

How i will integrate my mongoDb to grafan dash board? Can somebody tell me the steps to do that.

Thanks in advance

1 Like

As datasource I did not remember a plugin for it and for Grafana internal data there is no support (only sqlite, postgresql, mysql).

You must code it both.

So basically we have to go for plug in development for mongo DB?

Can we do it through Prometheus data source… by any chance!!! like by using the mongo db exporter n all

AFAIK yes but take a look at Grafana plugins page.

I will have a look to the page. While doing R & D i got this link for the Mongo DB

In this they have mentioned they have integrated the mongo db with Grafana. But not able to figure out how they did. Can you help in that regard.

Hello!

This is a little bit of a tricky question because there are two things you might want to do when integrating MongoDB with Grafana, the Percona dashboards are made for grabbing information about running MongoDB rather than data that is stored in MongoDB (so if you have a users collection in MongoDB, you won’t be able to use their scripts and exporter to see for example the number of users who has logged in during the last 24 hours or whatnot but rather to see for example how many connections you have to the database).

If you want to use Grafana to visualize information about your MongoDB instances, the following steps are generally speaking what you’d like to do (I haven’t tested the exact steps described here, so I’m outlining it very vaguely).

  1. Use something like Percona’s mongodb_exporter (follow the instructions in that repository to set it up next to your MongoDB instances) to fetch the metrics from MongoDB and publishing them in a way that is accessible by Prometheus.
  2. Set up Prometheus and it’s scrape_config to fetch the metrics from your exporter.
  3. Add Prometheus as a data source in Grafana, see the Using Prometheus in Grafana documentation.

On the other hand, if you have data in MongoDB which you’d like to expose to Grafana the answer changes a little, but I’m not aware of any straight forward way of using MongoDB as a datasource directly to Grafana. There is an issue from 2015 where adding MongoDB was proposed where some of the reasoning behind why MongoDB isn’t supported by Grafana is explained, see grafana#3153. If you have a GitHub account, you can add a thumbs up to that issue to show your support for the feature request :slightly_smiling_face:

Another way to go about it would be to use one of the existing data sources and have an export job from your MongoDB database to that data source.

1 Like

Look this

2 Likes

now grafana has started the plugin for mongo db, but not sure if it supports the ops mgr integration