Link tracking method and system
By integrating the link tracking system in the microservice architecture, collecting and analyzing call information, the problem of request link tracking in the microservice architecture is solved, effectively monitoring and troubleshooting of the call link is realized, and the system maintainability is improved .
Patent Information
- Application Number
- CN202411348007.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-01-14
AI Technical Summary
In microservice architecture, it is difficult to effectively monitor and track call links requested by users, resulting in complex troubleshooting and performance optimization.
A link tracking method and system is designed, including message services, early warning services and analysis services. By integrating the acquisition components in the microservice node, collecting call information and writing to the message queue, the message service writes data to the timing database and logs. Database, the early warning service monitors faults based on the timing database and sends early warning notifications, and analyzes the service to generate a call link map.
It realizes complete tracking of request call links in the microservice architecture, and supports system monitoring, troubleshooting and performance optimization.
Smart Images

Figure CN119311514A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a link tracking method and system. Background Art
[0002] With the rapid development of information technology, the scale and complexity of software systems are increasing. In response to this growth, the field of software development has gradually adopted the Microservices Architecture to build scalable, highly available distributed systems. The Microservices Architecture decomposes traditional monolithic applications into multiple small, independent service units, each of which is built around a specific business function and can be deployed and expanded independently. This architectural model greatly improves the flexibility and maintainability of the system, but it also introduces the complexity of interactions between services, which poses new challenges to the monitoring, debugging, and optimization of the system.
[0003] In traditional monolithic applications, the request processing flow is relatively simple and easy to monitor and debug. However, in a microservice architecture, a user request may need to be processed by multiple services in a coordinated manner. To troubleshoot or optimize performance in a microservice architecture, it is necessary to consider how to obtain the complex request chain of user requests in a distributed system. Summary of the invention
[0004] The purpose of the present invention is to provide a link tracking method and system to improve the problems existing in the prior art.
[0005] The embodiments of the present invention can be implemented as follows:
[0006] In a first aspect, the present invention provides a link tracking method, which is applied to a link tracking system, wherein the link tracking system includes a message service, an early warning service, an analysis service, and a plurality of collection components, each of which is integrated into a microservice node of a microservice system; the link tracking system maintains a message queue; the method includes:
[0007] When any microservice node of the microservice system is called, the collection component integrated in the microservice node collects the call information and writes the call information into the message queue;
[0008] The message service writes the data in the message queue into a time series database and a log database;
[0009] The early warning service monitors the microservice system for faults based on the time series database, and sends an early warning notification to a designated receiving end when a preset early warning rule is triggered; the early warning notification includes an early warning message and an analysis link;
[0010] When receiving the analysis request from the designated receiving end, the analysis service generates a call link graph of the request to be analyzed based on the tracking identifier of the request to be analyzed carried in the analysis request and the log database; the analysis request is generated after the designated receiving end perceives that the user clicks on the analysis link.
[0011] In an optional implementation manner, the warning service maintains a plurality of preset warning rules and a warning template corresponding to each of the warning rules;
[0012] The step of the early warning service monitoring the microservice system for faults based on the time series database and sending an early warning notification to a designated receiving end when a preset early warning rule is triggered includes:
[0013] The early warning service obtains a plurality of call information from the time series database at a set period;
[0014] The warning service matches each call information with each warning rule one by one;
[0015] If any target call information has a matching target warning rule, the warning service obtains each field to be filled from the target warning template corresponding to the target warning rule;
[0016] The warning service searches for the field value of each field to be filled in the target call information, and fills each found field value into the target warning template to obtain a warning message;
[0017] The warning service generates the warning notification based on the warning message, and sends the warning notification to the designated receiving end.
[0018] In an optional implementation, after the warning service fills each found field value into the target warning template to obtain a warning message, the warning service monitors the microservice system for faults based on the time series database, and sends a warning notification to a designated receiving end when a preset warning rule is triggered, the step further includes:
[0019] The warning service obtains the tracking identifier carried in each target call information when the number of the target call information is not unique;
[0020] If the tracking identifiers carried by at least any two target call information are the same, the warning service merges the warning messages corresponding to the at least any two target call information.
[0021] In an optional implementation, when the analysis service receives the analysis request from the designated receiving end, the step of generating a call chain graph of the request to be analyzed based on the tracking identifier of the request to be analyzed carried by the analysis request and the log database includes:
[0022] When receiving the analysis request from the designated receiving end, the analysis service obtains the time range data carried by the analysis request and the tracking identifier of the request to be analyzed;
[0023] The analysis service searches the log database for a plurality of matching pieces of in-use call information based on the time range data and the tracking identifier;
[0024] The analysis service generates the call chain graph based on all pending call information.
[0025] In an optional embodiment, the method further comprises:
[0026] The analysis service returns the call chain graph to the designated receiving end, so that the designated receiving end displays the call chain graph on an analysis interface; the analysis interface also includes a disposal input box;
[0027] The analysis service receives the early warning handling solution sent by the designated receiving end, and the early warning handling solution is input by the user in the handling input box.
[0028] In a second aspect, the present invention provides a link tracking system, the link tracking system comprising a message service, an early warning service, an analysis service and a plurality of collection components, each of the collection components being integrated into a microservice node of a microservice system; the link tracking system maintaining a message queue;
[0029] When any microservice node of the microservice system is called, the collection component integrated in the microservice node is used to collect the call information and write the call information into the message queue;
[0030] The message service is used to write the data in the message queue into a time series database and a log database;
[0031] The warning service is used to monitor the microservice system for faults based on the time series database, and send a warning notification to a designated receiving end when a preset warning rule is triggered; the warning notification includes a warning message and an analysis link;
[0032] The analysis service is used to generate a call link graph of the request to be analyzed based on the tracking identifier of the request to be analyzed carried in the analysis request and the log database when receiving the analysis request from the designated receiving end; the analysis request is generated after the designated receiving end perceives that the user clicks on the analysis link.
[0033] In an optional implementation, the warning service maintains a plurality of preset warning rules and a warning template corresponding to each of the warning rules; the warning service is used to monitor the microservice system for faults based on the time series database, and to send a warning notification to a designated receiving end when the preset warning rule is triggered, specifically for:
[0034] Acquire multiple call information from the time series database at every set period;
[0035] Match each call information with each of the warning rules one by one;
[0036] If there is a matching target warning rule for any target call information, then each field to be filled is obtained from the target warning template corresponding to the target warning rule;
[0037] Find out the field value of each field to be filled in the target call information, and fill each found field value into the target warning template to obtain a warning message;
[0038] The warning notification is generated based on the warning message, and the warning notification is sent to the designated receiving end.
[0039] In an optional implementation manner, after being used to fill each found field value into the target warning template to obtain a warning message, the warning service is further used to:
[0040] The warning service obtains the tracking identifier carried in each target call information when the number of the target call information is not unique;
[0041] If the tracking identifiers carried by at least any two target call information are the same, the warning service merges the warning messages corresponding to the at least any two target call information.
[0042] In an optional implementation manner, the analysis service is used to, when receiving the analysis request from the designated receiving end, generate a call chain graph of the request to be analyzed based on the tracking identifier of the request to be analyzed carried by the analysis request and the log database, specifically to:
[0043] When receiving the analysis request from the designated receiving end, obtaining the time range data carried by the analysis request and the tracking identifier of the request to be analyzed;
[0044] Based on the time range data and the tracking identifier, searching for a plurality of matching target call information from the log database;
[0045] The call chain graph is generated based on all target call information.
[0046] In an optional embodiment, the analysis service is further used to:
[0047] Returning the call chain graph to the designated receiving end so that the designated receiving end displays the call chain graph on an analysis interface; the analysis interface further includes a disposal input box;
[0048] Receive the early warning disposal plan sent by the designated receiving end, where the early warning disposal plan is input by the user in the disposal input box.
[0049] Compared with the prior art, the embodiment of the present invention provides a link tracking method and system, which is applied to a link tracking system, and the link tracking system includes a message service, an early warning service, an analysis service and multiple collection components, each of which is integrated in a microservice node of a microservice system; the link tracking system maintains a message queue. When any microservice node of the microservice system is called, the collection component integrated in the microservice node collects the call information and writes the call information into the message queue; the message service writes the data in the message queue into a time series database and a log database; the early warning service monitors the microservice system for faults based on the time series database, and sends an early warning notification to the designated receiving end when the preset early warning rule is triggered; the early warning notification includes an early warning message and an analysis link; when the analysis service receives an analysis request from a designated receiving end, it generates a call link diagram of the request to be analyzed based on the tracking identifier of the request to be analyzed carried by the analysis request and the log database; the analysis request is generated after the designated receiving end perceives that the user clicks the analysis link. The present invention can effectively track the complete call link of the request in the microservice architecture, thereby providing support for system monitoring, troubleshooting, and performance optimization. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0051] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present invention.
[0052] Figure 2 One of the flowcharts of a link tracking method provided by an embodiment of the present invention.
[0053] Figure 3 The second flowchart of a link tracking method provided by an embodiment of the present invention.
[0054] Figure 4 The third flowchart of a link tracking method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0056] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. 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.
[0057] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0058] In the description of the present invention, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear to indicate an orientation or position relationship, they are based on the orientation or position relationship shown in the accompanying drawings, or are the orientation or position relationship in which the product of the invention is usually placed when used. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0059] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.
[0060] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.
[0061] Please refer to Figure 1 , Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present invention. The microservice system includes multiple microservice nodes ( Figure 1 The link tracking system of the present invention includes a message service, an early warning service, an analysis service, multiple collection components, a message queue, a time series database and a log database, wherein each collection component is integrated into a microservice node of the microservice system.
[0062] Optionally, the collection component can be implemented based on Feign's interceptor technology. The microservice node is an application service deployed in a container, and the development kit of the collection component can be embedded in the application service.
[0063] Optionally, message queues are used to decouple communication between services and provide asynchronous processing capabilities. Kafka or RabbitMQ can be used. The time series database can use the Prometheus database, because the Prometheus database is a time series database designed specifically for processing timestamp data and is very suitable for storing monitoring data. The log database can use the ElasticSearch database, which is essentially a source-distributed full-text search engine, mainly used for full-text search, real-time data analysis, log aggregation, and real-time monitoring.
[0064] Please refer to Figure 2 , Figure 2 The present invention provides a flow chart of a link tracking method according to an embodiment of the present invention, wherein the link tracking method is applied to the above-mentioned link tracking system. The link tracking method includes the following steps S101 to S104.
[0065] S101. When any microservice node of the microservice system is called, a collection component integrated in the microservice node collects call information and writes the call information into a message queue.
[0066] In this embodiment, when any microservice node of the microservice system is called, the collection component integrated in the microservice node will check whether there is a trace identifier (i.e., Trace ID, which is used to uniquely identify a complete request link) in the call request. If not, a trace identifier is generated to be embedded in the call request. When the microservice node completes the processing of the call request (the call is successful or failed), the collection component can collect the call information. When a request is passed from the previous microservice node to the next microservice node, it carries the Trace ID and the Parent ID, Span ID, and Service ID added by the previous microservice node A, where:
[0067] Trace ID is a tracing identifier, which is a unique identifier of a request. In a microservice system, a request is usually processed by multiple microservice nodes. Trace ID can be used to track the request path, transmit information on the call chain, and perform analysis and monitoring;
[0068] Parent ID is the parent identifier, also known as Parent Span ID, which is used to establish the relationship between different microservices in the request call link. It represents the parent Span ID of the current Span ID. When a microservice node receives a request, it uses the Span ID of the previous microservice node as its own Parent ID. By passing the Parent ID, the call path of the request can be traced and the parent-child relationship can be established, making the entire call link orderly and traceable;
[0069] Span ID is a span identifier used to identify a single microservice processing process. In a microservice system, when a microservice node receives a request, it adds 1 to the Span ID of the previous microservice node carried in the request to obtain the Span ID of the current microservice node;
[0070] Service ID is a service identifier, which is used to uniquely identify a microservice node. In a microservice system, each microservice node has its own Service ID.
[0071] Therefore, the call information collected by the collection component may include but is not limited to: tracking identifier, parent identifier, span identifier, service identifier, URL (Uniform Resource Location), input parameters, output parameters, request time, response time, IP address, response result, exception information, etc.
[0072] S102: The message service writes the data in the message queue into the time series database and the log database.
[0073] In this embodiment, when the message service writes the data in the message queue into the time series database and the log database, it may involve format conversion, compression, aggregation, etc. of the data.
[0074] Optionally, a retry mechanism can be supported when writing data to the time series database and log database, that is, if the write fails after three consecutive retries, the data will be discarded.
[0075] S103: The early warning service monitors the microservice system for faults based on the time series database, and sends an early warning notification to a designated receiving end when a preset early warning rule is triggered.
[0076] In this embodiment, the warning notification may include a warning message and an analysis link.
[0077] S104: When receiving an analysis request from a designated receiving end, the analysis service generates a call chain diagram of the request to be analyzed based on the tracking identifier of the request to be analyzed carried in the analysis request and the log database.
[0078] In this embodiment, the analysis request is generated after the designated receiving end senses that the user clicks the analysis link. The designated receiving end may be a user terminal logged in to a designated social account or a designated mailbox.
[0079] The method provided by the embodiment of the present invention is applied to a link tracking system, which includes a message service, an early warning service, an analysis service and multiple collection components, each of which is integrated in a microservice node of a microservice system; the link tracking system maintains a message queue. When any microservice node of the microservice system is called, the collection component integrated in the microservice node collects the call information and writes the call information into the message queue; the message service writes the data in the message queue into a time series database and a log database; the early warning service monitors the microservice system for faults based on the time series database, and sends an early warning notification to the designated receiving end when the preset early warning rule is triggered; the early warning notification includes an early warning message and an analysis link; when the analysis service receives an analysis request from the designated receiving end, it generates a call link diagram of the request to be analyzed based on the tracking identifier of the request to be analyzed carried by the analysis request and the log database; the analysis request is generated after the designated receiving end perceives that the user clicks the analysis link. The present invention can effectively track the complete call link of the request in the microservice architecture, thereby providing support for system monitoring, troubleshooting, and performance optimization.
[0080] In an optional implementation, the warning service may maintain a number of preset warning rules and a warning template corresponding to each warning rule. Figure 2 Based on Figure 3 The sub-steps of the above step S103 may include S1031 to S1035.
[0081] S1031. The early warning service obtains multiple call information from the time series database at every set period.
[0082] In this embodiment, the setting period can be set based on the request processing frequency of the microservice system. For example, the setting period can be 10 minutes or 5 minutes. This example is only an example and is not limited here.
[0083] It can be understood that, at every set period, the early warning service can obtain from the time series database a plurality of call information whose response time is within the set period.
[0084] S1032. The warning service matches each call information with each warning rule one by one.
[0085] S1033. If there is a matching target warning rule for any target call information, the warning service obtains each field to be filled in from the target warning template corresponding to the target warning rule.
[0086] S1034. The warning service searches for the field value of each field to be filled in the target call information, and fills each found field value into the target warning template to obtain a warning message.
[0087] In this embodiment, the warning service will match each call information with each warning rule one by one. If any target call information has a matching target warning rule, the warning service will continue to obtain each field to be filled in the target warning template corresponding to the target warning rule, and then find the field value of each field to be filled in from the target call information, and fill each found field value into the target warning template to obtain a warning message.
[0088] In the optional example, assume that the target warning template is (the fields in the curly brackets are to be filled in):
[0089] [{curreTime}, the interface address of {serviceName} is: {url}, in the past {time1} minutes, there were two accesses that exceeded {time2} milliseconds, tracking identifier: {Trace ID}].
[0090] Correspondingly, based on the target warning template, the generated warning message can be:
[0091] At 11:23 on August 22, 2024, the interface address of the taxi service was: / taxi / query_station. In the past 10 minutes, there were two visits exceeding 500 milliseconds, with the tracking identifier: track_10000.
[0092] This example is only an example and is not intended to be limiting.
[0093] S1035. The warning service generates a warning notification based on the warning message and sends the warning notification to a designated receiving end.
[0094] In this embodiment, an analysis link may be generated based on the access address of the analysis service, the request identifier in the warning message, and the time information, so that the warning message and the analysis link may be combined to obtain a warning notification.
[0095] Optionally, the target call information refers to the call information that matches the warning rule. Each target call information may match more than one warning rule, so more than one warning notification will be generated.
[0096] In the case where the number of target call information is not unique, if the tracking identifiers in at least two target call information are the same, the warning messages can be merged. Correspondingly, after the above step S1034, the link tracking method can also include S103a-S103b:
[0097] S103a, when the number of target call information is not unique, the warning service obtains the tracking identifier carried in each target call information;
[0098] S103b: If the tracking identifiers carried by at least any two target call information are the same, the warning service merges the warning messages corresponding to the at least any two target call information.
[0099] In this embodiment, if the tracking identifiers carried by at least any two target call information are the same, the warning service will merge the warning messages corresponding to the at least any two target call information to obtain a new warning message.
[0100] In an optional implementation, when a user sees a warning notification on a designated receiving end, he or she can click on the analysis link in the warning notification, so that the designated receiving end can generate an analysis request and send the analysis request to the analysis service, and the analysis service can generate a call chain diagram in a timely manner. Figure 2 Based on Figure 4 The sub-steps of the above step S104 may include S1041 to S1043.
[0101] S1041. When receiving an analysis request from a designated receiving end, the analysis service obtains the time range data carried in the analysis request and the tracking identifier of the request to be analyzed.
[0102] In an optional example, the time range data carried by the analysis request may be within the first 10 minutes of 11:23 on August 22, 2024, and the request identifier of the request to be analyzed may be track_10000. This example is only an example and is not limited here.
[0103] S1042: The analysis service searches for multiple matching pieces of standby call information from a log database based on the time range data and the tracking identifier.
[0104] In this embodiment, the analysis service can search the log database for multiple pieces of standby call information whose response times belong to the time range data and whose tracking identifiers are consistent with the tracking identifiers of the request to be analyzed.
[0105] S1043. The analysis service generates a call chain graph based on all the standby call information.
[0106] The analysis service can analyze the call link of the request to be analyzed in the microservice system based on the Parent ID, Span ID, and Service ID in each pending call information, and obtain a call link graph. The call link graph is a tree graph, in which each node represents a microservice node, and the node attributes may include service ID, URL, response time, input parameter, output parameter, request time, response time, IP address, response result, exception information and other data.
[0107] Optionally, the link tracing method may further include:
[0108] S105. The analysis service returns the call link graph to the designated receiving end, so that the designated receiving end displays the call link graph on the analysis interface.
[0109] In this embodiment, the analysis service returns the call chain graph to the designated receiving end, so that the designated receiving end can jump to the analysis interface of the analysis service, which includes the call chain graph and a disposal input box.
[0110] S106. The analysis service receives the early warning disposal plan sent by the designated receiving end.
[0111] In this embodiment, the user can input the early warning disposal plan in the disposal input box. For example, the early warning disposal plan may include whether the current early warning needs to be disposed, the disposal method to be adopted, etc.
[0112] The present invention also provides a link tracking system, which includes a message service, an early warning service, an analysis service and a plurality of collection components, each of which is integrated into a microservice node of a microservice system; the link tracking system maintains a message queue;
[0113] When any microservice node of the microservice system is called, the collection component integrated in the microservice node is used to collect the call information and write the call information into the message queue;
[0114] The message service is used to write data in the message queue into the time series database and log database;
[0115] The warning service is used to monitor the faults of the microservice system based on the time series database, and send warning notifications to the designated receiving end when the preset warning rules are triggered; the warning notifications include warning messages and analysis links;
[0116] The analysis service is used to generate a call chain diagram of the request to be analyzed based on the tracking identifier of the request to be analyzed carried in the analysis request and the log database when receiving an analysis request from a specified receiving end; the analysis request is generated after the specified receiving end perceives that the user clicks the analysis link.
[0117] Optionally, the warning service maintains several preset warning rules and warning templates corresponding to each warning rule; the warning service is used to monitor the microservice system for faults based on the time series database, and send warning notifications to the designated receiving end when the preset warning rules are triggered. Specifically, it is used to: obtain multiple call information from the time series database at set intervals; match each call information with each warning rule one by one; if any target call information has a matching target warning rule, obtain each to-be-filled field from the target warning template corresponding to the target warning rule; find out the field value of each to-be-filled field from the target call information, and fill each found field value into the target warning template to obtain a warning message; generate a warning notification based on the warning message, and send the warning notification to the designated receiving end.
[0118] Optionally, after the warning service is used to fill each found field value into the target warning template to obtain a warning message, the warning service is also used to: when the number of target call information is not unique, obtain the tracking identifier carried in each target call information; if the tracking identifiers carried by at least any two target call information are the same, the warning service will merge the warning messages corresponding to at least any two target call information.
[0119] Optionally, the analysis service is used to generate a call chain graph of the request to be analyzed based on the tracing identifier of the request to be analyzed carried in the analysis request and the log database when receiving an analysis request from a specified receiving end. Specifically, it is used to: when receiving an analysis request from a specified receiving end, obtain the time range data carried in the analysis request and the tracing identifier of the request to be analyzed; based on the time range data and the tracing identifier, search for multiple matching target call information from the log database; and generate a call chain graph based on all target call information.
[0120] Optionally, the analysis service is also used to: return the call link diagram to the designated receiving end so that the designated receiving end displays the call link diagram on the analysis interface; the analysis interface also includes a disposal input box; receive the early warning disposal plan sent by the designated receiving end, the early warning disposal plan is entered by the user in the disposal input box.
[0121] In summary, the embodiment of the present invention provides a link tracking method and system, which is applied to a link tracking system, and the link tracking system includes a message service, an early warning service, an analysis service and multiple collection components, each of which is integrated in a microservice node of a microservice system; the link tracking system maintains a message queue. When any microservice node of the microservice system is called, the collection component integrated in the microservice node collects the call information and writes the call information into the message queue; the message service writes the data in the message queue into the time series database and the log database; the early warning service monitors the microservice system for faults based on the time series database, and sends an early warning notification to the designated receiving end when the preset early warning rule is triggered; the early warning notification includes an early warning message and an analysis link; when the analysis service receives an analysis request from a designated receiving end, it generates a call link diagram of the request to be analyzed based on the tracking identifier of the request to be analyzed carried by the analysis request and the log database; the analysis request is generated after the designated receiving end perceives that the user clicks the analysis link. The present invention can effectively track the complete call link of the request in the microservice architecture, thereby providing support for system monitoring, troubleshooting, and performance optimization.
[0122] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A link tracking method, characterized in that: Applied to a link tracking system, the link tracking system includes a message service, an early warning service, an analysis service and a plurality of collection components, each of the collection components being integrated into a microservice node of a microservice system; The link tracking system maintains a message queue; the method comprises: When any microservice node of the microservice system is called, the collection component integrated in the microservice node collects the call information and writes the call information into the message queue; The message service writes the data in the message queue into a time series database and a log database; The early warning service monitors the microservice system for faults based on the time series database, and sends an early warning notification to a designated receiving end when a preset early warning rule is triggered; the early warning notification includes an early warning message and an analysis link; When receiving the analysis request from the designated receiving end, the analysis service generates a call link graph of the request to be analyzed based on the tracking identifier of the request to be analyzed carried in the analysis request and the log database; the analysis request is generated after the designated receiving end perceives that the user clicks on the analysis link.
2. The method according to claim 1, characterized in that The warning service maintains a number of preset warning rules and a warning template corresponding to each warning rule; The step of the early warning service monitoring the microservice system for faults based on the time series database and sending an early warning notification to a designated receiving end when a preset early warning rule is triggered includes: The early warning service obtains a plurality of call information from the time series database at a set period; The warning service matches each call information with each warning rule one by one; If any target call information has a matching target warning rule, the warning service obtains each field to be filled from the target warning template corresponding to the target warning rule; The warning service searches for the field value of each field to be filled in the target call information, and fills each found field value into the target warning template to obtain a warning message; The warning service generates the warning notification based on the warning message, and sends the warning notification to the designated receiving end.
3. The method according to claim 2, characterized in that After the step of filling each found field value into the target warning template by the warning service to obtain a warning message, the step of monitoring the microservice system for faults based on the time series database and sending a warning notification to a designated receiving end when a preset warning rule is triggered also includes: The warning service obtains the tracking identifier carried in each target call information when the number of the target call information is not unique; If the tracking identifiers carried by at least any two target call information are the same, the warning service merges the warning messages corresponding to the at least any two target call information.
4. The method according to claim 1, characterized in that: When the analysis service receives the analysis request from the designated receiving end, the step of generating a call chain graph of the request to be analyzed based on the tracking identifier of the request to be analyzed carried by the analysis request and the log database includes: When receiving the analysis request from the designated receiving end, the analysis service obtains the time range data carried by the analysis request and the tracking identifier of the request to be analyzed; The analysis service searches the log database for a plurality of matching pieces of in-use call information based on the time range data and the tracking identifier; The analysis service generates the call chain graph based on all pending call information.
5. The method according to claim 1, characterized in that The method further comprises: The analysis service returns the call chain graph to the designated receiving end, so that the designated receiving end displays the call chain graph on an analysis interface; the analysis interface also includes a disposal input box; The analysis service receives the early warning handling solution sent by the designated receiving end, and the early warning handling solution is input by the user in the handling input box.
6. A link tracking system, characterized in that: The link tracking system includes a message service, an early warning service, an analysis service and a plurality of collection components, each of which is integrated into a microservice node of the microservice system; The link tracking system maintains a message queue; When any microservice node of the microservice system is called, the collection component integrated in the microservice node is used to collect the call information and write the call information into the message queue; The message service is used to write the data in the message queue into a time series database and a log database; The early warning service is used to monitor the microservice system for faults based on the time series database, and send an early warning notification to a designated receiving end when a preset early warning rule is triggered; The warning notification includes a warning message and an analysis link; The analysis service is used to generate a call link graph of the request to be analyzed based on the tracking identifier of the request to be analyzed carried in the analysis request and the log database when receiving the analysis request from the designated receiving end; the analysis request is generated after the designated receiving end perceives that the user clicks on the analysis link.
7. The method according to claim 6, characterized in that The warning service maintains a number of preset warning rules and warning templates corresponding to each warning rule; the warning service is used to monitor the microservice system for faults based on the time series database, and send a warning notification to a designated receiving end when the preset warning rule is triggered, specifically for: Acquire multiple call information from the time series database at every set period; Match each call information with each of the warning rules one by one; If there is a matching target warning rule for any target call information, then each field to be filled is obtained from the target warning template corresponding to the target warning rule; Find out the field value of each field to be filled in the target call information, and fill each found field value into the target warning template to obtain a warning message; The warning notification is generated based on the warning message, and the warning notification is sent to the designated receiving end.
8. The method according to claim 7, characterized in that After the warning service is used to fill each found field value into the target warning template to obtain a warning message, it is also specifically used to: The warning service obtains the tracking identifier carried in each target call information when the number of the target call information is not unique; If the tracking identifiers carried by at least any two target call information are the same, the warning service merges the warning messages corresponding to the at least any two target call information.
9. The method according to claim 6, characterized in that The analysis service is used to, when receiving the analysis request from the designated receiving end, generate a call chain graph of the request to be analyzed based on the tracking identifier of the request to be analyzed carried by the analysis request and the log database, specifically to: When receiving the analysis request from the designated receiving end, obtaining the time range data carried by the analysis request and the tracking identifier of the request to be analyzed; Based on the time range data and the tracking identifier, searching for a plurality of matching target call information from the log database; The call chain graph is generated based on all target call information.
10. The method according to claim 6, characterized in that The analytical services are also used to: Returning the call chain graph to the designated receiving end so that the designated receiving end displays the call chain graph on an analysis interface; the analysis interface further includes a disposal input box; Receive the early warning disposal plan sent by the designated receiving end, where the early warning disposal plan is input by the user in the disposal input box.
Citation Information
Cited By
Message tracking circuit and system
CN121501585A