CN112416708B - Asynchronous call link monitoring method and system - Google Patents

Asynchronous call link monitoring method and system Download PDF

Info

Publication number
CN112416708B
CN112416708B CN202011284470.7A CN202011284470A CN112416708B CN 112416708 B CN112416708 B CN 112416708B CN 202011284470 A CN202011284470 A CN 202011284470A CN 112416708 B CN112416708 B CN 112416708B
Authority
CN
China
Prior art keywords
link
service request
monitoring
context
asynchronous call
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011284470.7A
Other languages
Chinese (zh)
Other versions
CN112416708A (en
Inventor
刘慕雨
王泽洋
黄镜澄
张锦涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202011284470.7A priority Critical patent/CN112416708B/en
Publication of CN112416708A publication Critical patent/CN112416708A/en
Application granted granted Critical
Publication of CN112416708B publication Critical patent/CN112416708B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides an asynchronous call link monitoring method and an asynchronous call link monitoring system, which are applied to the technical field of cloud computing. The asynchronous call link monitoring method comprises the following steps: receiving a service request, and generating a link context according to the service request; wherein the link context includes a field; storing the link context to an external distributed storage device; processing the service request and updating the field according to the current thread of the service request; acquiring a link context from the distributed storage device according to the updated field; and determining a monitoring index according to the link context and the service request processing result. The invention can achieve the purpose of monitoring the asynchronous call link.

Description

Asynchronous call link monitoring method and system
Technical Field
The invention relates to the technical field of cloud computing, in particular to an asynchronous call link monitoring method and system.
Background
With the maturity of a distributed architecture, a large number of enterprise-level applications adopt distributed and cloud computing technologies, often thousands of nodes running on enterprise production have complicated calling relations among different types of nodes, the nodes are often cross-application, cross-team and cross-park, once a certain link goes wrong, development and operation staff positioning problems are very difficult, and the problems are often required to be examined and analyzed through massive discrete logs, so that the efficiency is low. The distributed tracking technology enables research, development and operation staff to better control the calling condition among nodes, and is more efficient and convenient in checking the on-line problems, so that the possibility is provided for full-link monitoring.
The monitoring object of the distributed tracking technology is each service request (or called transaction or network call), and the cross-process, cross-node and cross-network transaction monitoring is realized by tracking the service request flow, so the monitoring is also called full-link monitoring. According to the latest full link monitoring standard (OPENTACING), the principle of the distributed tracking technology is to tag a service request by generating an ID (TRACEID) at the entry node of the service request, which is transmitted through the entire calling link, so as to connect the distributed nodes in series. Each time a network call is made, a phase of the link, or a step of the service request chain, is marked by generating a SPANID. The sending and receiving of service requests is, say, a phase (S PAN), so the SPANID is also passed through with the network protocol stack during this invocation. Furthermore, since the links are to be concatenated, the last stage of the SPANID, PARENTSPANID, PARENTSPANID, needs to be known and transmitted transparently with the network protocol stack. In addition, according to OPENTACING standard, whether to collect the mark, custom field, these two fields are also transparent. Therefore, the whole link can be connected in series, the problem of link connection is solved, and the calling condition of the whole link can be monitored. The five fields to be transmitted transparently, and the meta information (such as network information and interface information) of the current network call are collectively called a link context. With the context, the relevant index can be monitored and analyzed, for example, the sending time and the receiving time of the service request are recorded, and the response time of the service request can be calculated by subtracting. The point in time of transmission of the service request is also maintained in the link context. The average response time of a certain interface can be monitored by performing average calculation on the response time of the certain interface at the server.
The distributed tracking technique principle described above works well with synchronous service requests because for a process, a synchronous service request is completed within a thread, and the link context can be stored in the thread's local memory. Taking a network call as an example, after generating a field to be transmitted, a caller records meta information (i.e. characteristics) of the network call, such as network information (e.g. caller IP and receiver IP), interface information (e.g. interface name, interface version number, interface type (e.g. RPC and HTTP)) and current time. Then, the caller saves the link context in the local memory of the thread processing the current service request (isolated from the memory space of other threads, and therefore not mutually affected), and then initiates a network call and waits for the receiver to return response data. After receiving the response, the calling party takes out the context from the memory, records the current time, and subtracts the sending time recorded in the memory from the current time to obtain the total time consumption of the call, thereby achieving the purpose of time consumption monitoring the service request.
For asynchronous call, after the calling party sends the service request, the calling party directly returns without waiting for the response of the receiving party. When the receiver responds back, it is likely that another thread is used to process the response, so the scheme of using the thread local memory to store the link context is not possible. Monitoring asynchronous calls is necessary in many scenarios. Therefore, how to monitor asynchronous calls becomes a urgent problem to be solved, and there is no good solution in the industry.
Disclosure of Invention
The embodiment of the invention mainly aims to provide an asynchronous call link monitoring method and an asynchronous call link monitoring system so as to achieve the purpose of monitoring an asynchronous call link.
In order to achieve the above object, an embodiment of the present invention provides an asynchronous call link monitoring method, including:
receiving a service request, and generating a link context according to the service request; wherein the link context includes a field;
storing the link context to an external distributed storage device;
processing the service request and updating the field according to the current thread of the service request;
acquiring a link context from the distributed storage device according to the updated field;
and determining a monitoring index according to the link context and the service request processing result.
The embodiment of the invention also provides an asynchronous call link monitoring system, which comprises:
the receiving unit is used for receiving the service request and generating a link context according to the service request; wherein the link context includes a field;
a storage unit for storing the link context to an external distributed storage device;
the updating unit is used for processing the service request and updating the field according to the current thread of the service request;
a link context obtaining unit, configured to obtain a link context from the distributed storage device according to the updated field;
and the monitoring index determining unit is used for determining the monitoring index according to the link context and the service request processing result.
The embodiment of the invention also provides computer equipment, which comprises a memory, a processor and a computer program stored on the memory and running on the processor, wherein the processor realizes the steps of the asynchronous call link monitoring method when executing the computer program.
The embodiment of the invention also provides a computer readable storage medium, which stores a computer program, and the computer program realizes the steps of the asynchronous call link monitoring method when being executed by a processor.
The method and the system for monitoring the asynchronous call link firstly generate the link context according to the service request, then store the link context to the external distributed storage device, update the field according to the current thread of the service request and acquire the link context from the distributed storage device according to the updated field to determine the monitoring index, thereby achieving the purpose of monitoring the asynchronous call link.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an asynchronous call link monitoring method in an embodiment of the invention;
FIG. 2 is a block diagram of an asynchronous call link monitoring system in an embodiment of the invention;
FIG. 3 is a system architecture diagram of a monitoring system;
FIG. 4 is a flowchart of the operation of the monitoring system;
FIG. 5 is a block diagram of an asynchronous call initiation device in an embodiment of the invention;
FIG. 6 is a block diagram of a distributed storage device in an embodiment of the present invention;
FIG. 7 is a block diagram of an asynchronous call receiving device in an embodiment of the present invention;
FIG. 8 is a block diagram of an asynchronous call response device in an embodiment of the invention;
FIG. 9 is a block diagram showing the structure of a monitoring data analysis device according to an embodiment of the present invention;
fig. 10 is a block diagram of a computer device in an embodiment of the invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Those skilled in the art will appreciate that embodiments of the invention may be implemented as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the following forms, namely: complete hardware, complete software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
In view of the defects in the aspect of asynchronous call link tracking in the prior art, the embodiment of the invention provides an asynchronous call link monitoring method based on a full link monitoring technology. The present invention will be described in detail with reference to the accompanying drawings.
FIG. 1 is a flow chart of an asynchronous call link monitoring method in an embodiment of the invention. FIG. 2 is a flow chart of an asynchronous call link monitoring method in another embodiment of the invention. As shown in fig. 1 and 2, the asynchronous call link monitoring method includes:
s101: and receiving the service request, and generating a link context according to the service request.
The link context includes fields and features, where the fields include a link ID (trail, an ID that marks a call chain), a current phase ID (SPANID, an ID that marks a call in a link at this time), a last phase ID (PARENTSPANID, an ID that marks a call at last phase), a collection flag (SAMPLED), and an additional custom field (EXTRA, can be empty), and the features (meta information) include call initiation time, network information (e.g., caller IP, receiver IP), and interface information (e.g., interface name, interface version number, interface type (e.g., RPC interface, HTTP interface, etc.)).
S102: the link context is stored to an external distributed storage device.
In particular implementations, the link context is stored to the distributed storage device by:
a Key (Key) is generated according to the link ID and the current stage ID, a Value (Value) is generated according to the link context, then a Key Value pair is generated according to the Key and the Value, and the Key Value pair (Key-Value) is stored in a distributed storage device. The distributed storage device is a Key-Value type (Key Value pair) database, and can be Redis.
There is a timeout time for each key-value pair. When the timeout time is reached, the key value pair is indicated to not receive the asynchronous response within the timeout time, a cleaning mechanism of the distributed storage device is triggered at the moment, the key value pair is notified to the monitoring data analysis device before cleaning, and then the key value pair is deleted from the distributed storage device. The suspected key-value pairs are saved to the monitoring data analysis device for later verification.
S103: the service request is processed and the field is updated according to the current thread of the service request.
In one embodiment, S103 includes: the current phase ID and the last phase ID in the field are updated according to the current thread of the service request. Wherein, the initial previous stage ID is null, and the updated previous stage ID is the current stage ID before updating.
S104: and acquiring the link context from the distributed storage device according to the updated field.
The distributed storage device deletes the corresponding key value pair after acquiring the link context.
In specific implementation, the link context is obtained from the distributed storage device according to the updated last-stage ID and the link ID (i.e., the Key is TRACEID+ PARENTSPANID, and the corresponding Value is obtained from the distributed storage device).
S105: and determining a monitoring index according to the link context and the service request processing result.
Wherein the monitoring index comprises time consumption, success data and failure data of the service request
In one embodiment, S105 includes:
after determining the link context acquisition time, determining the time consumption of the service request according to the link context acquisition time and the call initiation time, and generating success data and failure data according to the service request processing result.
For example, subtracting the link context acquisition time from the call initiation time may result in a time consuming service request. When the code field in the service request processing result is 0, the service request processing result is successful, the successful data is 1, and the failure data is 0; otherwise, the service request processing result is failure, the success data is 0, and the failure data is 1.
The execution main body of the asynchronous call link monitoring method shown in fig. 1 is an asynchronous call link monitoring system, and is applied to a host or a server; the distributed storage device, the monitoring data analysis device and the asynchronous call link monitoring system form an integral monitoring system together. As can be seen from the flow shown in fig. 1, the method for monitoring an asynchronous call link according to the embodiment of the present invention generates a link context according to a service request, stores the link context in an external distributed storage device, and then updates a field according to a current thread of the service request and obtains the link context from the distributed storage device according to the updated field to determine a monitoring index, thereby achieving the purpose of monitoring the asynchronous call link.
In one embodiment, the method for asynchronously calling the link monitoring further comprises: associating the monitoring index with the feature; and sending the monitoring indexes of the features and the associated features to an external monitoring data analysis device so that the monitoring data analysis device analyzes the data of the interface corresponding to the interface information according to the monitoring indexes.
In specific implementation, the monitoring data analysis device stores the monitoring index into the real-time analysis database, and stores the associated characteristic and the key value pair (overtime call detail) reported by the distributed storage device into the distributed Search engine (Elastic Search), so that the follow-up searching and checking detail are convenient. And then the monitoring data analysis device performs aggregation calculation according to different index types so as to realize monitoring analysis of asynchronous call. For example, for an asynchronous interface corresponding to certain interface information, average calculation is performed on service request time consumption of a plurality of service requests corresponding to the asynchronous interface, and average response time of the asynchronous interface is calculated; and respectively carrying out accumulation calculation on the success data and the failure data of the asynchronous interface, dividing the accumulated calculation by the unit time, and calculating the success data and the failure data of the asynchronous interface in the unit time.
In summary, the specific flow of the embodiment of the invention is as follows:
1. and receiving the service request, and generating a link context according to the service request.
2. A key is generated based on the link ID and the current stage ID in the link context, a value is generated based on the link context, a key-value pair is generated based on the key and the value, and the key-value pair is stored in an external distributed storage device.
3. Processing the service request, and updating the current stage ID and the last stage ID in the field according to the current thread of the service request.
4. And acquiring the link context from the distributed storage device according to the updated last-stage ID and the link ID.
5. After determining the link context acquisition time, determining the time consumption of the service request according to the link context acquisition time and the call initiation time, and generating success data and failure data according to the service request processing result.
6. And after the monitoring index is associated with the feature, sending the monitoring index of the associated feature to a monitoring data analysis device.
7. The monitoring data analysis device analyzes the data of the interface corresponding to the interface information according to the monitoring index.
In summary, the method for monitoring the asynchronous call link provided by the embodiment of the invention has the following beneficial effects:
1. the monitoring of asynchronous call links is necessary in many scenarios, and the present invention proposes a scheme for monitoring asynchronous call links by introducing a remote distributed storage device.
2. The invention is compatible with the traditional synchronous call link tracking scheme, and the asynchronous call link and the synchronous link are connected in series by multiplexing the link context of synchronous call, so as to form real full link monitoring.
3. The invention relates to a link and indexes on the basis of link tracking, and provides an index monitoring scheme aiming at asynchronous call in the link, and the method helps enterprises to monitor the running condition of an IT system better through monitoring key indexes such as average response time, success data and failure data.
Based on the same inventive concept, the embodiment of the invention also provides an asynchronous call link monitoring system, and because the principle of the system for solving the problem is similar to that of an asynchronous call link monitoring method, the implementation of the system can refer to the implementation of the method, and the repetition is omitted.
FIG. 2 is a block diagram of an asynchronous call link monitoring system in an embodiment of the invention. Fig. 3 is a system architecture diagram of a monitoring system. Fig. 4 is a flowchart of the operation of the monitoring system. FIG. 5 is a block diagram of an asynchronous call initiation device in an embodiment of the invention. Fig. 6 is a block diagram of a distributed storage device according to an embodiment of the present invention. Fig. 7 is a block diagram of an asynchronous call receiving device in an embodiment of the present invention. FIG. 8 is a block diagram of an asynchronous call response device in an embodiment of the invention. Fig. 9 is a block diagram showing the structure of a monitoring data analysis apparatus in the embodiment of the present invention. As shown in fig. 2-9, the asynchronous call link monitoring system includes:
the receiving unit is used for receiving the service request and generating a link context according to the service request; wherein the link context includes a field;
a storage unit for storing the link context to an external distributed storage device;
the updating unit is used for processing the service request and updating the field according to the current thread of the service request;
a link context obtaining unit, configured to obtain a link context from the distributed storage device according to the updated field;
and the monitoring index determining unit is used for determining the monitoring index according to the link context and the service request processing result.
In one embodiment, the fields include a link ID and a current phase ID;
the storage unit is specifically used for:
generating a key according to the link ID and the current stage ID, and generating a value according to the link context;
key-value pairs are generated from the keys and values, and the key-value pairs are stored to an external distributed storage device.
In one embodiment, the updating unit is specifically configured to:
the current phase ID and the last phase ID in the field are updated according to the current thread of the service request.
In one embodiment, the link context acquisition unit is specifically configured to:
and acquiring the link context from the distributed storage device according to the updated last-stage ID and the link ID.
In one embodiment, the link context further includes a feature including call initiation time, the monitoring indicator including time consuming service request, success data, and failure data;
the monitoring index determining unit is specifically configured to:
determining link context acquisition time;
determining time consumption of a service request according to the acquisition time and the call initiation time of the link context;
and generating success data and failure data according to the service request processing result.
In one embodiment, the features further include interface information;
the asynchronous call link monitoring system further comprises:
the association unit is used for associating the monitoring index with the characteristic;
and the sending unit is used for sending the monitoring indexes of the features and the related features to an external monitoring data analysis device so that the monitoring data analysis device analyzes the data of the interface corresponding to the interface information according to the monitoring indexes.
As shown in fig. 3 to 9, in practical application, the asynchronous call link monitoring system includes an asynchronous call initiating device, an asynchronous call receiving device and an asynchronous call responding device. The asynchronous call initiating device is connected with the distributed storage device; the asynchronous call initiating device is connected with the asynchronous call receiving device; the distributed storage device is connected with the asynchronous call response device; the asynchronous call receiving device is connected with the asynchronous call responding device, the asynchronous call responding device is connected with the monitoring data analyzing device, and the distributed storage device is connected with the monitoring data analyzing device.
The asynchronous call initiating device is used for initiating asynchronous call, and generating a link context before initiating call and storing the link context in the distributed storage device. As shown in fig. 5, the asynchronous call initiation apparatus includes: the device comprises a context generating unit, a context storage unit and a call initiating unit, wherein:
the context generating unit includes a receiving unit, configured to generate a link context, where the link context includes fields TRACEID (ID for marking a call chain), SPAND (ID for marking a call in a link), PARENTSPANID (ID for calling in the last stage), SAMPLED (whether to collect a flag), and EXTRA (additional custom fields may be null) that need to be transmitted to a next node (asynchronous call receiving device). The method also comprises meta information (i.e. characteristics) of the call, and mainly comprises network information (such as caller IP and receiver IP), interface information (such as interface name, interface version number, interface type (such as RPC interface and HTTP interface) and current call initiation time. These characteristic information associated with the current call are referred to as link contexts.
The context storage unit includes a storage unit for storing the link context to a remote distributed storage device, i.e., a Key-Value type (Key-Value pair) database. Taking the K-V database Redis commonly used in the industry as an example, TRACEID+SPANID is taken as a Key, a link context is taken as a Value to be stored in a distributed storage device, and a timeout time is provided for each Key Value pair.
The call initiating unit initiates network call and simultaneously transparently transmits five fields (TRACEID, SPANID, PARENTSPANID, SAMPLED, EXTRA) to be transparently transmitted to the next node, namely an asynchronous call receiving device, through a network protocol. So-called protocol stack transparent transmission, which is to store five fields in a HEADER (HEADER) of the HTTP protocol for transmitting an HTTP service request; for RPC service requests, the transfer across the network is kept in RPC CONTEXT. Because of the asynchronous call, the asynchronous call initiating device does not need to wait for an asynchronous response (namely, a service request processing result) and directly returns a call initiation success notification.
The distributed storage device is a Key-Value type (Key Value pair) distributed storage device, and each Key Value represents a link context. As shown in fig. 6, the distributed storage device includes a storage unit, a reading unit, and a cleaning unit, wherein:
the storage unit stores the key value pairs reported by the context storage unit, and each key value pair has timeout time.
The reading unit acquires the VALUE (namely the link context) according to the Key, and deletes the Key VALUE pair after the acquisition is successful.
The cleaning unit triggers a cleaning mechanism after reaching the timeout time, and before cleaning, the key value pair is notified to the asynchronous call response device and then deleted from the storage unit. These suspected service requests, the suspected key-value pairs are saved to the monitoring data analysis device for later verification.
The asynchronous call receiving device is used for receiving the asynchronous call, receiving and processing the asynchronous service request, and notifying the result to the asynchronous call responding device after the processing is completed. As shown in fig. 7, the asynchronous call receiving device includes a receiving unit and a responding unit, wherein:
the receiving unit comprises an updating unit for receiving the asynchronous call and processing the service request, and simultaneously extracting the transmitted fields from the protocol stack.
After the response unit processes the service request, the transparent field is continuously put into a protocol stack, and an asynchronous call response device is called to respond to the asynchronous service request.
And after receiving the asynchronous response, the asynchronous call response device acquires the link context from the distributed storage device according to the key words in the response information, calculates indexes such as time consumption, success data, failure data and the like of the service request, and reports the calculated indexes to the monitoring data analysis device. As shown in fig. 8, the asynchronous call response device includes a response receiving unit, a context acquiring unit, a monitoring index calculating unit, and a monitoring index reporting unit. Wherein:
the response receiving unit receives the asynchronous response and acquires the five fields of the transparent transmission from the protocol stack.
The context acquisition unit includes a link context acquisition unit, configured to acquire a corresponding Value, that is, a link context, from the distributed storage device according to the transparent field with TRACEID+ PARENTSPANID as a Key.
The monitoring index calculation unit comprises a monitoring index determination unit, a control unit and a control unit, wherein the monitoring index determination unit is used for determining the acquisition time of the link context and subtracting the call initiation time in the link context to obtain the service request time consumption of the asynchronous service request; and determining whether the asynchronous call is successful or not according to the response data acquired by the response receiving unit, wherein success data is 1, failure data is 0, success data is 0, and failure data is 1.
The monitoring index reporting unit comprises a correlation unit and a sending unit and is used for reporting the calculated characteristics of the index correlation service request to the monitoring data analysis device together for monitoring analysis.
The monitoring data analysis device is used for receiving the monitoring data and carrying out aggregation calculation according to different index types so as to facilitate subsequent analysis. As shown in fig. 9, the monitoring data analyzing apparatus includes a receiving unit and an aggregation calculating unit, wherein:
the receiving unit receives the monitoring index reported by the asynchronous call response device and stores the monitoring index in the real-time analysis database, and stores the associated characteristic and the key value pair (overtime call detail) reported by the distributed storage device in the distributed Search engine (Elastic Search) so as to facilitate the subsequent searching and checking of the detail.
An aggregation calculation unit: and performing aggregation calculation according to different index types to realize monitoring analysis of asynchronous call. For example, for an asynchronous interface corresponding to certain interface information, average calculation is performed on service request time consumption of a plurality of service requests corresponding to the asynchronous interface, and average response time of the asynchronous interface is calculated; and respectively carrying out accumulation calculation on the success data and the failure data of the asynchronous interface, dividing the accumulated calculation by the unit time, and calculating the success data and the failure data of the asynchronous interface in the unit time.
In summary, the asynchronous call link monitoring system of the embodiment of the invention generates the link context according to the service request, then stores the link context in the external distributed storage device, and then acquires the link context from the distributed storage device according to the current thread update field of the service request and the updated field to determine the monitoring index, thereby achieving the purpose of monitoring the asynchronous call link.
The embodiment of the invention also provides a concrete implementation mode of the computer equipment capable of realizing all the steps in the asynchronous call link monitoring method in the embodiment. Fig. 10 is a block diagram of a computer device according to an embodiment of the present invention, and referring to fig. 10, the computer device specifically includes:
a processor (processor) 1001 and a memory (memory) 1002.
The processor 1001 is configured to invoke a computer program in the memory 1002, where the processor executes the computer program to implement all the steps in the method for asynchronously invoking the link monitoring in the above embodiment, for example, the processor executes the computer program to implement the following steps:
receiving a service request, and generating a link context according to the service request; wherein the link context includes a field;
storing the link context to an external distributed storage device;
processing the service request and updating the field according to the current thread of the service request;
acquiring a link context from the distributed storage device according to the updated field;
and determining a monitoring index according to the link context and the service request processing result.
In summary, the computer device of the embodiment of the invention generates the link context according to the service request, then stores the link context in the external distributed storage device, and then updates the field according to the current thread of the service request and acquires the link context from the distributed storage device according to the updated field to determine the monitoring index, thereby achieving the purpose of monitoring the asynchronous call link.
The embodiment of the present invention also provides a computer readable storage medium capable of implementing all the steps in the asynchronous call link monitoring method in the above embodiment, the computer readable storage medium storing thereon a computer program which, when executed by a processor, implements all the steps in the asynchronous call link monitoring method in the above embodiment, for example, the processor implements the following steps when executing the computer program:
receiving a service request, and generating a link context according to the service request; wherein the link context includes a field;
storing the link context to an external distributed storage device;
processing the service request and updating the field according to the current thread of the service request;
acquiring a link context from the distributed storage device according to the updated field;
and determining a monitoring index according to the link context and the service request processing result.
In summary, the computer readable storage medium of the embodiment of the present invention generates the link context according to the service request, then stores the link context in the external distributed storage device, and then updates the field according to the current thread of the service request and obtains the link context from the distributed storage device according to the updated field to determine the monitoring index, so as to achieve the purpose of monitoring the asynchronous call link.
The foregoing description of the embodiments has been provided for the purpose of illustrating the general principles of the invention, and is not meant to limit the scope of the invention, but to limit the invention to the particular embodiments, and any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the invention are intended to be included within the scope of the invention.
Those of skill in the art will further appreciate that the various illustrative logical blocks (illustrative logical block), units, and steps described in connection with the embodiments of the invention may be implemented by electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components (illustrative components), elements, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design requirements of the overall system. Those skilled in the art may implement the described functionality in varying ways for each particular application, but such implementation is not to be understood as beyond the scope of the embodiments of the present invention.
The various illustrative logical blocks, or units, or devices described in the embodiments of the invention may be implemented or performed with a general purpose processor, a digital signal processor, an Application Specific Integrated Circuit (ASIC), a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described. A general purpose processor may be a microprocessor, but in the alternative, the general purpose processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a digital signal processor core, or any other similar configuration.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. In an example, a storage medium may be coupled to the processor such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC, which may reside in a user terminal. In the alternative, the processor and the storage medium may reside as distinct components in a user terminal.
In one or more exemplary designs, the above-described functions of embodiments of the present invention may be implemented in hardware, software, firmware, or any combination of the three. If implemented in software, the functions may be stored on a computer-readable medium or transmitted as one or more instructions or code on the computer-readable medium. Computer readable media includes both computer storage media and communication media that facilitate transfer of computer programs from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. For example, such computer-readable media may include, but is not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that may be used to carry or store program code in the form of instructions or data structures and other data structures that may be read by a general or special purpose computer, or a general or special purpose processor. Further, any connection is properly termed a computer-readable medium, e.g., if the software is transmitted from a website, server, or other remote source via a coaxial cable, fiber optic cable, twisted pair, digital Subscriber Line (DSL), or wireless such as infrared, radio, and microwave, and is also included in the definition of computer-readable medium. The disks (disks) and disks (disks) include compact disks, laser disks, optical disks, DVDs, floppy disks, and blu-ray discs where disks usually reproduce data magnetically, while disks usually reproduce data optically with lasers. Combinations of the above may also be included within the computer-readable media.

Claims (10)

1. An asynchronous call link monitoring method, comprising:
receiving a service request, and generating a link context according to the service request; wherein the link context includes a field;
storing the link context to an external distributed storage device;
processing the service request and updating the field according to the current thread of the service request;
acquiring a link context from the distributed storage device according to the updated field;
determining a monitoring index according to the link context and the service request processing result;
the field includes a link ID and a current phase ID;
storing the link context to an external distributed storage device includes:
generating a key according to the link ID and the current stage ID, and generating a value according to the link context;
generating a key value pair according to the key and the value, and storing the key value pair to an external distributed storage device;
the link context also comprises a feature, wherein the feature comprises a call initiation time, and the monitoring index comprises time consumption, success data and failure data of the service request;
determining a monitoring index according to the link context and the service request processing result comprises the following steps:
determining link context acquisition time;
determining the time consumption of the service request according to the link context acquisition time and the call initiation time;
and generating success data and failure data according to the service request processing result.
2. The method of asynchronous call link monitoring according to claim 1, wherein updating the field according to the current thread of the service request comprises:
and updating the current stage ID and the last stage ID in the fields according to the current thread of the service request.
3. The method of claim 2, wherein retrieving the link context from the distributed storage device based on the updated field comprises:
and acquiring the link context from the distributed storage device according to the updated last-stage ID and the link ID.
4. The asynchronous call link monitoring method of claim 1, wherein the features further comprise interface information;
the asynchronous call link monitoring method further comprises the following steps:
associating the monitoring index with the feature;
and sending the monitoring indexes of the features and the related features to an external monitoring data analysis device so that the monitoring data analysis device analyzes the data of the interface corresponding to the interface information according to the monitoring indexes.
5. An asynchronous call link monitoring system, comprising:
the receiving unit is used for receiving the service request and generating a link context according to the service request; wherein the link context includes a field;
a storage unit for storing the link context to an external distributed storage device;
an updating unit, configured to process the service request and update the field according to a current thread of the service request;
a link context obtaining unit, configured to obtain a link context from the distributed storage device according to the updated field;
the monitoring index determining unit is used for determining a monitoring index according to the link context and the service request processing result;
the field includes a link ID and a current phase ID;
the storage unit is specifically configured to:
generating a key according to the link ID and the current stage ID, and generating a value according to the link context;
generating a key value pair according to the key and the value, and storing the key value pair to an external distributed storage device;
the link context also comprises a feature, wherein the feature comprises a call initiation time, and the monitoring index comprises time consumption, success data and failure data of the service request;
the monitoring index determining unit is specifically configured to:
determining link context acquisition time;
determining the time consumption of the service request according to the link context acquisition time and the call initiation time;
and generating success data and failure data according to the service request processing result.
6. The asynchronous call link monitoring system according to claim 5, wherein the updating unit is specifically configured to:
and updating the current stage ID and the last stage ID in the fields according to the current thread of the service request.
7. The asynchronous call link monitoring system according to claim 6, wherein the link context acquisition unit is specifically configured to:
and acquiring the link context from the distributed storage device according to the updated last-stage ID and the link ID.
8. The asynchronous call link monitoring system of claim 5, wherein the features further comprise interface information;
the asynchronous call link monitoring system further comprises:
an association unit, configured to associate the monitoring indicator with the feature;
and the sending unit is used for sending the monitoring indexes of the features and the related features to an external monitoring data analysis device so that the monitoring data analysis device analyzes the data of the interface corresponding to the interface information according to the monitoring indexes.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and running on the processor, characterized in that the processor implements the steps of the asynchronous call link monitoring method of any of claims 1 to 4 when the computer program is executed by the processor.
10. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the steps of the asynchronous call link monitoring method of any of claims 1 to 4.
CN202011284470.7A 2020-11-17 2020-11-17 Asynchronous call link monitoring method and system Active CN112416708B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011284470.7A CN112416708B (en) 2020-11-17 2020-11-17 Asynchronous call link monitoring method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011284470.7A CN112416708B (en) 2020-11-17 2020-11-17 Asynchronous call link monitoring method and system

Publications (2)

Publication Number Publication Date
CN112416708A CN112416708A (en) 2021-02-26
CN112416708B true CN112416708B (en) 2023-09-22

Family

ID=74831495

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011284470.7A Active CN112416708B (en) 2020-11-17 2020-11-17 Asynchronous call link monitoring method and system

Country Status (1)

Country Link
CN (1) CN112416708B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113485891A (en) * 2021-06-30 2021-10-08 中国民航信息网络股份有限公司 Service log monitoring method and device, storage medium and electronic equipment
CN115834699A (en) * 2021-09-16 2023-03-21 广州汽车集团股份有限公司 Service call chain tracking implementation method and system
CN113986955B (en) * 2021-11-01 2024-03-19 华青融天(北京)软件股份有限公司 Service chain determining method and device, electronic equipment and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018120722A1 (en) * 2016-12-30 2018-07-05 上海壹账通金融科技有限公司 Asynchronous interface testing method, terminal, device, system, and storage medium
CN109560989A (en) * 2018-12-06 2019-04-02 深圳市递四方信息科技有限公司 A kind of link monitoring system
CN110806931A (en) * 2019-10-31 2020-02-18 上海依图网络科技有限公司 Method and device for realizing call link tracking of distributed service and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018120722A1 (en) * 2016-12-30 2018-07-05 上海壹账通金融科技有限公司 Asynchronous interface testing method, terminal, device, system, and storage medium
CN109560989A (en) * 2018-12-06 2019-04-02 深圳市递四方信息科技有限公司 A kind of link monitoring system
CN110806931A (en) * 2019-10-31 2020-02-18 上海依图网络科技有限公司 Method and device for realizing call link tracking of distributed service and electronic equipment

Also Published As

Publication number Publication date
CN112416708A (en) 2021-02-26

Similar Documents

Publication Publication Date Title
CN112416708B (en) Asynchronous call link monitoring method and system
CN110661659B (en) Alarm method, device and system and electronic equipment
CN107908494B (en) Abnormal event processing method and device, electronic equipment and storage medium
US11775501B2 (en) Trace and span sampling and analysis for instrumented software
US20070124437A1 (en) Method and system for real-time collection of log data from distributed network components
US8856313B2 (en) Systems and methods for using provenance information for data retention in stream-processing
KR101547721B1 (en) System for assisting with execution of actions in response to detected events, method for assisting with execution of actions in response to detected events, assisting device, and computer program
CN110647460B (en) Test resource management method and device and test client
CN112491609B (en) Business service-based system application architecture discovery method and system
CN112039701A (en) Interface call monitoring method, device, equipment and storage medium
CN114090366A (en) Method, device and system for monitoring data
CN111753169B (en) Data acquisition system based on internet
CN111061498A (en) Configuration information management system
CN114745295A (en) Data acquisition method, device, equipment and readable storage medium
CN113760677A (en) Abnormal link analysis method, device, equipment and storage medium
CN111327466A (en) Alarm analysis method, system, equipment and medium
CN113472858B (en) Buried point data processing method and device and electronic equipment
CN112671878B (en) Block chain information subscription method, device, server and storage medium
CN110719200A (en) Information identification method and device
CN115705190A (en) Method and device for determining dependence degree
CN111124542A (en) Configuration information management system
CN114579416B (en) Index determination method, device, server and medium
CN113783862B (en) Method and device for checking data in edge cloud cooperation process
CN112256714A (en) Data synchronization method and device, electronic equipment and computer readable medium
CN112671822B (en) Service request processing method, device, storage medium, server and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant