How to check status of mongosh telemetry

Hi MongoDB Community,

In regard to mongosh telemetry, documentation and forums only mention 2 cmds - disableTelemetry() and enableTelemetry(). Can someone kindly help with following info which I was unable to locate anywhere:

  1. Once enabled/disabled, is there a way to check the status ?

2.1. Once enabled/disabled, are we supposed to do that again when we re-login in mongosh ?
2.2. If I have disabled it, what’s the state when my team member logs-in in same database via different machine ? (is it disabled for him as well? or does he need to disable ?)
2.3. If I have disabled it, and when I login again next day. Does it remain disabled ?
2.4. If I have disabled it, when I restart mongod service, then what is the status of telemetry ? (is it enabled again or will it remain disabled ?)

  1. Irrespective of whether I enable/disable telemetry, for some servers I see telemetry message while starting mongosh and for servers, I do. not. How does it work ?

Hi Pratik,

Thanks for your questions, my answers in-line below:

  1. Once enabled/disabled, is there a way to check the status ?

Wanted to clarify what you meant by checking the status?

If you were looking to see if telemetry was enabled, you have two different options:

  1. You can run config.get('enableTelemetry') in mongosh, the reason we have the enableTelemetry() and disableTelemetry() toggles due to them pre-dating the programmatic config access mechanism
  2. You can look at the mongosh config file in the following directory: ~/.mongodb/mongosh/config. You should see a boolean field called enableTelemetry

2.1. Once enabled/disabled, are we supposed to do that again when we re-login in mongosh ?

Once you invoke the enableTelemetry() or disableTelemetry() functions, the config file above will store your preferences locally so you don’t have to toggle it on/off each time you re-login.

2.2. If I have disabled it, what’s the state when my team member logs-in in same database via different machine ? (is it disabled for him as well? or does he need to disable ?)

As mentioned above, the setting is local so it will not affect your teammates using mongosh in a different machine. Their preferences will be stored locally in their machine.

2.3. If I have disabled it, and when I login again next day. Does it remain disabled ?

Since the setting persists in the config file, if you have disabled it, it will remain disabled unless you explicitly toggle it on again.

2.4. If I have disabled it, when I restart mongod service, then what is the status of telemetry ? (is it enabled again or will it remain disabled ?)

Restarting mongod will not affect this setting in mongosh since they are two different binaries/applications.

  1. Irrespective of whether I enable/disable telemetry, for some servers I see telemetry message while starting mongosh and for servers, I do. not. How does it work ?

Where are you seeing a telemetry message? Is it in a log file somewhere?

Finally, mongosh also supports the global config file for disabling telemetry consistently on a given machine. You can read this doc on this here: https://www.mongodb.com/docs/mongodb-shell/reference/configure-shell-settings-global/#configuration-file-location

Thank you so much Gaurab for all these quick answers :slight_smile: :+1:
Most of my queries resolved. In case of further queries (if any), I will ask you.

I will keep this thread open for another 3 days.