Distributed tracking sampling method and device and electronic equipment

By identifying and caching the tracking data type, directly sampling anomaly tracking, and using the differential evolution algorithm to determine the sampling amount, ensuring the consistency of the delay distribution after sampling, solving the balance and consistency issues in distributed tracking sampling, and improving the efficiency of anomaly tracking. Capture rate and data quality.

CN118612102APending Publication Date: 2024-09-06WUHAN UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410743416.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Existing distributed tracing sampling methods have problems with poor sampling balance and consistency, and cannot fully cover all tracing types. In particular, they are not sensitive enough to abnormal tracing, and the delay distribution is inconsistent, which affects fault location and performance analysis.

Method used

By obtaining the type and status information of the tracking data, caching it to the state registration machine, directly sampling exception tracking, determining the sampling amount according to the data type, and using the differential evolution algorithm to generate a sampling combination plan to ensure the delay distribution consistency of the tracking data after sampling.

Benefits of technology

It achieves comprehensiveness and balance of tracking data types, improves the capture rate of exception tracking, ensures the consistency of post-sampling delay distribution, and solves the problem of poor sampling balance and consistency in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118612102A
    Figure CN118612102A
Patent Text Reader

Abstract

The invention provides a distributed tracking sampling method and device and electronic equipment, and the method comprises the steps: obtaining tracking data, recognizing the data type of the tracking data, and caching the state information of the tracking data to a state registration machine; according to the state information of the tracking data in the state registration machine, abnormal tracking in the tracking data is directly sampled; determining sampling limits of the tracking data of different data types according to the data types of the tracking data; and determining a grouping sampling strategy based on the sampling limit of the tracking data, and performing tracking sampling according to the grouping sampling strategy. According to the invention, the consistency of tracking data delay distribution after sampling is ensured, and the problem of poor sampling balance and consistency of the existing sampling method can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data sampling technology, and in particular to a distributed tracing sampling method, device and electronic equipment. Background Art

[0002] Microservice systems have become difficult to analyze and maintain due to their expanded scale and complex interactions. Distributed tracing is designed to observe the processing traces and execution details of requests within the system, helping operators understand the internal architecture of the system and locate faults in the system. Existing large microservice systems such as Netflix generate billions of requests a day, and storing the traces generated by all requests will cause huge storage overhead.

[0003] Existing distributed tracing implementations, such as Zipkin, Jaeger, and Skywalking, provide header-based samplers to alleviate the storage pressure caused by tracing. Header-based samplers decide whether to generate tracing when a request arrives with a fixed probability (such as 1%), effectively controlling the total amount of tracing generated by the system to a specific proportion. However, header-based samplers lose a large number of valuable traces because they cannot perceive the type and status of the request. In particular, the tracing distribution in microservice systems shows an obvious long-tail phenomenon, and header-based samplers may miss rare tracing types. Worse, because header-based samplers cannot predict the status of the request, a large number of potential abnormal traces (such as performance degradation or business abnormality traces) will not be captured.

[0004] In recent years, several tail-based samplers have been proposed to ensure the data quality of traces after sampling. Unlike head-based samplers that make sampling decisions before the trace is generated, tail-based samplers prefer sampling based on the value of the trace. Most existing tail samplers consist of two parts: encoding and weighting. PERCH and Sifter encode based on the structure of the trace and pay more attention to traces with rare structures when sampling. Sieve incorporates considerations of service latency in the trace into the encoding. However, these samplers still have the following limitations:

[0005] 1. Incomplete trace types and unbalanced type distribution. These samplers cannot guarantee comprehensive coverage of all trace types in theory or in practice, even if rare types are given higher weights. Due to the lack of persistent awareness of the state of sampled trace data, these samplers find it difficult to maintain a balanced trace distribution, resulting in a large number of redundant traces concentrated in a few hot types.

[0006] 2. Extremely insensitive to exception tracking. Exception tracking is of great value and helps operators locate faulty services and identify fault types. The encoding and weighting process of PERCH and Sifter does not involve the processing of delays and status codes in tracing, and is not superior to the head-based sampler in terms of the recall rate of exception tracking. Although Sieve introduces delay information in the encoding, the high-dimensional features make the sampler insensitive to the high latency of a single service. Not only that, the tracking of business exceptions may be ignored by the above samplers because there are no delay exceptions.

[0007] 3. Inconsistency in latency distribution. The trace after sampling will be used for many downstream tasks, such as elastic scaling and performance analysis. The elastic scaling task will set the trigger threshold according to the latency distribution of the interface. However, the existing tail samplers have not considered maintaining the consistency of the latency distribution of each interface before and after sampling.

[0008] There is currently no good solution to the problems of poor sampling balance and consistency in existing tracking sampling technologies. Summary of the invention

[0009] The present invention provides a distributed tracking sampling method, device and electronic device to solve the defects of poor sampling balance and consistency in the prior art.

[0010] In a first aspect, the present invention provides a distributed tracing sampling method, comprising:

[0011] Acquire tracking data, identify the data type of the tracking data, and cache the state information of the tracking data to a state register;

[0012] According to the state information of the tracking data in the state register, directly sampling the abnormal tracking in the tracking data;

[0013] Determining, according to the data type of the tracking data, sampling quotas of the tracking data of different data types;

[0014] Based on the sampling quota of the tracking data, a group sampling strategy is determined, and tracking sampling is performed according to the group sampling strategy.

[0015] According to a distributed tracing sampling method provided by the present invention, the data type of the tracing data is identified, and the state information of the tracing data is cached in a state register, including:

[0016] Identify the data type of the tracking data based on a breadth-first principle, and generate a fixed number for the tracking data of each data type;

[0017] The tracking data is grouped according to the data type and cached in the state register.

[0018] According to a distributed tracing sampling method provided by the present invention, after grouping the tracing data according to the data type and caching it in the state register, the method includes:

[0019] A threshold table is constructed, where the threshold table is used to store delay thresholds of the tracking data of different data types.

[0020] According to a distributed tracing sampling method provided by the present invention, according to the state information of the tracing data in the state register, directly sampling abnormal tracing in the tracing data includes:

[0021] Traversing and checking the status code of each interface in the tracking data, filtering out the business abnormality tracking in the tracking data, and identifying and sampling the business abnormality tracking;

[0022] The delay threshold of the tracking data is compared with the historical delay data, the performance degradation tracking in the tracking data is screened out, and the performance degradation tracking is identified and sampled.

[0023] According to a distributed tracing sampling method provided by the present invention, the sampling quota of the tracing data of different data types is determined according to the data type of the tracing data, including:

[0024] Generate several quota allocation plans according to the preset plan allocation targets;

[0025] An initial population is generated based on a differential evolution algorithm, and the initial population is iteratively processed until the number of iterations reaches a threshold, and a sampling quota of the tracking data is determined; the initial population includes a number of population individuals, and the population individuals are the quota allocation scheme.

[0026] According to a distributed tracing sampling method provided by the present invention, the quota allocation scheme is iteratively processed, including:

[0027] Randomly determine candidate individuals from the population individuals, and select a number of benchmark individuals for each candidate individual;

[0028] Generate crossover individuals based on the benchmark individuals with a preset allocation probability;

[0029] Compare the fitness of the crossover individual and the candidate individual, and update the candidate individual.

[0030] According to a distributed tracing sampling method provided by the present invention, determining the sampling amount of the tracing data includes:

[0031] When the number of iterations reaches a threshold, the quota allocation scheme corresponding to the candidate individuals generated in the last iteration is used as the sampling quota of the tracking data.

[0032] According to a distributed tracing sampling method provided by the present invention, a group sampling strategy is determined based on the sampling quota of the tracing data, and tracing sampling is performed according to the group sampling strategy, including:

[0033] Based on the sampling quota of the tracking data, generate a plurality of sampling combination schemes for the tracking data of each data type;

[0034] Based on the differential evolution algorithm, a final sampling combination of the tracking data of each data type is determined, and tracking sampling is performed on the tracking data according to the final sampling combination.

[0035] In a second aspect, the present invention further provides a distributed tracing sampling device, comprising:

[0036] An acquisition module, used to acquire tracking data, identify the data type of the tracking data, and cache the state information of the tracking data to a state register;

[0037] A processing module, used for directly sampling abnormal tracking in the tracking data according to the state information of the tracking data in the state register;

[0038] An allocation module, configured to determine, according to the data type of the tracking data, a sampling quota of the tracking data of different data types;

[0039] The sampling module is used to determine a group sampling strategy based on the sampling quota of the tracking data, and perform tracking sampling according to the group sampling strategy.

[0040] In a third aspect, the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the distributed tracing sampling method as described in the first aspect above is implemented.

[0041] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the distributed tracing sampling method as described in the first aspect above.

[0042] In a fifth aspect, the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the distributed tracing sampling method as described in the first aspect above.

[0043] Compared with the prior art, the present invention has the following beneficial effects:

[0044] The distributed tracing sampling method provided by the present invention ensures the comprehensiveness and balance of the data types of the sampled tracing data by allocating corresponding sampling quotas to the tracing data of each data type. After the sampling quota of each tracing data is given, different types of tracing data are grouped and sampled. The sampled tracing data will be permanently stored in the file system, and other tracing data will be discarded from the state register. Through the form of group sampling, the consistency of the delay distribution of the tracing data after sampling is guaranteed. In summary, this method can solve the problems of poor sampling balance and consistency in existing sampling methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0046] Figure 1 is a flow chart of the distributed tracing sampling method proposed in the present invention;

[0047] Figure 2 It is a tracking generation process of a tracking instance in the present invention;

[0048] Figure 3 is a schematic diagram of a tracking example in the present invention;

[0049] Figure 4 It is a schematic diagram of the structure of caching tracking data to a state register in the present invention;

[0050] Figure 5 is a schematic diagram of a generation process of a crossover individual in one embodiment of the present invention;

[0051] Figure 6 It is a structural block diagram of the distributed tracking sampling device proposed by the present invention;

[0052] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0054] The present invention provides a distributed tracing sampling method. Figure 1 is a flow chart of the distributed tracing sampling method proposed in the present invention. Figure 1 As shown, the method comprises the following steps:

[0055] Step S101, obtaining tracking data, identifying the data type of the tracking data, and caching the status information of the tracking data into a status register.

[0056] Step S102, directly sampling abnormal tracking in the tracking data according to the state information of the tracking data in the state register.

[0057] Step S103: determining sampling quotas of tracking data of different data types according to the data types of the tracking data.

[0058] Step S104: determine a group sampling strategy based on the sampling quota of the tracking data, and perform tracking sampling according to the group sampling strategy.

[0059] In this method, for the tracking data that needs to be tracked and sampled, the data type is first identified, and then cached in the state register, waiting for delayed batch sampling of the sampling gas. Then, according to the state information of the tracking data in the state register, a streaming anomaly detector for tracking is designed to directly sample high-value abnormal tracking in the tracking data. In the subsequent process, especially when the state register is full, a corresponding sampling quota is allocated to the tracking data of each data type to ensure the comprehensiveness and balance of the data type of the sampled tracking data. After the sampling quota of each tracking data is given, different types of tracking data are grouped and sampled. The sampled tracking data will be persistently stored in the file system, and other tracking data will be discarded from the state register. Through the form of group sampling, the consistency of the delayed distribution of the tracking data after sampling is guaranteed. In summary, this method can solve the problems of poor sampling balance and consistency in the existing sampling methods.

[0060] In some of the embodiments, step S101, identifying the data type of the tracking data and caching the state information of the tracking data into a state register, includes: identifying the data type of the tracking data based on a breadth-first principle, and generating a fixed number for the tracking data of each data type; grouping the tracking data according to the data type, and caching it into a state register.

[0061] Exemplarily, identifying the data type of the trace data based on a breadth-first search, Figure 2 is a tracking generation process of a tracking instance in the present invention, Figure 3 is a schematic diagram of a tracking example in the present invention, such as Figure 2 and Figure 3As shown in Figure 1, tracing is essentially a tree structure that records the flow of requests in the microservice system. In order to identify different tracing types, a breadth-first traversal of each tracing data can obtain a traversal path, such as Figure 2 The traversal path of the tracking instance is: travel-ticketing-routing-foundation-platform.

[0062] Then, a fixed number is generated for each data type based on the hash algorithm. The tracking data with the same traversal path are defined as belonging to the same data type. In order to simply represent various data types, a unique hash code is generated for the original traversal path, such as Figure 2 The hash code of the traversal path corresponding to the tracking instance is -7014664458227129065. All tracking data will be marked with a type label, and the label value is the hash code of the data type.

[0063] Furthermore, after grouping the tracking data according to the data type and caching it in the state register, it includes: constructing a threshold table, the threshold table is used to store delay thresholds of tracking data of different data types.

[0064] Specifically, incoming tracking data are grouped and cached into the state register according to data types, and a threshold table is maintained to store different types of delay thresholds. If a sampling decision is made immediately for each tracking, it is difficult to ensure the quality of the sampled group. Therefore, while ensuring efficiency, this method performs delayed batch sampling on the tracking data.

[0065] For example, Figure 4 As shown, Figure 4 It is a structural diagram of the tracking data cached to the state registration machine in the present invention. The tracking data of different data types are grouped and cached in a buffer. The buffer consists of a counter and multiple lists. Each list stores tracking data of a data type. The counter records the total number of cached tracking data. A maximum of N tracking data are cached. At the same time, all delay combinations (services, interfaces) are extracted from the cached tracking data and stored in a delay pool. The delay pool consists of multiple double-ended queues, each of which stores historical delay data for a specific interface. The mean and standard deviation of the delays of different interfaces in the delay pool are calculated regularly, and the results are stored in the threshold table to provide a threshold reference for subsequent anomaly detection.

[0066] In some embodiments, step S102 directly samples abnormal traces in the trace data according to the state information of the trace data in the state register, including: traversing and checking the state code of each interface in the trace data, filtering out the business abnormal traces in the trace data, and identifying and sampling the business abnormal traces; comparing the delay threshold of the trace data with the historical delay data, filtering out the performance degradation traces in the trace data, and identifying and sampling the performance degradation traces. In this embodiment, the number of samples of abnormal traces is defined as N. a .

[0067] Specifically, for business exception tracking, since business exception tracking usually carries abnormal status codes, such as "4xx" in HTTP requests, which means client errors (such as unauthorized or damaged requests), and "5xx" which means the server cannot process reasonable requests, when identifying and sampling, we can filter out business exception tracking by traversing and checking the status codes of each interface in the tracking data.

[0068] For performance degradation tracking, unlike business exception tracking, which has obvious abnormal status code identification, performance degradation detection usually needs to be compared with historical delay data. For any incoming tracking data t, define the delay threshold A of this tracking data t t for:

[0069]

[0070] Among them, O t represents the interface set of the tracking data t, o represents a specific interface, μ o represents the mean delay of interface o, σ o It represents the delay standard deviation of interface o. Both the delay arrival and the delay standard deviation can be directly obtained from the threshold table. k is a constant, indicating that the delay within k times the standard deviation of the delay mean is normal, otherwise it is regarded as performance degradation tracking multiple sampling. In this embodiment, k=3.

[0071] In some of the embodiments, step S102 determines the sampling quota of tracking data of different data types according to the data type of the tracking data, including: generating several quota allocation schemes according to a preset scheme allocation target; generating an initial population based on a differential evolution algorithm and a greedy strategy, iterating the initial population until the number of iterations reaches a threshold, and determining the sampling quota of the tracking data; the initial population includes several population individuals, and the population individuals are quota allocation schemes.

[0072] Specifically, the quota allocation scheme is iteratively processed, including: randomly determining candidate individuals from the population individuals, and selecting a number of benchmark individuals for each candidate individual; generating crossover individuals based on the benchmark individuals with a preset allocation probability; comparing the fitness of the crossover individuals and the candidate individuals, and updating the candidate individuals.

[0073] More specifically, determining the sampling quota of the tracking data includes: when the number of iterations reaches a threshold number, using the quota allocation scheme corresponding to the candidate individuals generated by the last iteration as the sampling quota of the tracking data.

[0074] In this embodiment, sampling quotas are allocated to tracking data of different data types, and this process is modeled as a nonlinear integer optimization problem. First, the total sampling quota N is defined s for:

[0075]

