Summary IconKEY TAKEAWAY

Grafana MongoDB integration lets you connect MongoDB as a data source and visualize your data through interactive, real-time dashboards in four steps.

What you need:

  • Grafana 8.0+, MongoDB 5.0+, and Node.js 14.x+
  • Admin access to Grafana and read access to your MongoDB database
  • Ports 3000 and 3333 open on your firewall

Four steps to get started:

  • Step 1: Download and install Grafana
  • Step 2: Install Grafana using the Windows installer
  • Step 3: Download and install MongoDB
  • Step 4: Install the MongoDB plugin and connect it to Grafana as a data source

Once connected you can:

Monitor real-time MongoDB performance metrics including queries per second, active connections, and replication lag

Build custom dashboards and run complex queries directly within Grafana

Need more than visualization? Hevo Data moves MongoDB data into Snowflake, Redshift, or BigQuery automatically with no code and real-time sync out of the box.

MongoDB stores your data. Grafana makes it visual. But getting the two to talk to each other is where most teams get stuck.

With over 60 million downloads and a community of 2 million registered developers, MongoDB is the world’s most popular NoSQL database. Pairing it with Grafana unlocks real-time visibility into your data through interactive dashboards, without complex infrastructure or custom scripts.

This guide walks you through four straightforward steps to set up Grafana MongoDB integration, from installation to a live, queryable dashboard. No prior experience with either tool required.

Simplify MongoDB Data Integration with Hevo

Grafana is great for visualization, but if you need to move your MongoDB data into a warehouse for deeper analytics, Hevo makes it effortless. No scripts, no infrastructure, no maintenance.

  • No engineering backlog: Go from MongoDB to your warehouse in minutes, no scripts, no infrastructure
  • Never miss a change: CDC-based sync captures every insert, update, and delete in real time
  • Self-healing pipelines: Failures resolve automatically with zero data loss and no manual intervention
  • Analytics-ready data: Data lands clean and structured, ready to query from day one

Trusted by 2,000+ data teams. Rated 4.4/5 on G2.

Get Started with Hevo for Free

Prerequisites for Grafana MongoDB Integration

Before you begin, ensure the following are in place:

  • Grafana: Version 8.0 or above. Download from grafana.com
  • MongoDB: Version 4.4 or above, running and accessible on port 27017
  • Node.js: Version 14.x or above with npm installed. Required to run the MongoDB proxy server. Verify with node -v
  • Ports: Grafana runs on port 3000, the MongoDB proxy server on port 3333. Ensure neither is blocked by your firewall

Permissions: Admin access to Grafana and read access to the MongoDB database you want to visualize

Setting Up Grafana MongoDB Integration

Now that you have understood about Grafana, MongoDB, and the need for Grafana MongoDB Plugin connection. In this section, you will learn the steps to set up Grafana MongoDB Integration. The steps will guide you to download and configure Grafana MongoDB and also connect them using the plugin. The following steps for Grafana MongoDB Integration are listed below:

Step 1: Downloading Grafana

  • Visit www.grafana.com. Go to Download Grafana. 
  •  On the next window that appears, choose a Grafana version to install, as shown in the image below.
Grafana MongoDB - Downloading Grafana
  • 3. Choose an Edition.
    • Enterprise – Download is recommended. Operationally identical to the open-source version, but with additional features that can be unlocked with a license if desired.
    • Open Source – Functionally identical to the enterprise version; however, if you want enterprise features, you must download the enterprise version, as shown in the image below.
Grafana MongoDB - Choosing Edition

4.   Select the Operating System you have; for this Grafana MongoDB Integration tutorial, Windows is used.

Step 2: Install with Windows installer 

  • Click Download the installer.
  • Open and click the downloaded file, as shown in the image below.
Grafana MongoDB - downloading file
  • A prompt for the installation wizard will appear. Select the “Next” option.
  • The next window that appears requests your agreement to the license. If you agree, check the box. Then, press the ‘Next‘ button, as shown in the image below.
Grafana MongoDB - Agreeing the terms and condition for Installing Grafana
  • The window that appears will show you the path where your file will be installed in your system, as shown in the image below.
Grafana MongoDB - Customizing the Installation in Grafana
  • Select the ‘Install‘ option.
  • A window similar to this will appear when installing Grafana.
  • Enjoy Grafana by clicking the ‘Finish‘ button.

Step 3: Installing MongoDB

You must first download MongoDB before you can install it. Here are the steps to take.

  • Launch your browser.
  • Go to www.mongodb.com and log in.
  • Once the site is open, select the ‘Product‘ option in the upper left corner of the page.
  • Choose one of the packages that you want to install on your system.
  • After selecting the appropriate package, the screen scrolls to the download option, as shown in the image below.
Grafana MongoDB - Downloading MongoDB
  • Configure the version, platform, and package, then select the download option.
  • MongoDB has now been downloaded to your computer. On your system, open the MongoDB downloaded file. A wizard for installation will appear.
  • Press the next button.
  • Then, check the box indicating that you agree to the terms and conditions. Then press the ‘Next’ button. Another page appears.
  • On the following page, you will see two options. i.e. complete and custom. Select the ‘Complete‘ option to obtain the full version of MongoDB, as shown in the image below.
Grafana MongoDB - Choosing Setup Type
  • A screen shows with the option ‘install mongodb as a service‘. You can change the settings to your liking and then click ‘Next’ button, as shown in the image below.
Grafana MongoDB - Configuring MongoDB Installation Services
  • The following window will prompt you to install MongoDB Compass, the official graphical user interface for MongoDB. Then, press the ‘Next’ button.
  • When you click the install button on the window, a window appears with instructions for installing MongoDB.
  • After installation, press the “Finish” button. MongoDB is now installed and ready to use on your system.

Step 4: Connecting Grafana with MongoDB

The next step is to connect Grafana MongoDB Database using the plugin.

  • Install and start the MongoDB proxy server.
  • Open the command prompt and set the directory to mongodb-grafana directory 
  • Install the node with npm install, dependencies in js.
  • To start the REST API proxy to MongoDB, use npm run server. The server listens on “http://localhost:3333 by default”.
  • Install Grafana MongoDB plugin components on your system.
  • Copy the whole mongodb-grafana dir into the Grafana plugins dir you set while downloading the Grafana.
  • Restart the Grafana server.
  • Open the browser and log in to Grafana using the link – “http://localhost:3000/”.
  • Enter the default username and password i.e. Admin.
  • Select Datasource from the dropdown menu under settings.
  • Use the search dialogue to look for a certain data source by typing its name. Alternatively, you can browse supported data sources by time series, logging, tracing, and other categories.
  • Place your cursor over the data source you wish to add and press Enter.
  • Add the MongoDB data source.

That’s it! You have completed the Grafana MongoDB Integration using the plugin. 

Monitoring Data With Grafana MongoDB Integration

Grafana allows you to create a dashboard by combining SingleStat and Graph panels. The dashboard’s top section illustrates the main status of a hosted Grafana instance:

Grafana MongoDB - Grafana Basic Dashboard Overview
Image Source

The following section shows the OK/CRIT status for each phase of the synthetic process:

Grafana MongoDB - OK and CRIT Section Status
Image Source

In graph form, the final part provides further information:

Grafana MongoDB - Grafana Graphs
Image Source

Visualizing Data With Grafana MongoDB Integration 

We’ll use Grafana to import the MongoDB Overview dashboard in this example. Grafana imports the MongoDB dashboard.

Integrate MongoDB to BigQuery
Integrate MongoDB to Snowflake
Integrate MongoDB to Redshift

Go to http://localhost:3000 to access your Grafana instance. (if no default ports were changed in your configuration file) Drag your cursor over the ‘+‘ icon on the left menu and select Import, as shown in the image below.

Grafana MongoDB - Grafana import dashboard
Image Source

You should then be directed to the Import screen. Select the option to upload a JSON file, as shown in the image below.

Grafana MongoDB - Uploading Data File in Grafana
Image Source

Navigate to the root directory folder (where you saved your dashboard) and double-click the MongoDB Overview.json file, depending on the operating system you’re using.

Your dashboard should always be imported immediately, along with real-time MongoDB Database updates, as shown in the image below.

Grafana MongoDB - Final dashboard
Image Source
Note: You can refer to the official GitHub page for MongoDB plugin for Grafana

What can you achieve by Grafana MongoDB Integration?

  1. Customizable dashboards: Grafana can connect to MongoDB and allow building interactive dashboards with graphs, charts to visualize MongoDB data based on custom queries.
  2. Real-time metrics: Grafana can provide real-time visibility into MongoDB performance metrics like queries per second, active connections, replication lag etc. This allows real-time monitoring.
  3. Usage analytics: By analyzing MongoDB data with Grafana, usage analytics can be done to get insights on database reads/writes, most frequent queries, collection growth etc.
  4. Data analytics: Complex data queries can be written within Grafana to analyze data trends and patterns for analytical applications over MongoDB data.

Learn More About:

Conclusion

Setting up Grafana MongoDB integration gives your team real-time visibility into your MongoDB data through interactive, customizable dashboards. Whether you are monitoring database performance, tracking application metrics, or analyzing usage trends, the combination of MongoDB’s flexible document storage and Grafana’s open-source platform for data visualization, monitoring, and analysis is hard to beat.

But if your goal goes beyond visualization and you need to move MongoDB data into a warehouse like Snowflake, Redshift, or BigQuery for deeper analytics and reporting, doing it manually with custom scripts is time-consuming and fragile.

Hevo makes it simple. Connect MongoDB to your warehouse in minutes with no code, no infrastructure, and no maintenance. Fault-tolerant pipelines handle schema changes, retries, and real-time sync automatically so your team can focus on insights, not pipelines.

Try Hevo free for 14 days →

FAQs

1. How do I install the MongoDB plugin in Grafana? 

You can install the MongoDB plugin directly from within your Grafana instance using the grafana-cli tool by running grafana-cli plugins install grafana-mongodb-datasource. The plugin installs into the default Grafana plugins directory at /var/lib/grafana/plugins. Restart the Grafana server after installation to activate the plugin.

2. What MongoDB version is required for Grafana integration? 

The official Grafana MongoDB data source plugin requires MongoDB version 5.0 or above. Ensure your MongoDB instance is running and accessible on port 27017 before configuring the plugin in Grafana.

3. Can I use Grafana Cloud with MongoDB? 

Yes. Grafana Cloud supports MongoDB integration through the official MongoDB data source plugin. You can connect your MongoDB Atlas instance to Grafana Cloud to collect metrics, monitor deployments, and access pre-built dashboards and alerts without managing your own Grafana infrastructure.

4. What are the limitations of Grafana MongoDB integration?

The Grafana MongoDB plugin only supports aggregate queries, not find queries. All values in a column must be the same data type as Grafana’s data system requires consistent column types. The plugin is also a paid offering for on-premise Grafana Enterprise users, while Grafana Cloud users can access it through their plan.

Syeda Famita Amber
Technical Content Writer, Hevo Data

Syeda is a technical content writer with a profound passion for data. She specializes in crafting insightful content on a broad spectrum of subjects, including data analytics, machine learning, artificial intelligence, big data, and business intelligence. Through her work, Syeda aims to simplify complex concepts and trends for data practitioners, making them accessible and engaging for data professionals.