Transaction link aggregation tracking method and system
By collecting and analyzing transaction messages, defining the tracking mode, and using the global transaction flow number and OpenTelemetry ID, aggregation and tracking of transaction links is realized, solving the problem of poor aggregation of transaction link tracking in the existing technology, and improving the efficiency of fault location and performance analysis.
Patent Information
- Application Number
- CN202411562531.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-05
AI Technical Summary
The existing technology is difficult to achieve aggregation tracking of transaction links, especially in large-scale transaction environments, which leads to difficulties in fault location and performance analysis.
By collecting transaction messages in a distributed environment, analyzing and generating transaction indicators, defining the tracking mode, and implementing transaction link aggregation tracking at different dimensions based on the global transaction flow number and OpenTelemetry ID.
It realizes efficient aggregation and tracking of transaction links, improves the efficiency of fault location and transaction performance analysis, and can identify and solve problems faster.
Smart Images

Figure CN119088662B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a transaction link aggregation tracking method and system. Background Art
[0002] Currently, mainstream transaction link tracking data mainly comes from logs and APM. The tracking mode is based on the open source OpenTelemetry. This type of tool implements single transaction tracking. When the transaction volume is very large, it is very difficult to troubleshoot problems one by one. There is an urgent need to perform aggregate link tracking according to certain business attributes.
[0003] This transaction link tracking method in the prior art (Chinese patent application number CN202310322776.4, which discloses a "transaction link tracking method and device") only implements log-based single transaction link tracking, and fails to perform transaction link aggregation tracking according to different dimensional levels.
[0004] The layered topology map generation method in the prior art (Chinese patent application number CN202410862168.7, which discloses "a layered topology map generation method, device, equipment and storage medium") does not achieve aggregate tracking of transaction data. When troubleshooting business problems, it is impossible to quickly locate faulty nodes, transaction codes, transaction channels and other information through effective dimensional aggregation. Summary of the invention
[0005] In view of the defects in the prior art, an object of the present invention is to provide a transaction link aggregation tracking method and system.
[0006] A transaction link aggregation tracking method provided by the present invention includes:
[0007] Step S1: Collecting distributed environment transaction messages;
[0008] Step S2: Generate message analysis and transaction indicators based on the collected transaction messages;
[0009] Step S3: Define the tracking mode according to the transaction message;
[0010] Step S4: Based on the transaction indicators and tracking modes, transaction link aggregation tracking at different dimensional levels is achieved.
[0011] Preferably, in step S1:
[0012] The collector is deployed in the kubernetes environment through daemonset. The collector collects messages from the transaction system in a bypass mode. This collection method does not intrude into the business system.
[0013] The business system contains a global transaction serial number or OpenTelemetry ID, where the OpenTelemetry ID contains three fields: traceid is the global tracing identifier, spanid is the span identifier, and parentid is the parent span identifier; when a transaction passes through different systems, the global transaction serial number and traceid remain unique.
[0014] Preferably, in step S2:
[0015] Step S2.1: Decoding: The collected transaction message is sent to the backend server, which includes a decoding engine module. The decoding engine module uses a specific decoder to fully parse the message according to the characteristics of the transaction message, including the message header and message body. After decoding, a specific transaction record in key and value format is generated;
[0016] Step S2.2: Association: The transaction records generated by the decoder engine are passed to the association module. The association module supports different association models. It implements the association of requests and responses based on the specific association fields and the synchronous and asynchronous characteristics of the transaction, and associates the transaction records into a complete transaction.
[0017] Step S2.3: Dimension definition: Analyze the key dimensions of the transaction for subsequent aggregation, including: node, service, transaction code, transaction channel, return code, client IP and server IP; transactions with the same dimension are automatically aggregated, and their corresponding transaction indicators are aggregated according to the corresponding time interval;
[0018] Step S2.4: Transaction link tracking field definition: parse the global transaction serial number, traceid, spanid, parentid in the transaction message. The global transaction serial number and traceid are unique within a certain period of time. This field is used to implement global transaction link tracking.
[0019] Step S2.5: Transaction indicator generation: By calculating all complete transactions within a unit time, four transaction indicators are obtained: transaction volume, response rate, success rate, and response time, among which:
[0020] Trading volume: the total number of transactions per unit time;
[0021] Response rate: the number of transactions with responses per unit time / the total number of transactions*100%;
[0022] Success rate: number of successful transactions per unit time / number of transactions with responses * 100%, where success is determined by the return code in the response;
[0023] Response time: The time it takes for a service to process a transaction, that is, the time difference between the request and the response.
[0024] Preferably, in step S3:
[0025] Step S3.1: Based on IP communication relationship: In the specified time interval, according to the timestamp in the transaction request in the transaction message, the global transaction serial number or traceid, all transactions that meet the conditions are screened out:
[0026] Each transaction has a client IP client_ip and a server IP server_ip; based on the relationship between the client IP and the server IP, the link relationship of the transaction is obtained;
[0027] Step S3.2: Based on OpenTelemetry: In the specified time interval, according to the timestamp and traceid in the transaction request in the transaction message, filter out all transactions that meet the conditions: each transaction has traceid, spanid, and parentid. According to the association relationship of OpenTelemetry, the link relationship of the transaction is obtained.
[0028] Preferably, in step S4:
[0029] Achieve transaction link aggregation tracking at different dimensional levels, as follows:
[0030] Step S4.1: define the starting service node to be aggregated and tracked;
[0031] Step S4.2: Define the dimensions to be aggregated and tracked, if transaction codes are used;
[0032] Step S4.3: define the specific transaction code to be tracked;
[0033] Step S4.4: Define the type of serial number used for tracing, global transaction serial number or traceid, if traceid is used;
[0034] Step S4.5: In the specified time interval, filter out all transactions corresponding to the transaction code of the node, and obtain the set of traceids {traceid 1, traceid 2, ..., traceid n}, perform sampling settings, set the maximum transaction number threshold n, and obtain the traceid set of the first n transactions in chronological order;
[0035] Step S4.6: According to the selected tracking method, use the specified number of sampled transaction details to track the single transaction links respectively;
[0036] Step S4.7: Aggregate the results of tracking multiple transaction details and aggregate them according to the defined dimension. This time, the transaction code is used, so the node of the link graph selects the transaction code. If the transaction codes in different trackings are different, they need to be defined as different nodes, and finally the aggregated transaction link tracking graph is obtained;
[0037] Step S4.8: Based on the aggregated transaction link tracking graph, calculate the transaction indicators of each node: transaction volume, response rate, success rate, and response time;
[0038] Step S4.9: When changing to another aggregation dimension, perform transaction link aggregation tracking according to the defined dimension;
[0039] Step S4.10: After the tracking mode is changed, the transaction link aggregation tracking is performed according to the defined tracking mode.
[0040] A transaction link aggregation tracking system provided by the present invention includes:
[0041] Module M1: Collecting distributed environment transaction messages;
[0042] Module M2: Generate message analysis and transaction indicators based on the collected transaction messages;
[0043] Module M3: Define the tracking mode according to the transaction message;
[0044] Module M4: Based on transaction indicators and tracking modes, realize transaction link aggregation tracking at different dimensional levels.
[0045] Preferably, in the module M1:
[0046] The collector is deployed in the kubernetes environment through daemonset. The collector collects messages from the transaction system in a bypass mode. This collection method does not intrude into the business system.
[0047] The business system contains a global transaction serial number or OpenTelemetry ID, where the OpenTelemetry ID contains three fields: traceid is the global tracing identifier, spanid is the span identifier, and parentid is the parent span identifier; when a transaction passes through different systems, the global transaction serial number and traceid remain unique.
[0048] Preferably, in the module M2:
[0049] Module M2.1: Decoding: Send the collected transaction messages to the backend server, which contains a decoding engine module. The decoding engine module uses a specific decoder to fully parse the message according to the characteristics of the transaction message, including the message header and message body. After decoding, a specific transaction record in key and value format is generated;
[0050] Module M2.2: Association: The transaction records generated by the decoder engine are passed to the association module. The association module supports different association models. It implements the association of requests and responses based on the specific association fields and the synchronous and asynchronous characteristics of the transaction, and associates the transaction records into a complete transaction.
[0051] Module M2.3: Dimension definition: Analyze the key dimensions of transactions for subsequent aggregation, including: node, service, transaction code, transaction channel, return code, client IP and server IP; transactions with the same dimension are automatically aggregated, and their corresponding transaction indicators are aggregated according to the corresponding time interval;
[0052] Module M2.4: Transaction link tracking field definition: parse the global transaction serial number, traceid, spanid, parentid in the transaction message. The global transaction serial number and traceid are unique within a certain period of time. This field is used to implement global transaction link tracking.
[0053] Module M2.5: Transaction indicator generation: By calculating all complete transactions within a unit time, four transaction indicators are obtained: transaction volume, response rate, success rate, and response time, among which:
[0054] Trading volume: the total number of transactions per unit time;
[0055] Response rate: the number of transactions with responses per unit time / the total number of transactions*100%;
[0056] Success rate: number of successful transactions per unit time / number of transactions with responses * 100%, where success is determined by the return code in the response;
[0057] Response time: The time it takes for a service to process a transaction, that is, the time difference between the request and the response.
[0058] Preferably, in the module M3:
[0059] Module M3.1: Based on IP communication relationship: In the specified time interval, according to the timestamp in the transaction request in the transaction message, the global transaction serial number or traceid, all transactions that meet the conditions are screened out:
[0060] Each transaction has a client IP client_ip and a server IP server_ip; based on the relationship between the client IP and the server IP, the link relationship of the transaction is obtained;
[0061] Module M3.2: Based on OpenTelemetry: In the specified time interval, according to the timestamp and traceid in the transaction request in the transaction message, filter out all transactions that meet the conditions: each transaction has traceid, spanid, and parentid. According to the association relationship of OpenTelemetry, the link relationship of the transaction is obtained.
[0062] Preferably, in the module M4:
[0063] Achieve transaction link aggregation tracking at different dimensional levels, as follows:
[0064] Module M4.1: Define the starting service node to be aggregated and tracked;
[0065] Module M4.2: Define the dimensions to be tracked in aggregate, if transaction codes are used;
[0066] Module M4.3: Define the specific transaction codes to be tracked;
[0067] Module M4.4: Define the type of serial number used for tracing, global transaction serial number or traceid, if traceid is used;
[0068] Module M4.5: In the specified time interval, filter out all transactions corresponding to the transaction code of the node, and obtain the set of traceids {traceid 1, traceid 2, ..., traceid n}, perform sampling settings, set the maximum transaction number threshold n, and obtain the traceid set of the first n transactions in chronological order;
[0069] Module M4.6: Based on the selected tracking method, use the specified number of sampled transaction details to track the single transaction link;
[0070] Module M4.7: Aggregate the results of tracking multiple transaction details and aggregate them according to the defined dimensions. This time, the transaction code is used, so the node of the link graph selects the transaction code. If the transaction codes in different trackings are different, they need to be defined as different nodes, and finally the aggregated transaction link tracking graph is obtained;
[0071] Module M4.8: Based on the aggregated transaction link tracking graph, calculate the transaction indicators of each node: transaction volume, response rate, success rate, and response time;
[0072] Module M4.9: When changing to other aggregation dimensions, perform transaction link aggregation tracking according to the defined dimensions;
[0073] Module M4.10: When the tracking mode is changed, the transaction link aggregation tracking is performed according to the defined tracking mode.
[0074] Compared with the prior art, the present invention has the following beneficial effects:
[0075] The present invention solves the problem of poor aggregation of single transaction link tracking by adopting customized dimension aggregation of transaction messages and using two different ID tracking modes: global transaction serial number and OpenTelemetry ID. This realizes aggregate tracking of transaction links at different dimensional levels, improves the aggregate tracking effect of transactions, and helps fault location and transaction performance analysis more quickly. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0077] Figure 1 Processing logic diagram for the overall business;
[0078] Figure 2 It is a schematic diagram of the IP communication relationship tracking mode;
[0079] Figure 3 This is a schematic diagram of the tracing mode based on OpenTelemetry. DETAILED DESCRIPTION
[0080] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0081] Embodiment 1:
[0082] The present invention provides a transaction link aggregation tracking method and system. The method captures transaction messages in a distributed environment, parses transaction fields such as the global transaction serial number, OpenTelemetry ID, transaction code, transaction channel, client IP, server IP, transaction timestamp, return code, and service in the transaction message, aggregates these fields into different dimensions, and then implements transaction link aggregation tracking at different dimensional levels based on two different ID tracking modes, namely the global transaction serial number and the OpenTelemetry ID, thereby improving the aggregation tracking effect of the transaction and helping fault location and transaction performance analysis more quickly.
[0083] According to a transaction link aggregation tracking method provided by the present invention, Figure 1-Figure 3 As shown, including:
[0084] Step S1: Collecting distributed environment transaction messages;
[0085] Specifically, in step S1:
[0086] The collector is deployed in the kubernetes environment through daemonset. The collector collects messages from the transaction system in a bypass mode. This collection method does not intrude into the business system.
[0087] The business system contains a global transaction serial number or OpenTelemetry ID, where the OpenTelemetry ID contains three fields: traceid is the global tracing identifier, spanid is the span identifier, and parentid is the parent span identifier; when a transaction passes through different systems, the global transaction serial number and traceid remain unique.
[0088] Step S2: Generate message analysis and transaction indicators based on the collected transaction messages;
[0089] Specifically, in step S2:
[0090] Step S2.1: Decoding: The collected transaction message is sent to the backend server, which includes a decoding engine module. The decoding engine module uses a specific decoder to fully parse the message according to the characteristics of the transaction message, including the message header and message body. After decoding, a specific transaction record in key and value format is generated;
[0091] Step S2.2: Association: The transaction records generated by the decoder engine are passed to the association module. The association module supports different association models. It implements the association of requests and responses based on the specific association fields and the synchronous and asynchronous characteristics of the transaction, and associates the transaction records into a complete transaction.
[0092] Step S2.3: Dimension definition: Analyze the key dimensions of the transaction for subsequent aggregation, including: node, service, transaction code, transaction channel, return code, client IP and server IP; transactions with the same dimension are automatically aggregated, and their corresponding transaction indicators are aggregated according to the corresponding time interval;
[0093] Step S2.4: Transaction link tracking field definition: parse the global transaction serial number, traceid, spanid, parentid in the transaction message. The global transaction serial number and traceid are unique within a certain period of time. This field is used to implement global transaction link tracking.
[0094] Step S2.5: Transaction indicator generation: By calculating all complete transactions within a unit time, four transaction indicators are obtained: transaction volume, response rate, success rate, and response time, among which:
[0095] Trading volume: the total number of transactions per unit time;
[0096] Response rate: the number of transactions with responses per unit time / the total number of transactions*100%;
[0097] Success rate: number of successful transactions per unit time / number of transactions with responses * 100%, where success is determined by the return code in the response;
[0098] Response time: The time it takes for a service to process a transaction, that is, the time difference between the request and the response.
[0099] Step S3: Define the tracking mode according to the transaction message;
[0100] Specifically, in step S3:
[0101] Step S3.1: Based on IP communication relationship: In the specified time interval, according to the timestamp in the transaction request in the transaction message, the global transaction serial number or traceid, all transactions that meet the conditions are screened out:
[0102] Each transaction has a client IP client_ip and a server IP server_ip; based on the relationship between the client IP and the server IP, the link relationship of the transaction is obtained;
[0103] Step S3.2: Based on OpenTelemetry: In the specified time interval, according to the timestamp and traceid in the transaction request in the transaction message, filter out all transactions that meet the conditions: each transaction has traceid, spanid, and parentid. According to the association relationship of OpenTelemetry, the link relationship of the transaction is obtained.
[0104] Step S4: Based on the transaction indicators and tracking modes, transaction link aggregation tracking at different dimensional levels is achieved.
[0105] Specifically, in step S4:
[0106] Achieve transaction link aggregation tracking at different dimensional levels, as follows:
[0107] Step S4.1: define the starting service node to be aggregated and tracked;
[0108] Step S4.2: Define the dimensions to be aggregated and tracked, if transaction codes are used;
[0109] Step S4.3: define the specific transaction code to be tracked;
[0110] Step S4.4: Define the type of serial number used for tracing, global transaction serial number or traceid, if traceid is used;
[0111] Step S4.5: In the specified time interval, filter out all transactions corresponding to the transaction code of the node, and obtain the set of traceids {traceid 1, traceid 2, ..., traceid n}, perform sampling settings, set the maximum transaction number threshold n, and obtain the traceid set of the first n transactions in chronological order;
[0112] Step S4.6: According to the selected tracking method, use the specified number of sampled transaction details to track the single transaction links respectively;
[0113] Step S4.7: Aggregate the results of tracking multiple transaction details and aggregate them according to the defined dimension. This time, the transaction code is used, so the node of the link graph selects the transaction code. If the transaction codes in different trackings are different, they need to be defined as different nodes, and finally the aggregated transaction link tracking graph is obtained;
[0114] Step S4.8: Based on the aggregated transaction link tracking graph, calculate the transaction indicators of each node: transaction volume, response rate, success rate, and response time;
[0115] Step S4.9: When changing to another aggregation dimension, perform transaction link aggregation tracking according to the defined dimension;
[0116] Step S4.10: After the tracking mode is changed, the transaction link aggregation tracking is performed according to the defined tracking mode.
[0117] Embodiment 2:
[0118] Embodiment 2 is a preferred example of Embodiment 1, and is used to illustrate the present invention in more detail.
[0119] The present invention also provides a transaction link aggregation tracking system, which can be implemented by executing the process steps of the transaction link aggregation tracking method, that is, those skilled in the art can understand the transaction link aggregation tracking method as a preferred implementation of the transaction link aggregation tracking system.
[0120] A transaction link aggregation tracking system provided by the present invention includes:
[0121] Module M1: Collecting distributed environment transaction messages;
[0122] Specifically, in the module M1:
[0123] The collector is deployed in the kubernetes environment through daemonset. The collector collects messages from the transaction system in a bypass mode. This collection method does not intrude into the business system.
[0124] The business system contains a global transaction serial number or OpenTelemetry ID, where the OpenTelemetry ID contains three fields: traceid is the global tracing identifier, spanid is the span identifier, and parentid is the parent span identifier; when a transaction passes through different systems, the global transaction serial number and traceid remain unique.
[0125] Module M2: Generate message analysis and transaction indicators based on the collected transaction messages;
[0126] Specifically, in the module M2:
[0127] Module M2.1: Decoding: Send the collected transaction messages to the backend server, which contains a decoding engine module. The decoding engine module uses a specific decoder to fully parse the message according to the characteristics of the transaction message, including the message header and message body. After decoding, a specific transaction record in key and value format is generated;
[0128] Module M2.2: Association: The transaction records generated by the decoder engine are passed to the association module. The association module supports different association models. It implements the association of requests and responses based on the specific association fields and the synchronous and asynchronous characteristics of the transaction, and associates the transaction records into a complete transaction.
[0129] Module M2.3: Dimension definition: Analyze the key dimensions of transactions for subsequent aggregation, including: node, service, transaction code, transaction channel, return code, client IP and server IP; transactions with the same dimension are automatically aggregated, and their corresponding transaction indicators are aggregated according to the corresponding time interval;
[0130] Module M2.4: Transaction link tracking field definition: parse the global transaction serial number, traceid, spanid, parentid in the transaction message. The global transaction serial number and traceid are unique within a certain period of time. This field is used to implement global transaction link tracking.
[0131] Module M2.5: Transaction indicator generation: By calculating all complete transactions within a unit time, four transaction indicators are obtained: transaction volume, response rate, success rate, and response time, among which:
[0132] Trading volume: the total number of transactions per unit time;
[0133] Response rate: the number of transactions with responses per unit time / the total number of transactions*100%;
[0134] Success rate: number of successful transactions per unit time / number of transactions with responses * 100%, where success is determined by the return code in the response;
[0135] Response time: The time it takes for a service to process a transaction, that is, the time difference between the request and the response.
[0136] Module M3: Define the tracking mode according to the transaction message;
[0137] Specifically, in the module M3:
[0138] Module M3.1: Based on IP communication relationship: In the specified time interval, according to the timestamp in the transaction request in the transaction message, the global transaction serial number or traceid, all transactions that meet the conditions are screened out:
[0139] Each transaction has a client IP client_ip and a server IP server_ip; based on the relationship between the client IP and the server IP, the link relationship of the transaction is obtained;
[0140] Module M3.2: Based on OpenTelemetry: In the specified time interval, according to the timestamp and traceid in the transaction request in the transaction message, filter out all transactions that meet the conditions: each transaction has traceid, spanid, and parentid. According to the association relationship of OpenTelemetry, the link relationship of the transaction is obtained.
[0141] Module M4: Based on transaction indicators and tracking modes, realize transaction link aggregation tracking at different dimensional levels.
[0142] Specifically, in the module M4:
[0143] Achieve transaction link aggregation tracking at different dimensional levels, as follows:
[0144] Module M4.1: Define the starting service node to be aggregated and tracked;
[0145] Module M4.2: Define the dimensions to be tracked in aggregate, if transaction codes are used;
[0146] Module M4.3: Define the specific transaction codes to be tracked;
[0147] Module M4.4: Define the type of serial number used for tracing, global transaction serial number or traceid, if traceid is used;
[0148] Module M4.5: In the specified time interval, filter out all transactions corresponding to the transaction code of the node, and obtain the set of traceids {traceid 1, traceid 2, ..., traceid n}, perform sampling settings, set the maximum transaction number threshold n, and obtain the traceid set of the first n transactions in chronological order;
[0149] Module M4.6: Based on the selected tracking method, use the specified number of sampled transaction details to track the single transaction link;
[0150] Module M4.7: Aggregate the results of tracking multiple transaction details and aggregate them according to the defined dimensions. This time, the transaction code is used, so the node of the link graph selects the transaction code. If the transaction codes in different trackings are different, they need to be defined as different nodes, and finally the aggregated transaction link tracking graph is obtained;
[0151] Module M4.8: Based on the aggregated transaction link tracking graph, calculate the transaction indicators of each node: transaction volume, response rate, success rate, and response time;
[0152] Module M4.9: When changing to other aggregation dimensions, perform transaction link aggregation tracking according to the defined dimensions;
[0153] Module M4.10: When the tracking mode is changed, the transaction link aggregation tracking is performed according to the defined tracking mode.
[0154] Embodiment 3:
[0155] Embodiment 3 is a preferred example of Embodiment 1, and is used to illustrate the present invention in more detail.
[0156] The specific counting steps are as follows:
[0157] Step 1: Distributed environment transaction message collection:
[0158] In a distributed environment, east-west network traffic cannot be obtained through switch mirroring. Therefore, the collector is deployed in the kubernetes environment through daemonset. The collector collects messages from the transaction system in a bypass manner. This collection method does not cause any intrusion to the business system. At the same time, the business system needs to contain a global transaction serial number or OpenTelemetry ID, where the OpenTelemetry ID contains three fields: traceid is the global tracing identifier, spanid is the span identifier, and parentid is the parent span identifier. When a transaction passes through different systems, the global transaction serial number and traceid remain unique.
[0159] Step 2: Message parsing and transaction indicator generation, including:
[0160] S1: Decoding:
[0161] The collected transaction messages are sent to the back-end server, which includes a decoding engine module. The decoding engine module uses a specific decoder to completely parse the message according to the characteristics of the transaction message, including the message header and message body. After decoding, a specific transaction record in the key and value format is generated.
[0162] S2: Association:
[0163] The transaction records generated by the decoder engine are passed to the association module. The association module supports different association models. It realizes the association of requests and responses based on the specific association fields and the synchronous and asynchronous characteristics of the transaction, and finally associates the transaction records into a complete transaction.
[0164] S3: Dimension definition:
[0165] The key dimensions of the transaction are analyzed for subsequent aggregation, including but not limited to: node, service, transaction code, transaction channel, return code, client IP, server IP, etc. Transactions of the same dimension are automatically aggregated, and the corresponding transaction indicators are also aggregated according to the corresponding time interval.
[0166] S4: Transaction link tracking field definition:
[0167] Parse the global transaction serial number, traceid, spanid, and parentid in the transaction message. The global transaction serial number and traceid need to be unique within a certain period of time. This field can be used to track the global transaction link.
[0168] S5: Trading indicator generation:
[0169] By calculating all complete transactions within a unit of time, four transaction indicators can be obtained: transaction volume, response rate, success rate, and response time, among which:
[0170] Trading volume: the total number of transactions per unit time;
[0171] Response rate: the number of transactions with responses per unit time / the total number of transactions*100%;
[0172] Success rate: number of successful transactions per unit time / number of transactions with responses * 100%, where success is determined by the return code in the response;
[0173] Response time: The time it takes for a service to process a transaction, that is, the time difference between the request and the response.
[0174] Step 3: Tracking mode definition, divided into 2 types, as follows:
[0175] S1: Based on IP communication relationship, refer to Figure 2 :
[0176] In the specified time interval, all transactions that meet the conditions can be filtered out according to the timestamp in the transaction request, the global transaction serial number or the traceid in the transaction message:
[0177] Each transaction has a client IP (client_ip) and a server IP (server_ip). Suppose there are 4 transactions: A (client=ip1, server=ip2), B (client=ip2, server=ip3), C (client=ip3, server=ip4), D (client=ip2, server=ip5).
[0178] According to the relationship between the client IP and the server IP, the transaction link relationship can be obtained as follows: A->B->C, A->D;
[0179] S2: Based on OpenTelemetry, reference Figure 3 :
[0180] In the specified time interval, all transactions that meet the conditions can be filtered out according to the timestamp and traceid in the transaction request in the transaction message:
[0181] Each transaction has traceid, spanid, and parentid. Suppose there are 4 transactions: A (traceid=1, spanid=a, parentid=0), B (traceid=1, spanid=b, parentid=a), C (traceid=1, spanid=c, parentid=b), and D (traceid=1, spanid=d, parentid=a).
[0182] According to the association relationship of OpenTelemetry, the link relationship of the transaction can be obtained as follows: A->B->C, A->D.
[0183] Step 4: Implement transaction link aggregation tracking at different dimensional levels, as follows:
[0184] S1: defines the starting service node to be aggregated and tracked;
[0185] S2: defines the dimension to be aggregated and tracked, if transaction codes are used;
[0186] S3: Define the specific transaction code to be tracked;
[0187] S4: Define the type of serial number used for tracing, global transaction serial number or traceid, if traceid is used;
[0188] S5: In the specified time interval, filter out all transactions corresponding to the transaction code of the node, and obtain a set of traceids {traceid 1, traceid 2, ..., traceid n}. Preferably, we perform sampling settings, set a maximum transaction number threshold n, and obtain the traceid set of the first n transactions in chronological order;
[0189] S6: According to the selected tracking method, use the specified number of sampled transaction details to track the single transaction links respectively;
[0190] S7: Aggregate the tracking results of multiple transaction details and aggregate them according to the defined dimension. This time, the transaction code is used, so the node of the link graph selects the transaction code. If the transaction codes in different trackings are different, they need to be defined as different nodes, and finally the aggregated transaction link tracking graph is obtained;
[0191] S8: Based on the aggregated transaction link tracking graph, calculate the transaction indicators of each node: transaction volume, response rate, success rate, and response time.
[0192] S9: When changing to other aggregation dimensions, execute transaction link aggregation tracking according to the defined dimensions;
[0193] S10: After the tracking mode is changed, the transaction link aggregation tracking is performed according to the defined tracking mode.
[0194] Since different levels of aggregate tracking can be achieved according to custom dimensions, aggregate tracking of transaction links at levels such as transaction codes, transaction channels, services, and nodes can be achieved. This method is not limited to the several aggregation methods described above. If the transaction message carries relevant dimensions, this type of transaction link aggregate tracking can be achieved.
[0195] Those skilled in the art know that, in addition to realizing the system and its various devices, modules, and units provided by the present invention in a purely computer-readable program code, it is entirely possible to realize the same functions in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a hardware component, and the devices, modules, and units included therein for realizing various functions can also be regarded as structures within the hardware component; the devices, modules, and units for realizing various functions can also be regarded as both software modules for realizing the method and structures within the hardware component.
[0196] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.
Claims
1. A transaction link aggregation tracking method, characterized in that: include: Step S1: Collecting distributed environment transaction messages; Step S2: Generate message analysis and transaction indicators based on the collected transaction messages; Step S3: Define the tracking mode according to the transaction message; Step S4: According to the transaction indicators and tracking mode, the transaction link aggregation tracking at different dimensional levels is realized; In step S1: The collector is deployed in the Kubernetes environment through daemonset. The collector collects messages from the transaction system in a bypass mode. This collection method does not intrude into the business system. The business system contains a global transaction serial number or OpenTelemetry ID, where the OpenTelemetry ID contains three fields: traceid is the global tracing identifier, spanid is the span identifier, and parentid is the parent span identifier. When a transaction passes through different systems, the global transaction serial number and traceid remain unique. In step S2: Step S2.1: Decoding: The collected transaction message is sent to the backend server, which includes a decoding engine module. The decoding engine module uses a preset decoder to completely parse the message according to the characteristics of the transaction message, including the message header and message body. After decoding, a specific transaction record in key and value format is generated; Step S2.2: Association: The transaction records generated by the decoder engine are passed to the association module. The association module supports different association models. It implements the association of requests and responses based on the specific association fields and the synchronous and asynchronous characteristics of the transaction, and associates the transaction records into a complete transaction. Step S2.3: Dimension definition: Analyze the key dimensions of the transaction for subsequent aggregation, including: node, service, transaction code, transaction channel, return code, client IP and server IP; transactions with the same dimension are automatically aggregated, and their corresponding transaction indicators are aggregated according to the corresponding time interval; Step S2.4: Transaction link tracking field definition: parse the global transaction serial number, traceid, spanid, parentid in the transaction message. The global transaction serial number and traceid are unique within the preset time. This field is used to implement global transaction link tracking. Step S2.5: Transaction indicator generation: By calculating all complete transactions within a unit time, four transaction indicators are obtained: transaction volume, response rate, success rate, and response time, among which: Trading volume: the total number of transactions per unit time; Response rate: the number of transactions with responses per unit time / the total number of transactions * 100%; Success rate: number of successful transactions per unit time / number of transactions with responses * 100%, where success is determined by the return code in the response; Response time: the time it takes for a service to process a transaction, that is, the time difference between the request and the response; In step S3: Step S3.1: Based on IP communication relationship: In the specified time interval, according to the timestamp in the transaction request in the transaction message, the global transaction serial number or traceid, all transactions that meet the conditions are screened out: Each transaction has a client IP client_ip and a server IP server_ip; based on the relationship between the client IP and the server IP, the link relationship of the transaction is obtained; Step S3.2: Based on OpenTelemetry: In the specified time interval, according to the timestamp and traceid in the transaction request in the transaction message, all transactions that meet the conditions are screened out: each transaction has traceid, spanid, and parentid. According to the association relationship of OpenTelemetry, the link relationship of the transaction is obtained; In step S4: Achieve transaction link aggregation tracking at different dimensional levels, as follows: Step S4.1: define the starting service node to be aggregated and tracked; Step S4.2: Define the dimensions to be aggregated and tracked, if transaction codes are used; Step S4.3: define the specific transaction code to be tracked; Step S4.4: Define the type of serial number used for tracing, global transaction serial number or traceid, if traceid is used; Step S4.5: In the specified time interval, filter out all transactions corresponding to the transaction code of the node, and obtain the set of traceids {traceid 1, traceid 2, ..., traceid n}, perform sampling settings, set the maximum transaction number threshold n, and obtain the traceid set of the first n transactions in chronological order; Step S4.6: According to the selected tracking method, use the specified number of sampled transaction details to track the single transaction links respectively; Step S4.7: Aggregate the results of tracking multiple transaction details and aggregate them according to the defined dimension. This time, the transaction code is used, so the node of the link graph selects the transaction code. If the transaction codes in different trackings are different, they need to be defined as different nodes, and finally the aggregated transaction link tracking graph is obtained; Step S4.8: Based on the aggregated transaction link tracking graph, calculate the transaction indicators of each node: transaction volume, response rate, success rate, and response time; Step S4.9: When changing to another aggregation dimension, perform transaction link aggregation tracking according to the defined dimension; Step S4.10: After the tracking mode is changed, the transaction link aggregation tracking is performed according to the defined tracking mode.
2. A transaction link aggregation tracking system, characterized in that: include: Module M1: Collecting distributed environment transaction messages; Module M2: Generate message analysis and transaction indicators based on the collected transaction messages; Module M3: Define the tracking mode according to the transaction message; Module M4: Based on transaction indicators and tracking modes, realize transaction link aggregation tracking at different dimensional levels; In the module M1: The collector is deployed in the Kubernetes environment through daemonset. The collector collects messages from the transaction system in a bypass mode. This collection method does not intrude into the business system. The business system contains a global transaction serial number or OpenTelemetry ID, where the OpenTelemetry ID contains three fields: traceid is the global tracing identifier, spanid is the span identifier, and parentid is the parent span identifier. When a transaction passes through different systems, the global transaction serial number and traceid remain unique. In the module M2: Module M2.1: Decoding: Send the collected transaction messages to the backend server, which includes a decoding engine module. The decoding engine module uses a preset decoder to fully parse the message according to the characteristics of the transaction message, including the message header and message body. After decoding, a specific transaction record in key and value format is generated; Module M2.2: Association: The transaction records generated by the decoder engine are passed to the association module. The association module supports different association models. It implements the association of requests and responses based on the specific association fields and the synchronous and asynchronous characteristics of the transaction, and associates the transaction records into a complete transaction. Module M2.3: Dimension definition: Analyze the key dimensions of transactions for subsequent aggregation, including: node, service, transaction code, transaction channel, return code, client IP and server IP; transactions with the same dimension are automatically aggregated, and their corresponding transaction indicators are aggregated according to the corresponding time interval; Module M2.4: Transaction link tracking field definition: parse the global transaction serial number, traceid, spanid, parentid in the transaction message. The global transaction serial number and traceid are unique within the preset time. This field is used to implement global transaction link tracking. Module M2.5: Transaction indicator generation: By calculating all complete transactions within a unit time, four transaction indicators are obtained: transaction volume, response rate, success rate, and response time, among which: Trading volume: the total number of transactions per unit time; Response rate: the number of transactions with responses per unit time / the total number of transactions * 100%; Success rate: number of successful transactions per unit time / number of transactions with responses * 100%, where success is determined by the return code in the response; Response time: the time it takes for a service to process a transaction, that is, the time difference between the request and the response; In the module M3: Module M3.1: Based on IP communication relationship: In the specified time interval, according to the timestamp in the transaction request in the transaction message, the global transaction serial number or traceid, all transactions that meet the conditions are screened out: Each transaction has a client IP client_ip and a server IP server_ip; based on the relationship between the client IP and the server IP, the link relationship of the transaction is obtained; Module M3.2: Based on OpenTelemetry: In the specified time interval, all transactions that meet the conditions are screened out according to the timestamp and traceid in the transaction request in the transaction message: each transaction has traceid, spanid, and parentid. According to the association relationship of OpenTelemetry, the link relationship of the transaction is obtained; In the module M4: Achieve transaction link aggregation tracking at different dimensional levels, as follows: Module M4.1: Define the starting service node to be aggregated and tracked; Module M4.2: Define the dimensions to be tracked in aggregate, if transaction codes are used; Module M4.3: Define the specific transaction codes to be tracked; Module M4.4: Define the type of serial number used for tracing, global transaction serial number or traceid, if traceid is used; Module M4.5: In the specified time interval, filter out all transactions corresponding to the transaction code of the node, and obtain the set of traceids {traceid 1, traceid 2, ..., traceid n}, perform sampling settings, set the maximum transaction number threshold n, and obtain the traceid set of the first n transactions in chronological order; Module M4.6: Based on the selected tracking method, use the specified number of sampled transaction details to track the single transaction link; Module M4.7: Aggregate the results of tracking multiple transaction details and aggregate them according to the defined dimensions. This time, the transaction code is used, so the node of the link graph selects the transaction code. If the transaction codes in different trackings are different, they need to be defined as different nodes, and finally the aggregated transaction link tracking graph is obtained; Module M4.8: Based on the aggregated transaction link tracking graph, calculate the transaction indicators of each node: transaction volume, response rate, success rate, and response time; Module M4.9: When changing to other aggregation dimensions, perform transaction link aggregation tracking according to the defined dimensions; Module M4.10: When the tracking mode is changed, the transaction link aggregation tracking is performed according to the defined tracking mode.
Citation Information
Patent Citations
Layered topological graph generation method and device, equipment and storage medium
CN118606097A
Transaction link tracking method and device
CN116340171A
Data processing method and device, electronic equipment, medium and program product
CN116483890A
Full-link transaction view construction method and device, electronic equipment and storage medium
CN118261703A