[0076] Where N represents the total number of cached tracking data, N a Indicates the number of sampled anomaly traces, and p indicates the preset sampling probability. Define the total number of data types as N t , the number of sampled tracking data of data type i is b i , the total number of caches of data type i in the state register is u i , the allocation scheme of sampling quota is Q = {q1,q2,…,q i When allocating quotas, the following objectives need to be met:

[0077] Goal 1: Cover as many data types as possible;

[0078] Goal 2: The number of samples of different data types should be as balanced as possible.

[0079] Therefore, the quota allocation problem can be modeled as a nonlinear integer optimization problem, and the expression of objective 1 (Obj1) is as follows:

[0080]

[0081] The first half of the “+” represents minimizing the standard deviation of the distribution, mainly to achieve the balance of the sampled tracking data. represents the penalty coefficient, which is used to penalize incomplete allocation schemes, namely:

[0082]

[0083] When the sampling quota and the number of sampled trace data of data type i are both 0, will be given a huge penalty value. The constraints of this problem can be defined as:

[0084]

[0085] The above constraints limit the sum of the sampling quotas allocated to various data types to N. s , and the allocated sampling quota q i The value must be less than the number of caches u of data type i i .

[0086] In order to solve the above nonlinear integer optimization problem, the data is iteratively processed based on the differential evolution algorithm in this embodiment. In the process of differential algorithm iterative processing, the initial population is composed of several population individuals, each population individual is defined as a quota allocation scheme, therefore, an initial population is specifically a set of all quota allocation schemes, one of which is shown in Table 1:

[0087] Table 1 Schematic diagram of one of the individuals in the initial population

[0088] Type 1 Type 2 Type 3 Type 4 Sampling amount 2 1 4 11

[0089] When calculating fitness, it is necessary to consider the standard deviation of sampling quota allocation and data type coverage. The calculation method can refer to the expression of goal 1 above.

[0090] For crossover processing, for example, three reference individuals are selected for each candidate individual, and a new crossover individual is generated based on the three reference individuals according to a preset allocation probability or crossover formula, such as Figure 5 As shown, Figure 5 Schematic diagram of the generation process of crossover individuals in one embodiment of the present invention. In this embodiment, the allocation probability or crossover formula is defined as follows:

[0091] v←x1+[0.5×(x2-x3)]

[0092] During the calculation process, the calculation results follow the principle of rounding. Based on the above crossover formula, the sampling quotas of the benchmark individuals x1, x2 and x3 in the first data type are 2, 5 and 4 respectively. Substituting into the above formula, the calculation result is 2.5. Based on the principle of rounding, the sampling quota of the crossover individual v for the first data type is 3. The calculation results of other data types are similar to the above process and will not be described in detail here. Compare the fitness of the crossover individuals and candidate individuals, take the population individuals with higher fitness as new candidate individuals, and perform subsequent iterative processing operations.

[0093] Taking into account the delay consistency of the tracking data interface level before and after sampling, in some embodiments, a group sampling strategy guided by the Kolmogorov-Smirnov test (KS test for short) is designed. In step S104, based on the sampling quota of the tracking data, the group sampling strategy is determined, and tracking sampling is performed according to the group sampling strategy, including: based on the sampling quota of the tracking data, a number of sampling combination schemes are generated for the tracking data of each data type; based on the differential evolution algorithm, the final sampling combination of the tracking data of each data type is determined, and the tracking data is sampled according to the final sampling combination.

[0094] Specifically, we group and sample the tracking data of different data types, and model this process as a combinatorial optimization problem. First, we generate possible sampling combinations for each data type i, and define the number of sampling combinations for each data type as N. c , then the kth sampling combination scheme c of data type i i,k It can be expressed as:

[0095]

[0096] Among them, t i,j represents the jth tracking data of data type i, q i Indicates the allocation amount of data type i. i,k Essentially, we randomly sample q from all trace data of data type i. i Therefore, the set C of all sampling combinations of data type i is composed of i It can be expressed as:

[0097]

[0098] Define Y = {y1,y2,…,y i} Define the pre-sampling interface for each data type selected by the combined index k The delay sequence is:

[0099]

[0100] in, Represents tracking data t i,j The delay sequence of the interface, so LT k Essentially, it is the interface for all tracking data. k The delay sequence is a collection of delay sequences. Then the interface after sampling is o k The delay sequence is:

[0101]

[0102] Essentially, it is the interface o in the data type i k The set of delayed sequences, so LT′ k It is the interface of all data types after sampling. k A collection of time-delay sequences.

[0103] Because the input data source of many downstream analysis tasks is distributed tracing, group sampling needs to consider the consistency of the delay distribution before and after sampling. The Kolmogorov-Smirnov test (KS test) is used to measure whether the delay sequences before and after sampling are taken from the same distribution. Objective 2 (Obj2) is:

[0104]

[0105] Among them, N o is the total number of interfaces, KS(LT k ,LT′ k ) returns the LT k and LT′ k The p-value after the KS test. There is only one constraint to achieve goal 2, that is, the combined index y of each data type i The value must be less than the total number of combinations N c :

[0106]

[0107] In order to achieve goal 2, in this embodiment, a differential evolution algorithm is used to iteratively process the sampling combination scheme of each data type. The specific output process is consistent with the output process of the quota allocation scheme in the above process, except that the sampling combination scheme is treated as a population individual. After the iteration is completed, the sampling combination scheme with the highest fitness is used as the sampling quota of the tracking data of this data type.

[0108] In order to verify the effectiveness of the above method, this method (Ours) is experimentally compared with other tracking sampling methods (Head sampling, PERCH sampling, Sifter sampling and Sieve sampling) on ​​different data sets, and different methods are evaluated by control, coverage, suppression rate and recall rate. The specific experimental results are shown in Table 2:

[0109] Table 2 Performance comparison of different tracking sampling methods on different data sets

[0110]

[0111] As can be seen from Table 2, compared with other existing tracking sampling methods, the method has obvious advantages in most indicators in the experiments conducted on four different data sets. Therefore, the effect of tracking sampling by the above method can be well verified.

[0112] The present invention also provides a distributed tracing sampling device. The distributed tracing sampling device provided by the present invention is described below. The distributed tracing sampling device described below and the distributed tracing sampling method described above can refer to each other. Figure 6 is a structural block diagram of the distributed tracking sampling device proposed in the present invention, such as Figure 6 As shown, the device comprises:

[0113] The acquisition module 601 is used to acquire the tracking data, identify the data type of the tracking data, and cache the state information of the tracking data to the state register;

[0114] The processing module 602 is used to directly sample the abnormal tracking in the tracking data according to the state information of the tracking data in the state register;

[0115] An allocation module 603, configured to determine sampling quotas of tracking data of different data types according to the data types of the tracking data;

[0116] The sampling module 604 is used to determine a group sampling strategy based on the sampling quota of the tracking data, and perform tracking sampling according to the group sampling strategy.

[0117] When the device is in use, for the tracking data that needs to be tracked and sampled, first, the acquisition module 601 identifies the data type, and then caches it in the state register, waiting for the delayed batch sampling of the sampling gas. Then, the processing module 602 designs a streaming anomaly detector for tracking based on the state information of the tracking data in the state register, and directly samples the high-value abnormal tracking in the tracking data. In the subsequent process, especially when the state register is full, the allocation module 603 allocates corresponding sampling quotas for each data type of tracking data to ensure the comprehensiveness and balance of the data types of the sampled tracking data. After the sampling quota of each type of tracking data is given, the sampling module 604 groups and samples different types of tracking data. The sampled tracking data will be persistently stored in the file system, and other tracking data will be discarded from the state register. Through the form of group sampling, the consistency of the delayed distribution of the tracking data after sampling is guaranteed. In summary, the present device can solve the problems of poor sampling balance and consistency in the existing sampling methods.

[0118] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7As shown, the electronic device may include: a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702 and the memory 703 communicate with each other through the communication bus 704. The processor 701 may call the logic instructions in the memory 703 to execute the distributed tracing sampling method, which includes:

[0119] Obtain tracking data, identify the data type of the tracking data, and cache the status information of the tracking data to the status register;

[0120] According to the status information of the tracking data in the state register, directly sample the abnormal tracking in the tracking data;

[0121] According to the data type of the tracking data, determine the sampling quota of the tracking data of different data types;

[0122] Based on the sampling quota of tracking data, determine the group sampling strategy, and perform tracking sampling according to the group sampling strategy.

[0123] In addition, the logic instructions in the above-mentioned memory 703 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0124] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the distributed tracing sampling method provided by the above methods, the method includes:

[0125] Obtain tracking data, identify the data type of the tracking data, and cache the status information of the tracking data to the status register;

[0126] According to the status information of the tracking data in the state register, directly sample the abnormal tracking in the tracking data;

[0127] According to the data type of the tracking data, determine the sampling quota of the tracking data of different data types;

[0128] Based on the sampling quota of tracking data, determine the group sampling strategy, and perform tracking sampling according to the group sampling strategy.

[0129] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the distributed tracing sampling method provided by the above methods is implemented, and the method includes:

[0130] Obtain tracking data, identify the data type of the tracking data, and cache the status information of the tracking data to the status register;

[0131] According to the status information of the tracking data in the state register, directly sample the abnormal tracking in the tracking data;

[0132] According to the data type of the tracking data, determine the sampling quota of the tracking data of different data types;

[0133] Based on the sampling quota of tracking data, determine the group sampling strategy, and perform tracking sampling according to the group sampling strategy.

[0134] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0135] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0136] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A distributed tracing sampling method, characterized in that: include: Acquire tracking data, identify the data type of the tracking data, and cache the state information of the tracking data to a state register; According to the state information of the tracking data in the state register, directly sampling the abnormal tracking in the tracking data; Determining, according to the data type of the tracking data, sampling quotas of the tracking data of different data types; Based on the sampling quota of the tracking data, a group sampling strategy is determined, and tracking sampling is performed according to the group sampling strategy.

