Add change stream cursor-level lag gauges on mongoS (aggregated)

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • QE 2026-07-20, QE 2026-08-03, QE 2026-08-17
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Summary

      Add aggregated change-stream cursor-level lag gauges to $currentOp on mongoS.

      Background

      Design doc: "Design: Extend ChangeStream Metrics", section "Decision: Cursor-Level Change Stream
      Metrics / Lag". These are aggregated from shard responses on every batch, not computed locally on
      the router.

      Scope of Work

      • Add the following gauges, aggregated from shard responses on every batch:
        • changeStreams.oplog.earliestTime.lastBatch.min / .max
        • changeStreams.oplog.latestTime.lastBatch.min / .max
      • Surface these in the slow-query log, per the design doc.

        Acceptance Criteria

      • All five fields appear under $currentOp for active change-stream cursors on mongoS and
        update once per batch based on shard responses.
      • Fields appear in the slow-query log for change-stream cursors on mongoS.
      • Unit/integration test coverage, including multi-shard aggregation cases.

        Related Files

      • src/mongo/s/query/exec/cluster_client_cursor_impl.cpp
      • src/mongo/s/query/exec/cluster_cursor_manager.cpp

            Assignee:
            Cian Nugent McGealy
            Reporter:
            Cian Nugent McGealy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: