Details
-
New Feature
-
Status: Closed
-
Major - P3
-
Resolution: Fixed
-
None
-
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
Description
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
Attachments
Issue Links
- is related to
-
SERVER-59599 Investigate large delays in connection establishment
-
- Closed
-
-
SERVER-71736 Move tracing support lint to clang-tidy
-
- Open
-