2. The distributed tracing sampling method according to claim 1, characterized in that: Identifying a data type of the tracking data and caching state information of the tracking data in a state register includes: Identify the data type of the tracking data based on a breadth-first principle, and generate a fixed number for the tracking data of each data type; The tracking data is grouped according to the data type and cached in the state register.

3. The distributed tracing sampling method according to claim 2, characterized in that: The tracking data is grouped according to the data type and cached in the state register, including: A threshold table is constructed, where the threshold table is used to store delay thresholds of the tracking data of different data types.

4. The distributed tracing sampling method according to claim 1, characterized in that: According to the state information of the tracking data in the state register, directly sampling the abnormal tracking in the tracking data includes: Traversing and checking the status code of each interface in the tracking data, filtering out the business abnormality tracking in the tracking data, and identifying and sampling the business abnormality tracking; The delay threshold of the tracking data is compared with the historical delay data, the performance degradation tracking in the tracking data is screened out, and the performance degradation tracking is identified and sampled.

5. The distributed tracing sampling method according to claim 1, characterized in that: Determining sampling amounts of the tracking data of different data types according to the data type of the tracking data includes: Generate several quota allocation plans according to the preset plan allocation targets; An initial population is generated based on a differential evolution algorithm, and the initial population is iteratively processed until the number of iterations reaches a threshold, and a sampling quota of the tracking data is determined; the initial population includes a number of population individuals, and the population individuals are the quota allocation scheme.

6. The distributed tracing sampling method according to claim 5, characterized in that: The quota allocation scheme is iterated, including: Randomly determine candidate individuals from the population individuals, and select a number of benchmark individuals for each candidate individual; Generate crossover individuals based on the benchmark individuals with a preset allocation probability; Compare the fitness of the crossover individual and the candidate individual, and update the candidate individual.

7. The distributed tracing sampling method according to claim 6, characterized in that: Determine the sampling amount of the tracking data, including: When the number of iterations reaches a threshold, the quota allocation scheme corresponding to the candidate individuals generated in the last iteration is used as the sampling quota of the tracking data.

8. The distributed tracing sampling method according to claim 1, characterized in that: Based on the sampling quota of the tracking data, a group sampling strategy is determined, and tracking sampling is performed according to the group sampling strategy, including: Based on the sampling quota of the tracking data, generate a plurality of sampling combination schemes for the tracking data of each data type; Based on the differential evolution algorithm, a final sampling combination of the tracking data of each data type is determined, and tracking sampling is performed on the tracking data according to the final sampling combination.

9. A distributed tracing sampling device, characterized in that: include: An acquisition module, used to acquire tracking data, identify the data type of the tracking data, and cache the state information of the tracking data to a state register; A processing module, used for directly sampling abnormal tracking in the tracking data according to the state information of the tracking data in the state register; An allocation module, configured to determine, according to the data type of the tracking data, a sampling quota of the tracking data of different data types; The sampling module is used to determine a group sampling strategy based on the sampling quota of the tracking data, and perform tracking sampling according to the group sampling strategy.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the distributed tracing sampling method according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Distributed tracking data downsampling processing method and system

    CN120238460A

  • Distributed tracing data downsampling processing method and system

    CN120238460B