CN-116366487-B - Method for monitoring link abnormality and tracking abnormality in service request
Abstract
The invention relates to a method for monitoring link abnormality and tracking abnormality in a service request, belonging to the technical field of monitoring service abnormality, comprising the steps of requesting a service meeting to associate and call at least one micro-service and generating a request ID at the same time; the method comprises the steps of associating link data with a request ID by utilizing a hystrix signal quantity mode service, monitoring micro services recorded in the link data, performing byte code instrumentation processing on each micro service by utilizing a javassist byte code instrumentation service, performing link abnormality tracking through the javassist byte code instrumentation service when the micro services are monitored to be abnormal, and obtaining abnormal information, wherein the link abnormality monitoring and the link abnormality tracking can be realized by combining the hystrix signal quantity mode service with the javassist byte code instrumentation service, so that the efficiency of locating abnormality of technicians can be improved, and the speed of processing abnormal micro services can be accelerated.
Inventors
- XU WENHAO
Assignees
- 上海中通吉网络技术有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20230306
Claims (5)
- 1. A method for link anomaly monitoring and anomaly tracking in a service request, the method comprising: requesting a service to associate with invoking at least one micro-service while generating a request ID; acquiring all micro-service information related to the request by utilizing the hystrix signal quantity mode service, storing the information as link data, associating the link data with a request ID, and monitoring micro-services recorded in the link data; Performing byte code instrumentation processing on each micro-service in the process of calling the micro-service in an associated manner by utilizing javassist byte code instrumentation services; When the micro-service recorded in the link data is monitored to be abnormal, link abnormality tracking is carried out through javassist byte code instrumentation service, and abnormality information is obtained; counting abnormal information and pushing the abnormal information to related technicians in real time; When the micro-service recorded in the link data is monitored to be abnormal, carrying out link abnormality tracking through javassist byte code instrumentation service, and acquiring abnormality information, wherein the abnormal information comprises that the hypotrix signal quantity mode service monitors the micro-service to be abnormal through signal quantity and records an abnormality position; the javassist byte code instrumentation service is used for acquiring the abnormal information by pre-instrumentation of the byte code of the micro service according to the abnormal position, wherein the abnormal information in the micro service with the abnormality is analyzed by the javassist byte code instrumentation service after the abnormal micro service is tracked by the javassist byte code instrumentation service link according to the abnormal position, and the abnormal information comprises calling parameters, returned data and abnormal description when the micro service is called.
- 2. The method of claim 1, wherein the acquiring all micro-services information involved in the request using the hymix semaphore mode service and storing the same as link data, associating the link data with the request ID, and simultaneously monitoring micro-services recorded in the link data, comprises: acquiring all micro-service information related to the request; Storing the micro-service information as link data, wherein the link data comprises traceid and traceid which are unique identifiers of the link data; Associating link data with the request ID through traceid using a hystrix semaphore mode service; the micro-services recorded in the link data are monitored by semaphores in the hystrix semaphore mode service.
- 3. The method of claim 2, wherein the performing the bytecode instrumentation process on each micro-service during the associated call to the micro-service using javassist bytecode instrumentation services comprises: Acquiring micro-service information in the link data; Extracting the number of micro services and a calling path from the micro service information; and calling the micro-services one by one through the calling path, and performing byte code instrumentation operation on the calling parameters and the returned data in the micro-service calling process by utilizing javassist byte code instrumentation service.
- 4. The method as recited in claim 1, further comprising: when the abnormal information is counted, the abnormal information is stored in a local server in a queue mode, and/or, And storing the abnormal information to a cloud server in a queue mode when the abnormal information is counted.
- 5. An electronic device, comprising: At least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
Description
Method for monitoring link abnormality and tracking abnormality in service request Technical Field The application belongs to the technical field of service anomaly monitoring, and particularly relates to a method for monitoring link anomalies and tracking anomalies in a service request. Background At present, under the micro-service technology architecture, one request often goes through from A service to B service to C service to other multiple services, and can be completed through the call of the multiple services, if one of the services is abnormal in the whole link calling the service, the whole link will be wrong, and technicians need to go from A to C to other multiple services to check one by one when checking the abnormality, so that the efficiency of positioning and processing the abnormality is extremely low. Aiming at the scene, the prior art provides sleuth components by utilizing springcloud component library, service interfaces and call links involved in the whole request process can be clearly checked through traceid by the components, so that the whole call process can be clearly known, but exception monitoring and exception tracking can not be carried out on micro-services in the links, and the problems that technicians can not quickly locate abnormal micro-services and can not quickly process the abnormality are caused. Disclosure of Invention Therefore, the invention provides a large-scale explosion damage information calculation method and a large-scale explosion damage information calculation system, which are used for solving the problems that technicians cannot quickly locate abnormal micro-services and cannot quickly process the abnormal micro-services in the prior art. In order to achieve the above purpose, the invention adopts the following technical scheme: In a first aspect, the present invention provides a method for monitoring link anomalies and tracking anomalies in a service request, including: requesting a service to associate with invoking at least one micro-service while generating a request ID; acquiring all micro-service information related to the request by utilizing the hystrix signal quantity mode service, storing the information as link data, associating the link data with a request ID, and monitoring micro-services recorded in the link data; Performing byte code instrumentation processing on each micro-service in the process of calling the micro-service in an associated manner by utilizing javassist byte code instrumentation services; When the micro-service recorded in the link data is monitored to be abnormal, link abnormality tracking is carried out through javassist byte code instrumentation service, and abnormality information is obtained; And counting the abnormal information and pushing the abnormal information to related technicians in real time. Further, obtaining all micro-service information involved in the request by utilizing the hystrix signal quantity mode service and storing the information as link data, associating the link data with the request ID, and monitoring the micro-service recorded in the link data, wherein the method comprises the following steps: acquiring all micro-service information related to the request; Storing the micro-service information as link data, wherein the link data comprises traceid and traceid which are unique identifiers of the link data; Associating link data with the request ID through traceid using a hystrix semaphore mode service; the micro-services recorded in the link data are monitored by semaphores in the hystrix semaphore mode service. Further, the performing byte code instrumentation processing on each micro service in the process of calling the micro service in an associated manner by utilizing javassist byte code instrumentation services comprises: Acquiring micro-service information in the link data; Extracting the number of micro services and a calling path from the micro service information; and calling the micro-services one by one through the calling path, and performing byte code instrumentation operation on the calling parameters and the returned data in the micro-service calling process by utilizing javassist byte code instrumentation service. Further, when the monitoring that the micro service recorded in the link data is abnormal, performing link abnormality tracking through javassist byte code instrumentation service, and acquiring abnormality information, including: the hystrix signal quantity mode service monitors that the micro service is abnormal through the signal quantity, and records the abnormal position; the hystrix semaphore mode service sends the abnormal position to javassist byte code instrumentation service; And combining the abnormal positions, and enabling javassist byte code instrumentation service to acquire abnormal information by pre-instrumentation of byte codes of the micro service. Further, the combining abnormal position, javassist bytecode instrumentation service obtains