-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
97895: kvserver: add stack history to trace of slow requests r=andreimatei a=dt First commit is #97829. This uses the new tracing.MaybeRecordStackHistory helper to add any recorded history of the request evaluation's stack to the trace before returning the result (success or error) if the request is considered to have been 'slow'. A new setting controls how slow a request must be to trigger a search for the history of its stack, and that history is only available if and at the granularity controlled by trace.snapshot.rate setting. A history of the stack can be particularly useful when a request returns an error caused by a timeout or context cancellation, as often by the time such a request is returning, it is no longer at the same point where it spent all the time that caused it to be so slow. Instead, this patch in conjunction with the tracer's snapshotting facility allows asking 'what was i doing all that time?' and having the tracer answer, even if the code asking was doing work that was not directly instrumented to make itself visible in traces. Example statement bundle trace, after sprinkling some sleeps in pkg/storage code (trimmed for brevity): <img width="1529" alt="Screenshot 2023-03-01 at 9 13 32 PM" src="https://user-images.githubusercontent.com/15615/222313217-af508bd0-67e4-4fe6-9fae-d18b924e74f5.png"> Release note (ops change): the setting kv.slow_requests.trace_stack_history.threshold can be used to attach available stack history from tracer snapshots to the trace of slow requests. Epic: none. Co-authored-by: David Taylor <[email protected]>
- Loading branch information
Showing
5 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters