Docs Menu

Docs HomeMongoDB Manual


On this page

  • Behavior
  • Access Control
  • Example

Enables free monitoring for standalones and replica sets and returns the free monitoring status.s


To run db.enableFreeMonitoring(), you must have specified --enableFreeMonitoring command-line option or configuration file set to runtime.

Otherwise, you can only enable or disable at startup. See --enableFreeMonitoring command-line option or for details.

The db.enableFreeMonitoring() method is a wrapper around the setFreeMonitoring command.

Once enabled, the free monitoring state remains enabled until explicitly disabled. That is, you do not need to re-enable each time you start the server.

Once enabled, you are provided with a unique URL where you can access your monitored data.

When enabled, the monitored data is uploaded periodically. The monitored data expires after 24 hours. That is, you can only access monitored data that has been uploaded within the past 24 hours.

For the frequency with which data is uploaded, see freeMonitoring.retryIntervalSecs.

When running with access control, the user must have the setFreeMonitoring and checkFreeMonitoringStatus privilege actions on the cluster. That is, a user must have a role that grants the following privilege:

{ resource: { cluster : true }, actions: [ "setFreeMonitoring" , "checkFreeMonitoringStatus"] }

The built-in role clusterMonitor role provides this privilege.

To enable free monitoring, run the following from the mongo shell:


This starts the registration process for free monitoring. The method returns your free monitoring status:

"state" : "enabled",
"message" : "To see your monitoring data, navigate to the unique URL below.\nAnyone you share the URL with will also be able to view this page.\n\n\n\nYou can disable monitoring at any time by running db.disableFreeMonitoring().",
"url" : "",
"userReminder" : "",
"ok" : 1


You can also use db.getFreeMonitoringStatus() any time to check your free monitoring status.


See also:

←  db.disableFreeMonitoring()db.getFreeMonitoringStatus →
Share Feedback
© 2023 MongoDB, Inc.


  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2023 MongoDB, Inc.