Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-59700

Add programming support for tracepoints

    • Fully Compatible
    • Service Arch 2021-11-15, Service Arch 2021-11-22, Service Arch 2021-12-13, Service Arch 2022-1-10, Service Arch 2022-1-24
    • 2

      The aim is to provide a library that allows adding tracepoints to mongo servers. The primary intent for these tracepoints is to collect timing information (e.g., using ServiceContext::getFastClockSource) for an ongoing operation. The tracepoints must compile to a noop by default, unless requested otherwise at compile time.

      The following is a possible/suggested API design for the tracepoints.

      void someFunction() {
          // TracePoint(std::string name, Duration<T> loggingThreshold);
          auto tp = makeTracepoint("MyTracepoint", Milliseconds(100));
          runOperationA();
          tp.checkpoint("Checkpoint 1");
          runOperationB();
      }
      

      When enabled, the tracepoint must collect the timestamp at construction and at each checkpoint, and log the timestamps when the lifetime of the tracepoint object exceeds a threshold.

      For example, if running runOperationA and runOperationB takes more than 100 milliseconds, we expect to see a line similar to the following in mongo logs:

      { "Tracepoint exceeded its expected lifetime" , "attr": {"name": "MyTracepoint", "constructedAt": "timestamp", "destroyedAt": "timestamp", "Checkpoint 1": "timestamp", "expectedLifetimeMS": 100, "observedLifetimeMS": 101} }
      

      Acceptance criteria:

      • For the first pass, someone will do a POC timeboxed at 2 story points to answer some of the open questions

            Assignee:
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Reporter:
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: