mongosync by default writes Open Telemetry (OTel) metrics logs to log files in the /metrics
directory, relative to the location from which the user executes the mongosync binary. The metrics logs automatically rotate with compression to minimize disk usage.
Log to Specific File
To output metrics log messages to a specific file path, start mongosync with the
--metricsLoggingFilepath option or set the metricsLoggingFilepath setting
in the configuration file.
IMPORTANT: If you specify an invalid metricsLoggingFilepath,
mongosync logs metrics at the default path: /metrics.
Disable Metrics Logging
To disable metrics logging, configure the mongosync binary with the --disableMetricsLogging
or set the disableMetricsLogging setting in the configuration file.
WARNING: If you disable metrics logging, MongoDB's ability to diagnose and resolve mongosync
performance-related problems will be significantly reduced.