Reputation: 219
My question is different ways to connect mongodb
with grafana
Upvotes: 20
Views: 37409
Reputation: 21
There are 2 options.
Grafana Cloud
: use the mongoDB official plugin from here. However it requires a Grafana enterprise license.
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
Reputation: 2869
Try using MongoDB datasource for Grafana
It should allow you to hook up your MongoDB data source just fine...
Upvotes: 9
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