Hi Pratik,
Thanks for your questions, my answers in-line below:
- 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:
- 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
- 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.
- 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