Details
-
Bug
-
Status: Open
-
Medium
-
Resolution: Unresolved
-
None
-
None
-
Yes
-
Yes
-
C/S Core
Description
An important monitoring metrics for MongoDB is the "oplog window", which is the time between the current oldest document in the capped oplog collection and the latest.
The latest doesn't need to be fetched necessarily - it will be approximately the same as current clock time, and is also reflected in the replset member metrics named "optime".
Can we add a "mongodb_oplog_timestamp_oldest" metric to mongodb_exporter. It would be fetched with it's own query (see below for mongo shell equivalent), which seems a bit extravagant for the sake of one metric but there is a lot of value to DBAs to know where the end of the oplog is.
db.getSiblingDB("local").oplog.rs.find({}, {ts: true}).sort({"ts": 1}).limit(1)
Once the mongodb_exporter has the metric the "Oplog Recovery Window" graph in the MongoDB Replset Summary dashboard should be updated to use it instead of the "mongodb_mongod_replset_oplog_tail_timestamp" metric that was in the older mongodb_exporter. And/or add "mongodb_mongod_replset_oplog_tail_timestamp" as alias metric that appears if compatibility mode is on.