Disclosure of Invention
Therefore, it is necessary to provide a microservice monitoring method, an apparatus, a computer device and a storage medium capable of increasing a microservice information monitoring function for solving the technical problem that the microservice monitoring method has a single function.
A micro-service monitoring method, the method comprising:
displaying a link calling monitoring page; the link calling monitoring page comprises an identification input inlet;
receiving a query identification for the identification input entry;
displaying link calling information; the link calling information is information which is inquired according to the inquiry identification and is generated when the micro service is called;
when the link calling information is abnormal, receiving an abnormal query request aiming at the link calling information;
responding to the abnormal query request, and displaying an abnormal query result of the link calling information; and the abnormal query result is a result of querying the link calling information.
In one embodiment, before the displaying the link calls the monitoring page, the method further includes:
receiving a micro-service calling request;
generating a calling record item according to the micro-service calling request;
when the first identification is not included in the calling record item, generating the first identification; the first identification is used for marking the link calling information of the micro-service calling request; the first identification is used for matching with the query identification, and indicating the link calling monitoring page to display the link calling information according to the query identification.
In one embodiment, the method further comprises:
acquiring a second identifier in the call record item;
when the second identifier is not included in the calling record item, generating the second identifier according to the first identifier; the second identification is used for recording the micro-service calling quantity; the second identifier is used for marking abnormality when the micro-service call is abnormal.
In one embodiment, the generating the second identifier according to the first identifier when the second identifier is not included in the call record entry includes:
when the calling record item comprises the first identification, generating an abnormal second identification; and the second identifier of the exception is used for marking the superior calling exception of the micro service.
In one embodiment, before the displaying the link calls the monitoring page, the method further includes:
acquiring micro-service calling data;
storing the micro-service calling data into a plurality of micro-service databases through a message queue, so that a server can obtain the link calling information in the plurality of micro-service databases according to the query identification; and the micro-service calling data are respectively stored in the plurality of micro-service databases according to the data types.
In one embodiment, the plurality of microservice databases comprise an in-memory database, a search engine database, a distributed database and a relational database; the memory database is used for storing the microservice calling data counted in real time; the search engine database is used for storing short-term micro service calling data; the distributed database is used for storing the long-term micro-service calling data; and the relational database is used for storing the microservice calling data of off-line statistics.
In one embodiment, after the receiving the query identification for the identification input entry, the method further includes:
obtaining a plurality of candidate identifications; the candidate identifications respectively have corresponding candidate calling information;
matching the query identity with the plurality of candidate identities;
determining a target identifier from the plurality of candidate identifiers;
and extracting candidate calling information corresponding to the target identification to be used as the link calling information.
A microservice monitoring apparatus, the apparatus comprising:
the page display module is used for displaying a link calling monitoring page; the link calling monitoring page comprises an identification input inlet;
an identification receiving module for receiving a query identification for the identification input entry;
the information display module is used for displaying the link calling information; the link calling information is information which is inquired according to the inquiry identification and is generated when the micro service is called;
the request receiving module is used for receiving an abnormal query request aiming at the link calling information when the link calling information is abnormal;
the result display module is used for responding to the abnormal query request and displaying the abnormal query result of the link calling information; and the abnormal query result is a result of querying the link calling information.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
displaying a link calling monitoring page; the link calling monitoring page comprises an identification input inlet;
receiving a query identification for the identification input entry;
displaying link calling information; the link calling information is information which is inquired according to the inquiry identification and is generated when the micro service is called;
when the link calling information is abnormal, receiving an abnormal query request aiming at the link calling information;
responding to the abnormal query request, and displaying an abnormal query result of the link calling information; and the abnormal query result is a result of querying the link calling information.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
displaying a link calling monitoring page; the link calling monitoring page comprises an identification input inlet;
receiving a query identification for the identification input entry;
displaying link calling information; the link calling information is information which is inquired according to the inquiry identification and is generated when the micro service is called;
when the link calling information is abnormal, receiving an abnormal query request aiming at the link calling information;
responding to the abnormal query request, and displaying an abnormal query result of the link calling information; and the abnormal query result is a result of querying the link calling information.
According to the micro-service monitoring method, the micro-service monitoring device, the computer equipment and the storage medium, the link calling monitoring page displayed by the user terminal is used for inquiring the link calling information related to the identification after the inquiry identification is input to the operation and maintenance personnel, receiving the abnormal inquiry request initiated by the operation and maintenance personnel under the condition that the link calling information is abnormal, and displaying the abnormal inquiry result after responding to the request. The method specifically comprises the recording processing of the identification, the transmission of the link calling information and classified storage. The invention provides a link calling monitoring page, which is convenient for operation and maintenance personnel to quickly search and track link calling information, and helps the operation and maintenance personnel to quickly locate and solve the abnormal problem when micro-service calling is abnormal, so that the functions provided by the micro-service monitoring method are more diversified.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It should be noted that, in the embodiments of the present invention, the term "first \ second" merely distinguishes similar objects and does not represent a specific ordering of the objects, and it should be understood that "first \ second" may be interchanged with a specific order or sequence, where the case allows. It should be understood that "first \ second" distinct objects may be interchanged under appropriate circumstances such that embodiments of the invention described herein may be practiced in sequences other than those illustrated or described herein.
Micro service Architecture (Micro service Architecture) is a software Architecture, specifically, a specific way to design a software application as an independently deployable service suite, that is, a method for developing a single application as a set of small services, where each application runs in its own process and communicates with a lightweight mechanism, usually http (hyper Text Transfer protocol) resource api (application programming interface). These services are built around business functions and can be deployed independently through a fully automated deployment mechanism. Also, these services are minimally centrally managed, can be written in different programming languages, and use different data storage technologies.
The micro-service monitoring method provided by the invention can be applied to the application environment shown in fig. 1. Therein, in a microservice monitoring system, a monitoring terminal 102 and a monitoring server 104 communicate with a user terminal 106 via a network. The monitoring terminal 102 and the user terminal 106 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the monitoring server 104 may be implemented by an independent server or a server cluster composed of a plurality of servers.
In one embodiment, as shown in fig. 2, a micro-service monitoring method is provided, which is described by taking the method as an example applied to the monitoring terminal 102 in fig. 1, and includes the following steps:
step S210, displaying a link calling monitoring page; the link call monitoring page includes an identification input entry.
The link calling monitoring page is displayed on the monitoring terminal 102, and provides a page for operation and maintenance personnel to query and monitor micro-service calling information, and the information related to the micro-service called by the user can be queried through a query entry provided by the page, and can be used as an interactive interface between the user and the equipment, which can refer to the page shown in fig. 3.
The identifier input entry may be an input box for receiving an identifier input by a user on a link call monitoring page, or may be a trigger key for receiving an identifier input instruction, for example, a button component such as a virtual button, for example, a user ID acquired by a front-end device, or a call chain ID for recording a micro service call of a certain user ID.
It should be noted that the user ID is the user ID of the user terminal obtained by the monitoring server 104 when the user terminal 106 initiates the micro service access operation, and the call chain ID is a globally unique character string allocated by the monitoring server 104 for this call after the micro service call is completed for each user initiating the micro service access, and the character string remains unchanged during each micro service call, so that the operation and maintenance personnel can obtain the related information of the globally unique character string.
In a specific implementation, a link call monitoring page is provided, and an operation and maintenance worker can obtain call information of each user terminal 106 to the microservice through a mark input entry designed in the page, such as transfer and what parameters, what operation is performed, and the like. That is, a road calling monitoring page can be displayed on the monitoring terminal 102, after a certain identifier is input by a user, the monitoring server 104 correspondingly receives the identifier, so that the identifier is used for querying calling information corresponding to the identifier in the database, and after statistics is completed, the calling information is fed back to the monitoring terminal 102, so that operation and maintenance personnel can call the monitoring page according to a link, obtain all micro-service calling information related to the same identifier by using the identifier as a query signal, and monitor the micro-service calling information of an account corresponding to each identifier.
For example, as shown in fig. 3, a link call monitoring page is displayed, and an identification input entry is provided on the page, where the identification input entry may be "user ID" or "call chain ID", and after the operation and maintenance staff enters an ID number in an input box of the "user ID", information of a related micro service call for querying the user ID is correspondingly submitted.
Step S220, receiving a query identifier for the identifier input entry.
The query identifier is an identifier input by a user through an interactive interface and used for querying the microservice calling information stored in the monitoring server 104, the query identifier has identity identification, that is, the query identifier is unique, and the monitoring server 104 can acquire relevant information only for the query identifier according to the query identifier. The query identifier may be a user ID collected by the monitoring server 104 when the user terminal 106 initiates a micro service call, or a character string allocated by the monitoring server 104 in response to each user terminal 106 calling a service, for example, a mobile phone number 13711112222, a character string 0504321C2F 10.
In a specific implementation, a link calling monitoring page is displayed on the monitoring terminal 102, and after the operation and maintenance personnel use an identifier input entry on the link calling monitoring page to input an inquiry identifier, the monitoring server 104 receives the inquiry identifier, where the inquiry identifier may be a segment of character string generated by the monitoring server 104 at an earlier stage and in any system, and may also be an identifier identification code representing the identity of a user account, such as a mobile phone number, an IP address, and the like.
For example, when the operation and maintenance staff inputs the query identifier "0504321C 2F 10" in the "call chain ID" input box on the link call monitoring page, the query identifier is sent to the monitoring server 104, and the monitoring server 104 will subsequently obtain the relevant micro service call information stored in each database for the query identifier.
Step S230, displaying link calling information; the link calling information is information which is inquired according to the inquiry identification and is generated when the micro service is called.
The link calling information refers to information that includes the same query identifier and is used for associating the link calling information, for example, a calling request time, a calling duration, a number of calling micro-services, and the like, when a user terminal 106 calls a micro-service.
In a specific implementation, after an operation and maintenance person inputs an inquiry identifier at an identifier input entry of the monitoring terminal 102, the monitoring server 104 receives the inquiry identifier through the monitoring terminal 102, and performs an information inquiry and analysis processing step on the identifier by using the received inquiry identifier, after information acquisition for the inquiry identifier is completed, the monitoring server 104 sends the inquired information to the monitoring terminal 102, and the monitoring terminal 102 displays the information on a link calling monitoring page according to a predetermined rule, that is, displays link calling information about the inquiry identifier. Here, the predetermined rule may refer to page layout, that is, after the monitoring terminal 102 obtains each item of information of the query identifier, each item of link calling information of the query identifier is displayed according to a preset page layout requirement.
For example, referring to fig. 3, fig. 3 includes a plurality of link calling information, each link calling information is associated with a different query identifier, the query identifier is "calling link ID" or "user ID", after the operation and maintenance staff inputs a different query identifier at each identifier input entry, the monitor terminal 102 will only display the related link calling information of the query identifier, as shown in fig. 4, only the link calling information of "calling link ID" of "0504321C 2F 10" and "user ID" of "hzf/1371373" is displayed on the link calling monitor page of the monitor terminal 102, and the link calling information includes "time", that is, calling time "300 ms"; "service", i.e. the number of calls relating to a microservice "4"; "depth", i.e., microservice call level "3"; "SPAN", i.e., the number of SPAN designations "4", and so forth.
Step S240, when the link calling information is abnormal, receiving an abnormal query request for the link calling information.
The abnormal query request refers to a query operation performed on abnormal link calling information, and the query operation may be clicking an abnormal position of the link calling information, or popping up an abnormal popup window when the link calling information is abnormal, and clicking the abnormal popup window may initiate the abnormal query request of the link calling information.
In a specific implementation, the operation and maintenance personnel can monitor each link calling information through the link calling monitoring page of the monitoring terminal 102, and if some link calling information is abnormal, the abnormal prompt may prompt the abnormality by highlighting a color display or by displaying an abnormal popup window. For different abnormal prompts, the operation and maintenance personnel operate on the monitoring terminal 102, click the link calling information of the abnormal prompt, or drag the link calling information of the abnormal prompt, and then the monitoring terminal 102 correspondingly initiates an abnormal query request of the operation, so that the monitoring server 104 responds to the request and executes the next step.
For example, referring to fig. 3 and 4, firstly, in fig. 3, the link calling information with "calling chain ID" of "0504321C 2F 10" displays the exception with a highlighted color on the link calling monitoring page, and when the operation and maintenance personnel click the link calling information on the monitoring terminal 102, the abnormal inquiry request is submitted to the monitoring server 104 through the monitoring terminal 102.
Step S250, responding to the abnormal query request, and displaying an abnormal query result of the link calling information; and the abnormal query result is a result of querying the link calling information.
The abnormal query result refers to an abnormal statistical condition of the link calling information, and may include a statistical result of an abnormality such as abnormal calling duration, abnormal calling of a certain micro service, and the like.
In a specific implementation, after the operation and maintenance personnel submit the abnormal query request on the monitoring terminal 102, the monitoring server 104 responds to the request and sends the abnormal query result of the abnormal link calling information to the monitoring terminal 102, and after receiving the abnormal query result, the monitoring terminal 102 displays the abnormal query result on the link calling monitoring page according to the preset page layout requirement.
For example, after receiving the abnormal query result obtained by querying and analyzing the abnormal link call information and sent by the monitoring server 104, the monitoring terminal 102 displays the abnormal query result as a page shown in fig. 4 on the link call monitoring page, where the content in the abnormal query interface diagram displayed on the page at this time is the abnormal query result of the abnormal link call information.
In the micro-service monitoring method, the link calling monitoring page displayed by the user terminal is used for inquiring the link calling information related to the identification after the operation and maintenance personnel input the inquiry identification, receiving the abnormal inquiry request initiated by the operation and maintenance personnel under the condition that the link calling information is abnormal, and displaying the abnormal inquiry result after responding to the request. The invention provides a link calling monitoring page, which is convenient for operation and maintenance personnel to quickly search and track link calling information, and helps the operation and maintenance personnel to quickly locate and solve the abnormal problem when micro-service calling is abnormal, so that the functions provided by the micro-service monitoring method are more diversified.
In one embodiment, before the step S210, the method further includes:
receiving a micro-service calling request; generating a calling record item according to the micro-service calling request; when the first identification is not included in the calling record item, generating the first identification; the first identification is used for marking the link calling information of the micro-service calling request; the first identification is used for matching with the query identification, and indicating the link calling monitoring page to display the link calling information according to the query identification.
The micro-service invocation request refers to a request initiated by the user terminal 106 to the monitoring server 104, and a back-end system of the request in the monitoring server 104 may invoke a plurality of different micro-services, and the plurality of micro-services cooperatively generate a final request result.
The call record item is an information collection monitoring result set of the user terminal 106 requesting the monitoring server 104 to call each micro-service, and includes information such as request time, request protocol, micro-service call duration and the like of the user terminal.
The first identifier refers to a globally unique identifier generated by the monitoring server 104 for one external access to multiple microservices initiated by the user terminal 106. In practical applications, the first identifier may also be referred to as a transaction identifier.
In a specific implementation, the monitoring server 104 must collect multiple link call information and store the link call information in the database, so that operation and maintenance personnel can monitor the link call information at the monitoring terminal 102. The monitoring server 104 first receives a micro-service invocation request sent by the user terminal 106, and generates an invocation record item after responding to the request, at this time, the user identity information, the request information and the like of the user terminal 106 are collected by a first micro-service monitoring component in the micro-service monitoring system, and a globally unique first identifier is generated by the first micro-service/micro-application, so that the first identifier is associated with information that the user terminal 106 accesses each micro-service. Therefore, after receiving the micro-service invocation request of the user terminal 106 and generating the invocation record item, the monitoring server 104 first determines whether the invocation record item has the first identifier, and if not, generates a globally unique first identifier, and the first identifier remains unchanged between the invocations of the micro-services.
For example, after receiving the micro-service invocation request sent by the user terminal 106, the monitoring server 104 first generates an invocation record item (transaction record object), then determines whether a first identifier exists in a hypertext transfer protocol request header of the invocation record item, and if not, generates a globally unique first identifier. In addition, the monitoring server 104 collects information by using a micro service monitoring component (Filter), and all users of the mobile phone call information, micro service operation state information, and the like, such as user names, power consumption numbers, and the like.
In one embodiment, the method further comprises:
acquiring a second identifier in the call record item; when the second identifier is not included in the calling record item, generating the second identifier according to the first identifier; the second identification is used for recording the micro-service calling quantity; the second identifier is used for marking abnormality when the micro-service call is abnormal.
The second identifier is an identifier generated by the monitoring server 104 at the same time as the first identifier after receiving the micro-service invocation request sent by the user terminal 106, and the second identifier is different from the first identifier and is not globally unique, but generates different identifier values according to different micro-service invocations, that is, on the basis of the second identifier generated by the currently invoked micro-service, if other micro-services are invoked, a new second identifier is generated for other invoked micro-services, so as to record the number of the micro-services involved in the one-time invocation request, and has the effect that the monitoring server 104 can analyze the micro-services invoked at the upper level thereof or the micro-services invoked at the lower level through the current second identifier, and establish a hierarchical relationship between each item of the invoked micro-services.
In a specific implementation, after the monitoring server 104 generates a call record item for the user terminal 106 that initiates the micro-service call request, not only the first identifier but also the second identifier is obtained. And when the second identifier is not included in the calling record item, generating the second identifier mainly according to the existence condition of the first identifier.
For example, when the first identifier exists, the value of the generated second identifier is 9, which indicates that the superior microservice call is abnormal; if the first identifier does not exist, the first identifier is generated, meanwhile, the value of the generated first identifier is 0, the calling is started, and the micro-service calling number is started to be calculated. It should be noted that the value of the second identifier is a natural integer, which is convenient for the monitoring server 104 to perform micro-service invocation positioning and exception checking during subsequent information invocation. In one micro service call, the condition that the first identifier does not exist and the second identifier exists does not occur, otherwise, the call is meaningless.
In one embodiment, when the second identifier is not included in the call record item, generating the second identifier according to the first identifier includes:
when the calling record item comprises the first identification, generating an abnormal second identification; and the second identifier of the exception is used for marking the superior calling exception of the micro service.
In a specific implementation, if the call record item generated by the monitoring server 104 does not include the second identifier, the first identifier is obtained, and the preset second identifier is generated according to the existence condition of the first identifier.
For example, the second identifier is not included in the call entry, and when the first identifier exists, a second identifier is generated and takes a value of 9; if the first identifier exists, a second identifier is also generated, but the value of the second identifier is 0.
In one embodiment, before the step S210, the method further includes:
acquiring micro-service calling data; storing the micro-service calling data into a plurality of micro-service databases through a message queue, so that a server can obtain the link calling information in the plurality of micro-service databases according to the query identification; and the micro-service calling data are respectively stored in the plurality of micro-service databases according to the data types.
The micro-service call data refers to real-time information such as access times of each micro-service and concurrent access amount of the system, and further includes short-term or long-term system alarm information and the like.
In a specific implementation, the monitoring server 104 provides the monitoring terminal 102 with the monitoring micro-service calling information, and first collects the calling information of each micro-service, and then transmits and processes each information data. Firstly, the monitoring server 104 obtains each item of micro service call data, then stores each item of micro service call data to the local, and transmits the micro service call data to each database in a file form through a message queue, and the types of the data stored in each database are different, so that each database obtains databases of different data types through different modules.
It should be noted that there are two types of transmission manners of the micro service invocation data, and reference may be made to fig. 5, where fig. 5 is a schematic data transmission diagram of the micro service monitoring method in an embodiment. The micro-service monitoring component (Filter) may transmit the micro-service calling data to the message queue through the information input module, or may directly transmit the micro-service calling data to the message queue.
For example, referring to fig. 5, there are 4 databases in the microservice monitoring system, and each database stores different types of data, and is processed by each different module.
In one embodiment, the plurality of microservice databases comprise an in-memory database, a search engine database, a distributed database and a relational database; the memory database is used for storing the microservice calling data counted in real time; the search engine database is used for storing short-term micro service calling data; the distributed database is used for storing the long-term micro-service calling data; and the relational database is used for storing the microservice calling data of off-line statistics.
The memory database is Redis, the query performance can be greatly improved, the information is monitored and analyzed in real time, the frequently updated statistical results of the monitoring information, such as the access times of each micro service, the system concurrent access amount and other real-time information, are output to the Redis memory database, and the Redis memory database has good read-write performance. The calculated data analyzed by the memory database in real time can be externally published in real time, the information stored in Redis is mainly some real-time monitoring data and alarm information, and the stored data volume is small.
The Search engine database is Elastic Search, and can quickly Search related information and quickly locate problems. Short-term data of the last few days or one month is stored, and multi-condition quick retrieval can be quickly carried out in Elastic Search.
The distributed database refers to Hbase, stores monitoring information for a long period, and is a data source for offline analysis.
The relational database is MySQL and mainly stores structured data of statistical results of off-line analysis.
In a specific implementation, the monitoring server 104 collects the acquired micro service invocation data, and analyzes and stores the data into different databases, where the storage basis depends on the data type.
For example, as shown in fig. 5, the real-time computing service module obtains implementation summary data from the message queue and stores the implementation summary data in the memory database; the search engine loading module acquires short-term micro-service calling data from the message queue and stores the short-term micro-service calling data to a search engine database; the persistent service module acquires long-term micro-service calling data from the message queue and stores the long-term micro-service calling data to the distributed database; and the offline calculation service module acquires statistical result institutional data of offline analysis from the message queue and stores the statistical result institutional data in the relational database.
In one embodiment, after the step S220, the method further includes:
obtaining a plurality of candidate identifications; the candidate identifications respectively have corresponding candidate calling information; matching the query identity with the plurality of candidate identities; determining a target identifier from the plurality of candidate identifiers; and extracting candidate calling information corresponding to the target identification to be used as the link calling information.
The candidate identifier is an identifier acquired by the monitoring server 104 in an earlier stage to store the acquired call information in the database, for example, a user mobile phone number, a user ID, a user IP address, a custom-generated character string 0674321C2F10, and the like.
The target identifier is an identifier which is matched with the query identifier and is consistent with the query identifier in the candidate identifiers.
In a specific implementation, the monitoring server 104 performs identifier matching work among a plurality of candidate identifiers with the query identifier input by the user as a target, and extracts the calling information corresponding to the target identifier as link calling information for the monitoring terminal 102 to display.
For example, if the query identifier input by the operation and maintenance staff on the link call monitoring page of the monitoring terminal 102 is "0674321C 2F 10", the monitoring server 104 first queries and matches the identifier in the database, extracts corresponding link call information after finding the target identifier, and sends the link call information to the monitoring terminal 102, and the monitoring terminal 102 receives and displays the link call information.
According to the scheme provided by the embodiment of the invention, before the monitoring terminal displays the link calling monitoring page, the monitoring server firstly needs to collect link calling information, namely, information collection work is executed through a micro-service calling request initiated by the user terminal. And during the information acquisition period, the monitoring server records the calling information of the micro service called by the user terminal mainly by preprocessing the first identifier and the second identifier, so that the calling process is associated or marked with abnormity. By the scheme provided by the invention, the operation and maintenance personnel can utilize the link displayed by the monitoring terminal to call the monitoring page to quickly search and track all link calling information, and when the micro-service calling is abnormal, the operation and maintenance personnel can be helped to quickly locate and solve the abnormal problem, so that the functions provided by the micro-service monitoring method are more diversified.
It should be understood that, although the steps in the flowchart of fig. 2 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps of fig. 2 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 6, a microservice monitoring apparatus is provided, comprising a page display module 610, an identity receiving module 620, an information display module 630, a request receiving module 640, and a result display module 650, wherein:
a page display module 610, configured to display a link call monitoring page; the link calling monitoring page comprises an identification input inlet;
an identification receiving module 620, configured to receive a query identification for the identification input entry;
an information display module 630, configured to display link calling information; the link calling information is information which is inquired according to the inquiry identification and is generated when the micro service is called;
a request receiving module 640, configured to receive, when the link calling information is abnormal, an abnormal query request for the link calling information;
a result display module 650, configured to display an abnormal query result of the link invoking information in response to the abnormal query request; and the abnormal query result is a result of querying the link calling information.
According to the scheme provided by the embodiment of the invention, the link calling monitoring page displayed by the monitoring terminal is used for inquiring the link calling information related to the identification after the inquiry identification is input to the operation and maintenance personnel, receiving the abnormal inquiry request initiated by the operation and maintenance personnel under the condition that the link calling information is abnormal, and displaying the abnormal inquiry result after responding to the request. The invention provides a link calling monitoring page, which is convenient for operation and maintenance personnel to quickly search and track link calling information, and helps the operation and maintenance personnel to quickly locate and solve the abnormal problem when micro-service calling is abnormal, so that the functions provided by the micro-service monitoring scheme are more diversified.
In one embodiment, the apparatus further comprises:
the calling request receiving module is used for receiving a micro-service calling request; the record item generating module is used for generating a calling record item according to the micro-service calling request; the first identification generation module is used for generating the first identification when the first identification is not included in the calling record item; the first identification is used for marking the link calling information of the micro-service calling request; the first identification is used for matching with the query identification, and indicating the link calling monitoring page to display the link calling information according to the query identification.
In one embodiment, the apparatus further comprises:
the second identifier acquisition module is used for acquiring a second identifier in the call record item; a second identifier generating module, configured to generate the second identifier according to the first identifier when the second identifier is not included in the call record item; the second identification is used for recording the micro-service calling quantity; the second identifier is used for marking abnormality when the micro-service call is abnormal.
In one embodiment, the second identity generation module comprises:
the abnormal identifier generation submodule is used for generating an abnormal second identifier when the calling record item comprises the first identifier; and the second identifier of the exception is used for marking the superior calling exception of the micro service.
In one embodiment, the apparatus further comprises:
the calling data acquisition module is used for acquiring micro-service calling data; the calling data storage module is used for storing the micro-service calling data into a plurality of micro-service databases through a message queue, so that the server can obtain the link calling information in the plurality of micro-service databases according to the query identifier; and the micro-service calling data are respectively stored in the plurality of micro-service databases according to the data types.
In one embodiment, the plurality of microservice databases comprise an in-memory database, a search engine database, a distributed database and a relational database; the memory database is used for storing the microservice calling data counted in real time; the search engine database is used for storing short-term micro service calling data; the distributed database is used for storing the long-term micro-service calling data; and the relational database is used for storing the microservice calling data of off-line statistics.
In one embodiment, the apparatus further comprises:
a candidate identifier obtaining module, configured to obtain a plurality of candidate identifiers; the candidate identifications respectively have corresponding candidate calling information; an identifier matching module for matching the query identifier with the plurality of candidate identifiers; a target identifier determining module, configured to determine a target identifier among the candidate identifiers; and the calling information extraction module is used for extracting candidate calling information corresponding to the target identifier as the link calling information.
According to the scheme provided by the embodiment of the invention, before the monitoring terminal displays the link calling monitoring page, the monitoring server firstly needs to collect link calling information, namely, information collection work is executed through a micro-service calling request initiated by the user terminal. And during the information acquisition period, the monitoring server records the calling information of the micro service called by the user terminal mainly by preprocessing the first identifier and the second identifier, so that the calling process is associated or marked with abnormity. By the scheme provided by the invention, the operation and maintenance personnel can utilize the link displayed by the monitoring terminal to call the monitoring page to quickly search and track all link calling information, and when the micro-service calling is abnormal, the operation and maintenance personnel can be helped to quickly locate and solve the abnormal problem, so that the functions provided by the micro-service monitoring method are more diversified.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing identification information and device information. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a method of microservice monitoring.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 8. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of microservice monitoring. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the configurations shown in fig. 7 and 8 are only block diagrams of some configurations relevant to the present disclosure, and do not constitute a limitation on the computer apparatus to which the present disclosure may be applied, and a particular computer apparatus may include more or less components than those shown in the figures, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
displaying a link calling monitoring page; the link calling monitoring page comprises an identification input inlet; receiving a query identification for the identification input entry; displaying link calling information; the link calling information is information which is inquired according to the inquiry identification and is generated when the micro service is called; when the link calling information is abnormal, receiving an abnormal query request aiming at the link calling information; responding to the abnormal query request, and displaying an abnormal query result of the link calling information; and the abnormal query result is a result of querying the link calling information.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
receiving a micro-service calling request; generating a calling record item according to the micro-service calling request; when the first identification is not included in the calling record item, generating the first identification; the first identification is used for marking the link calling information of the micro-service calling request; the first identification is used for matching with the query identification, and indicating the link calling monitoring page to display the link calling information according to the query identification.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring a second identifier in the call record item; when the second identifier is not included in the calling record item, generating the second identifier according to the first identifier; the second identification is used for recording the micro-service calling quantity; the second identifier is used for marking abnormality when the micro-service call is abnormal.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
when the calling record item comprises the first identification, generating an abnormal second identification; and the second identifier of the exception is used for marking the superior calling exception of the micro service.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring micro-service calling data; storing the micro-service calling data into a plurality of micro-service databases through a message queue, so that a server can obtain the link calling information in the plurality of micro-service databases according to the query identification; and the micro-service calling data are respectively stored in the plurality of micro-service databases according to the data types.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
the micro-service databases comprise a memory database, a search engine database, a distributed database and a relational database; the memory database is used for storing the microservice calling data counted in real time; the search engine database is used for storing short-term micro service calling data; the distributed database is used for storing the long-term micro-service calling data; and the relational database is used for storing the microservice calling data of off-line statistics.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
obtaining a plurality of candidate identifications; the candidate identifications respectively have corresponding candidate calling information; matching the query identity with the plurality of candidate identities; determining a target identifier from the plurality of candidate identifiers; and extracting candidate calling information corresponding to the target identification to be used as the link calling information.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
displaying a link calling monitoring page; the link calling monitoring page comprises an identification input inlet; receiving a query identification for the identification input entry; displaying link calling information; the link calling information is information which is inquired according to the inquiry identification and is generated when the micro service is called; when the link calling information is abnormal, receiving an abnormal query request aiming at the link calling information; responding to the abnormal query request, and displaying an abnormal query result of the link calling information; and the abnormal query result is a result of querying the link calling information.
In one embodiment, the computer program when executed by the processor further performs the steps of:
receiving a micro-service calling request; generating a calling record item according to the micro-service calling request; when the first identification is not included in the calling record item, generating the first identification; the first identification is used for marking the link calling information of the micro-service calling request; the first identification is used for matching with the query identification, and indicating the link calling monitoring page to display the link calling information according to the query identification.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a second identifier in the call record item; when the second identifier is not included in the calling record item, generating the second identifier according to the first identifier; the second identification is used for recording the micro-service calling quantity; the second identifier is used for marking abnormality when the micro-service call is abnormal.
In one embodiment, the computer program when executed by the processor further performs the steps of:
when the calling record item comprises the first identification, generating an abnormal second identification; and the second identifier of the exception is used for marking the superior calling exception of the micro service.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring micro-service calling data; storing the micro-service calling data into a plurality of micro-service databases through a message queue, so that a server can obtain the link calling information in the plurality of micro-service databases according to the query identification; and the micro-service calling data are respectively stored in the plurality of micro-service databases according to the data types.
In one embodiment, the computer program when executed by the processor further performs the steps of:
the micro-service databases comprise a memory database, a search engine database, a distributed database and a relational database; the memory database is used for storing the microservice calling data counted in real time; the search engine database is used for storing short-term micro service calling data; the distributed database is used for storing the long-term micro-service calling data; and the relational database is used for storing the microservice calling data of off-line statistics.
In one embodiment, the computer program when executed by the processor further performs the steps of:
obtaining a plurality of candidate identifications; the candidate identifications respectively have corresponding candidate calling information; matching the query identity with the plurality of candidate identities; determining a target identifier from the plurality of candidate identifiers; and extracting candidate calling information corresponding to the target identification to be used as the link calling information.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.