My question is different ways to connect mongodb
with grafana
Try using MongoDB datasource for Grafana
It should allow you to hook up your MongoDB data source just fine...
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
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.
© 2022 - 2025 — McMap. All rights reserved.
mongodb
as a datasource in Grafana? Because the provided link is a kind of node-exporter for Prometheus. In this case the datasource isPrometheus
notmongodb
... – Seclusive