trace: capture the callstack when region_request.SendReq() is called without trace ID#1801
trace: capture the callstack when region_request.SendReq() is called without trace ID#1801tiancaiamao wants to merge 1 commit intotikv:masterfrom
Conversation
…without trace ID Signed-off-by: tiancaiamao <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
|
||
| // If trace ID is not set, it may indicate the caller is not using client-go properly. | ||
| // Print the stack trace to capture all those cases. | ||
| trace.CheckFlightRecorderDumpTrigger(bo.GetCtx(), "dump_trigger.suspicious_event.dev_debug", "send_request_trace_id_missing") |
There was a problem hiding this comment.
This is a dependency of TiDB, which we should try our best to avoid I think.
One possible way I can think of to improve it is to make it something like NullTraceIdHook and let the adapter in TiDB translate it to CheckFlightRecorderDumpTrigger("dump_trigger.suspicious_event.dev_debug", "send_request_trace_id_missing").
If there will be more dump triggers, a more flexible design is needed. Just like how we have client-go categories and its translation to tidb categories.
There was a problem hiding this comment.
This is not a dependency of TiDB, it is a hook just as you described. @ekexium
If TiDB set this function, then the hook is called, otherwise it noop function.
There was a problem hiding this comment.
It's not a code dependency but a knowledge dependency. If we don't go to TiDB code we cannot understand what "dump_trigger.suspicious_event.dev_debug" is.
For pingcap/tidb#64569