Due to the MongoDB design issue, described in
PSMDB-752, PMM sees optime on a Secondary which is newer than optime on the Primary. Then, when it calculates slave lag, the lag becomes a negative value and since data for the lag is UNSIGNED INTEGER, it is converted to the maximum UNSIGNED INTEGER value which is then converted to 136 years on the graph. This makes replication lag graphs not usable.
1. Start Replicaset:
2. Enable monitoring:
3. Connect to PRIMARY and run:
4. While loop is in progress connect to SECONDARY, run rs.status() and check values of optime/optimeDate:
5. Once you noticed difference in times go to PMM and notice it reports 136 years of the replication lag.
Convert maximum value for UNSIGNED INTEGER to 0: this slight error is better than huge error of 136 years.
Alternatively use SIGNED INTEGER to store replication lag values.
Implement pt-heartbeat for MongoDB as we have for MySQL