To address the problem that the sampling strategies of existing open-source distributed tracing systems or frameworks collect redundant traces of normal executions that are less helpful to tasks such as fault analysis, we propose a dynamic sampling strategy. With two data structures of sampling strategy tree and execution trace graph, it realizes the automatic adjustment of trace sampling rate and finds the way to quickly and accurately determine services that need to adjust the trace sampling rate. The collaboration between the above data structures enhances the trace proportion of anomalous executions. The experimental results show that the proposed method effectively improves the trace proportion of anomalous executions in any time period.