Rashmi Saravanan
Rashmi Saravanan

Reputation: 219

Ways to connect mongodb to grafana

My question is different ways to connect mongodb with grafana

Link for reference ?

Upvotes: 20

Views: 37409

Answers (3)

wtao nexus5
wtao nexus5

Reputation: 21

There are 2 options.

  1. Grafana Cloud: use the mongoDB official plugin from here. However it requires a Grafana enterprise license.

  2. Grafana on-prem: develop a Grafana data source plugin, and a backend for loading and issuing aggregation queries to a mongoDB driver (because a driver can't be loaded into a web browser). More details below,

James Osgood implemented a solid on-prem solution, mongodb-grafana. It has a GUI plugin to configure mongo connection and collect queries, then a backend to execute the queries by running as a standalone app.

But the code was more than 6 years old; implemented in Angular.js instead of React.js which is mandatory for now; JSON objects for aggregation instead of Javascript objects, which won't support simple queries, such as {_id: ObjectId(xxxxxxxxxxx)}

Using the same on-prem architecture and based on James' implementation, I modernized the plugin in this repo. If you ever use MongoDB Compass for aggregations, you can basically copy/paste a pipeline Node.js export into the plugin.

Upvotes: 1

dvdsmpsn
dvdsmpsn

Reputation: 2869

Try using MongoDB datasource for Grafana

It should allow you to hook up your MongoDB data source just fine...

enter image description here Source

Upvotes: 9

eorochena
eorochena

Reputation: 306

Right now grafana doesn't support MongoDB as a data source Using mongoDB as back-end repository

But they offer a workaround grafana simple json data source

Upvotes: 5

Related Questions