Docs Menu

Docs HomeMongoDB Manual


On this page

  • Access Control
  • Example

New in version 4.0.

Disables free Cloud monitoring.


To run db.disableFreeMonitoring(), 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.disableFreeMonitoring() method is a wrapper around the setFreeMonitoring command.

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

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

The built-in role clusterMonitor role provides this privilege.

To disable free monitoring, run the following in mongosh:


You can use db.getFreeMonitoringStatus() to check your of free monitoring status:


If free monitoring is disabled, the method returns a document similar to:

"state" : "disabled",
"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

Even when disabled, your unique URL is returned so that if you re-enable monitoring at a later time, you can access your previous metrics that has not expired within the past 24 hours.


See also:

←  Free Monitoring Methodsdb.enableFreeMonitoring() →
Share Feedback
© 2023 MongoDB, Inc.


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