Ways to connect mongodb to grafana
Asked Answered
D

3

19

My question is different ways to connect mongodb with grafana

Link for reference ?

Depurative answered 11/9, 2017 at 11:0 Comment(5)
Are looking for a way to monitor MongoDB stats or your MongoDB datas ?Haft
nope , i need to visualize an time series data in mongo dbDepurative
Do you mean connect mongodb as a datasource in Grafana? Because the provided link is a kind of node-exporter for Prometheus. In this case the datasource is Prometheus not mongodb...Seclusive
yes i need to connect the mongodb as data source for grafana . Right we are connecting mongo through simple json plugin but its creating redundancy and processing is slowDepurative
There's also a new MongoDB data source plugin for paid Grafana: grafana.com/grafana/plugins/grafana-mongodb-datasourceMandell
H
8

Try using MongoDB datasource for Grafana

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

enter image description here Source

Horrified answered 23/8, 2018 at 9:52 Comment(0)
C
5

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

Coronation answered 13/10, 2017 at 14:55 Comment(1)
Yes ,i have used second option. we have tweaked the plugin code. we retrieve data from mongodb and pass it as json format to simplejson .Depurative
R
0

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.

Rochellerochemont answered 5/5, 2024 at 4:35 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.