Micro-service monitoring method and device and computer equipment
By embedding monitoring software toolkits on service nodes and subscribing configuration information to the registration center, collecting and sending microservice running status data, the problem of large-scale deployment of microservice monitoring is solved, efficient monitoring and rapid diagnosis are achieved, and costs and responses are reduced. time.
Patent Information
- Application Number
- CN202410700805.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-17
AI Technical Summary
How to effectively monitor the running status of large-scale deployed microservices and ensure stable business operation is difficult to achieve with existing technology.
By embedding the monitoring software toolkit on the service node, subscribing to the registration center for the configuration information of the monitoring service, collecting and sending the running status data of the microservice to the monitoring node, the status monitoring of the microservice is realized, and the registration center and monitoring node are used. Exposure and subscription mechanisms reduce the intrusiveness and monitoring costs of service nodes.
It achieves efficient monitoring of microservices, reduces monitoring implementation costs, improves the operation and maintenance response efficiency of large-scale deployment of service nodes, and quickly diagnoses and solves abnormal problems through seamless access to the online intelligent diagnosis large model.
Smart Images

Figure CN118656264A
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of distributed technology and intelligent operation and maintenance technology, and in particular to a monitoring method, device and computer equipment for microservices. Background Art
[0002] With the rapid development of information technology, the application software architecture has undergone tremendous changes, and the traditional monolithic architecture has been transformed into a new distributed microservice architecture. According to the microservice architecture, an application is split into one or more microservices that can be independently developed, run, and maintained. Each microservice is loosely coupled. Each microservice, as a small application, only focuses on completing a task and completing it well.
[0003] Microservices may have abnormalities during operation. It is necessary to monitor the operating status of microservices to ensure the stable operation of the business. How to effectively monitor the operating status of large-scale deployed microservices is a technical problem that needs to be solved urgently. Summary of the invention
[0004] The embodiments of this specification provide a microservice monitoring method, apparatus, and computer equipment to effectively monitor the operating status of large-scale deployed microservices and ensure the stable operation of the business.
[0005] The embodiment of the present specification provides a microservice monitoring method, which is applied to a service node in a monitoring system, wherein a microservice is deployed on the service node, and a monitoring software toolkit is integrated in the microservice; the monitoring system further includes a registration center and a monitoring node, and the monitoring node registers configuration information of the monitoring service in the registration center; the method includes:
[0006] Subscribe to the configuration information of the monitoring service from the registration center;
[0007] Configure the monitoring software toolkit for microservices based on the configuration information;
[0008] Through the configured monitoring software toolkit, collect the running status data of the microservice when it is called;
[0009] The running status data is sent to the monitoring node through the configured monitoring software toolkit, so that the monitoring node monitors the running status of the microservice according to the running status data.
[0010] The embodiment of the present specification provides a microservice monitoring method, which is applied to a monitoring node in a monitoring system, wherein the monitoring system also includes a registration center and a service node; a microservice is deployed on the service node, and a monitoring software toolkit is integrated in the microservice; the method includes:
[0011] Register the configuration information of the monitoring service in the registration center; so that the service node can subscribe to the configuration information of the monitoring service from the registration center and configure the monitoring software toolkit of the microservice according to the configuration information;
[0012] Receiving the running status data of the microservice when it is called, which is collected by the service node through the monitoring software toolkit;
[0013] Performing abnormality analysis on the operating status data;
[0014] When the analysis results indicate that a microservice is abnormal, the operating status data is diagnosed to obtain an operation and maintenance plan.
[0015] The embodiment of the present specification also provides a microservice monitoring device, which is applied to a service node in a monitoring system, wherein a microservice is deployed on the service node, and a monitoring software toolkit is integrated in the microservice; the monitoring system further includes a registration center and a monitoring node, wherein the monitoring node registers configuration information of the monitoring service in the registration center; the device includes:
[0016] A subscription unit is used to subscribe to the configuration information of the monitoring service from the registration center;
[0017] A configuration unit, used to configure a monitoring software toolkit for microservices according to the configuration information;
[0018] The collection unit is used to collect the running status data of the microservice when it is called through the configured monitoring software toolkit;
[0019] The sending unit is used to send the running status data to the monitoring node through the configured monitoring software toolkit, so that the monitoring node monitors the running status of the microservice according to the running status data.
[0020] The embodiment of the present specification also provides a microservice monitoring device, which is applied to a monitoring node in a monitoring system, wherein the monitoring system also includes a registration center and a service node; a microservice is deployed on the service node, and a monitoring software toolkit is integrated in the microservice; the device includes:
[0021] A registration unit is used to register the configuration information of the monitoring service in the registration center, so that the service node can subscribe to the configuration information of the monitoring service from the registration center and configure the monitoring software toolkit of the microservice according to the configuration information;
[0022] A receiving unit, used to receive the running status data of the microservice when it is called, which is collected by the service node through the monitoring software toolkit;
[0023] An analysis unit, used for performing abnormal analysis on the operation status data;
[0024] The diagnostic unit is used to diagnose the running status data and obtain an operation and maintenance plan when the analysis result indicates that the microservice is abnormal.
[0025] The embodiments of the present specification also provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned microservice monitoring method when executing the computer program.
[0026] The embodiments of the present specification also provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned microservice monitoring method is implemented.
[0027] The embodiments of this specification also provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the above-mentioned microservice monitoring method is implemented.
[0028] The monitoring method of the microservice of the embodiment of this specification can subscribe to the configuration information of the monitoring service from the registration center; the monitoring software toolkit of the microservice can be configured according to the configuration information; the running status data of the microservice when it is called can be collected through the configured monitoring software toolkit; the running status data can be sent to the monitoring node through the configured monitoring software toolkit, so that the monitoring node monitors the running status of the microservice according to the running status data. In this way, the monitoring software toolkit of the microservice is configured by embedding the monitoring software toolkit in the microservice of the service node, and by subscribing to the configuration information of the monitoring service from the registration center; and then the running status data of the microservice when it is called is collected and sent to the monitoring node through the configured monitoring software toolkit, so as to monitor the running status of the microservice. In this way, through the exposure and subscription mechanism of the monitoring service, the service node does not need to independently customize and maintain the configuration information. The implementation of monitoring will not cause additional overhead to the service node, and the invasiveness to the service node is small, which greatly reduces the cost of implementing microservice monitoring. Ensure the stable operation of the business. In addition, while realizing effective monitoring of the service node call situation, it also greatly improves the operation and maintenance response efficiency of large-scale deployment of service nodes through seamless access to the online intelligent diagnosis model. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. The drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0030] Figure 1 This is a functional structure diagram of the monitoring system in the embodiment of this specification;
[0031] Figure 2 This is a flowchart of a method for monitoring microservices in an embodiment of this specification;
[0032] Figure 3 This is a flowchart of a method for monitoring microservices in an embodiment of this specification;
[0033] Figure 4 This is a schematic diagram of the structure of a monitoring device for microservices in an embodiment of this specification;
[0034] Figure 5 Schematic diagram of the structure of the monitoring device of the microservice in the embodiment of this specification. DETAILED DESCRIPTION
[0035] The technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, rather than all of the embodiments. The specific embodiments described herein are only used to explain the present disclosure, rather than to limit the present disclosure. Based on the described embodiments of the present disclosure, all other embodiments obtained by those of ordinary skill in the art are within the scope of protection of the present disclosure. In addition, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0036] Microservice architecture is a software architecture that can split applications into one or more microservices with finer granularity according to their functions. The granularity of these microservices is small enough that they can be independently deployed, developed and maintained to implement an independent function (such as order management, user management, etc.). The microservices of the application are loosely coupled and can communicate through some lightweight communication mechanisms, such as REST API (Representational State Transfer Application Programming Interface) or RPC (Remote Procedure Call).
[0037] See also Figure 1. An embodiment of this specification provides a monitoring system. The monitoring system may include one or more service nodes, a registration center, and a monitoring node. The service node may include a computer device such as a server. A microservice is deployed on the service node. A monitoring software toolkit (Monitor-SDK) is integrated in the microservice. The monitoring software toolkit is used to monitor the running status of the microservice when it is called. The registration center may include a computer device such as a server. The registration center is used for registration of service nodes and monitoring nodes. The monitoring node may include a computer device such as a server. The monitoring node is used to monitor the running status of the microservice to analyze whether the microservice is abnormal.
[0038] In some embodiments, the microservice of each service node can be registered in the registration center. For example, each service node can register the identification information and address information of the microservice in the registration center. Among them, the identification information of the microservice may include the name, number, and other information of the microservice that can be used to identify the microservice. The address information of the microservice may include the communication address of the service node (such as the IP address), the calling interface of the microservice, etc. For example, each service node can send the identification information and address information of the microservice to the registration center. The registration center can receive the identification information and address information uploaded by the service node; a corresponding relationship between the identification information and the address information can be established, thereby realizing the registration of the microservice.
[0039] Registration can be used to expose microservices, making it easier to call and monitor them.
[0040] In some embodiments, the monitoring node is used to provide a monitoring service (Monitor-Service) for a microservice to monitor whether an abnormality occurs in the microservice. The monitoring node can be registered in the registration center. For example, the monitoring node can register the configuration information of the monitoring service in the registration center. Among them, the configuration information includes at least one of the following: the address information of the monitoring service, the monitoring parameters of the monitoring software toolkit. The address information of the monitoring service may include the communication address (such as the IP address) of the monitoring node, the calling interface of the monitoring service, etc. The monitoring parameters include the data items that need to be collected, the upload conditions that need to be met for uploading data to the monitoring node, the format of the uploaded data, etc. For example, the data items include at least one of the following: the service cluster information where the microservice is located, the identification information of the microservice, the address information of the microservice, the name of the calling method, whether the call is successful, the return code of the failed call, the response time of the microservice, and the address information of the caller (such as the IP address). The caller includes other microservices that call the microservice. The response time includes the time it takes for the microservice to process the transaction call. The upload condition includes at least one of the following: the number of calls to the microservice reaches a set number, and the monitoring cycle is reached. The set number can be, for example, 3, 5, 10, etc. The monitoring period may include 1 minute, 5 minutes, 10 minutes, 1 hour, etc. For example, the monitoring node may send configuration information of the monitoring service to the registration center, and the registration center may receive the configuration information.
[0041] In some examples, different microservices have different functions under the microservice architecture, so different configurations are required for the monitoring software toolkits in different microservices. To this end, the monitoring node can send a microservice identification information acquisition request to the registration center. The registration center can receive the microservice identification information acquisition request; the identification information of all registered microservices can be sent to the monitoring node. The monitoring node can receive the identification information of all registered microservices. The operation and maintenance personnel can set configuration information for the monitoring software toolkits in all registered microservices. The monitoring node can obtain the configuration information of the monitoring software toolkits in all registered microservices; the identification information and configuration information corresponding to the same microservice can be established; the identification information of all registered microservices and the configuration information of the monitoring software toolkits in the microservices can be sent to the registration center. The registration center can receive the identification information of all registered microservices and the configuration information of the monitoring software toolkits in the microservices.
[0042] The monitoring service is exposed through registration, which makes it easy for service nodes to subscribe to the monitoring service through the registration center. In this way, through the exposure and subscription mechanism of the monitoring service, the service node does not need to independently customize and maintain the configuration information. The implementation of monitoring will not cause additional overhead to the service node, and the intrusion to the service node is small, which greatly reduces the cost of implementing microservice monitoring.
[0043] In some embodiments, the service node may subscribe to the configuration information of the monitoring service from the registration center; the monitoring software toolkit of the microservice may be configured according to the configuration information. For example, the monitoring software toolkit may be integrated into the microservice of the service node. After the microservice is started, the monitoring software toolkit may be initialized. During the initialization of the monitoring software toolkit, the service node may subscribe to the configuration information of the monitoring service from the registration center. For example, the service node may send a configuration information acquisition request to the registration center. After receiving the configuration information acquisition request, the registration center may feedback the configuration information of the monitoring service. This allows the service node to configure the monitoring software toolkit according to the configuration information.
[0044] The service node can set the monitoring software toolkit according to the address information. The service node can send the running status data of the microservice to the monitoring node according to the address information of the monitoring service. The service node can set the monitoring software toolkit according to the monitoring parameters. The service node can collect the running status data of the microservice according to the data items required to be collected by the monitoring service; and can send the running status data of the microservice to the monitoring node according to the data upload conditions of the monitoring service.
[0045] In some embodiments, the microservices in the one or more service nodes can call each other. For example, for a transaction, multiple microservices need to work together to implement the transaction. The collaborative work involves calls between microservices.
[0046] For example, the microservices in the one or more service nodes may include microservices in the transaction system, which may specifically include user services, product services, shopping cart services, order services, payment services, notification services, logistics services, etc. The user service is used to process user login requests, including verifying user names and passwords, etc. The product service is used to provide product details, including prices, inventory information, etc. The shopping cart service is used to check the inventory status of the product, so as to add the product to the user's shopping cart. The order service is used to generate an order based on the product information in the shopping cart. The payment service is used to make a payment based on the order generated by the order service. The notification service is used to notify the user of the product purchase result based on the payment result of the payment service. The physical service is used to process shipment, logistics tracking, etc. based on the order generated by the order service. The user service, the product service, the shopping cart service, the order service, the payment service, the notification service, and the logistics service are loosely coupled. The calls between them can be implemented through RPC, message queues, etc.
[0047] The microservice that provides the service business function can be called a provider, and the microservice that calls the provider can be called a consumer. When the provider needs to be called, the consumer can send the identification information of the provider to the registration center. The registration center can receive the identification information of the provider; based on the corresponding relationship between the identification information and the address information, the address information of the provider can be obtained based on the identification information of the provider; and the address information of the provider can be sent to the consumer. The consumer can send a call request to the provider based on the address information of the provider. The call request can include business parameters. The provider can receive the call request and process the call request based on the business parameters.
[0048] In some embodiments, the service node can collect the running status data of the microservice when it is called through the configured monitoring software toolkit; and can send the running status data to the monitoring node so that the monitoring node monitors the running status of the microservice according to the running status data. After receiving the call request for its own microservice, the service node can collect the running status data of the microservice when processing the call request through the configured monitoring software toolkit.
[0049] The microservice in the service node receives the call request, and the microservice in the service node can be a provider.
[0050] The monitoring parameters are configured in the monitoring software toolkit. The monitoring parameters include the data items that need to be collected. The service node can collect the running status data of the microservice when it is called according to the data items indicated by the monitoring parameters. For example, the service node can collect the identification information of the microservice, the address information of the microservice, the name of the calling method, whether the call is successful, the return code of the failed call, the response time of the microservice, and the address information of the caller (such as the IP address).
[0051] Monitoring parameters are configured in the monitoring software toolkit. The monitoring parameters include upload conditions that need to be met to upload data to the monitoring node. This allows the service node to send the collected running status data to the monitoring node when the upload conditions are met. The upload conditions may include at least one of the following: the number of calls to the microservice reaches a set number, and the monitoring cycle is reached.
[0052] The service node sends the running status data when the upload conditions are met, so that the running status data of multiple calls can be aggregated and sent to the monitoring node. This can reduce network overhead, improve efficiency, and reduce the pressure on the monitoring system.
[0053] In some embodiments, the monitoring node may receive the operation status data uploaded by each service node; may perform an abnormal analysis on the operation status data of each service node; and may generate a prompt message when the analysis result indicates that an abnormal microservice has occurred. The prompt message may include identification information of the abnormal microservice. The prompt message is used to prompt the microservice abnormality. In some examples, the monitoring node may also send a prompt message to a terminal device for operation and maintenance personnel. The terminal device may receive and display the prompt message so that the operation and maintenance personnel know the abnormal microservice. Intelligent operation and maintenance of microservices is realized.
[0054] For example, when the service node detects that the number of calls to the microservice reaches a set number, it can send the operating status data of the microservice when the set number of calls is called to the monitoring node. The monitoring node can perform an abnormality analysis on the operating status data when the set number of calls is called; when the operating status data when the set number of calls meets the abnormal conditions, it is determined that the microservice is abnormal. For example, when the number of failed calls reaches a set value, it is determined that the microservice is abnormal. For another example, when the number of calls where the response time exceeds the time threshold reaches a set value, it is determined that the microservice is abnormal.
[0055] For another example, after detecting that the monitoring period has been reached, the service node may also send the operating status data collected during the monitoring period to the monitoring node. The monitoring node may perform an abnormality analysis on the operating status data collected during the monitoring period; when the operating status data collected during the monitoring period meets the abnormal condition, it is determined that the microservice is abnormal. For example, when the number of failed calls reaches a set value, it is determined that the microservice is abnormal. For another example, when the number of calls where the response time exceeds the time threshold reaches a set value, it is determined that the microservice is abnormal.
[0056] In some embodiments, when the analysis results indicate that a microservice is abnormal, the monitoring node can also diagnose the running status data to obtain an operation and maintenance plan. The monitoring node can send the operation and maintenance plan to the terminal device for the operation and maintenance personnel. The terminal device can receive and display the operation and maintenance plan. The operation and maintenance plan may include the cause of the abnormality, a solution, etc. Among them, the cause of the abnormality may include memory overflow, CPU surge, disk io blockage, network card performance abnormality, etc. The solution may include server capacity expansion, fault node isolation, network node unblocking, etc. The operation and maintenance personnel can restore the abnormal maintenance service to normal operation through the operation and maintenance plan. Achieve efficient problem diagnosis and provide an operation and maintenance plan.
[0057] The monitoring node may be deployed with a diagnostic model. The diagnostic model may be trained based on historical operating status data and corresponding operation and maintenance solutions. The monitoring node may input the operating status data sent by the service node into the diagnostic model to obtain an operation and maintenance solution. For example, when the service node detects that the number of calls to the microservice reaches a set number, it may send the operating status data of the microservice when it is called a set number of times to the monitoring node. Then the monitoring node may input the operating status data when it is called a set number of times into the diagnostic model to obtain an operation and maintenance solution. For another example, the service node may also send the operating status data collected during the monitoring period to the monitoring node after detecting that the monitoring period has been reached. Then the monitoring node may input the operating status data collected during the monitoring period into the diagnostic model to obtain an operation and maintenance solution.
[0058] For example, based on the diagnostic model, the monitoring node can determine the cause of the failed call according to the return code of the failed call, and determine the possible cause of the exception based on the response time of the microservice and the address information of the caller, determine the solution corresponding to the cause of the exception, and form an operation and maintenance plan based on the cause of the exception and the solution.
[0059] In this way, while effectively monitoring the service node calls, it also greatly improves the operation and maintenance response efficiency of large-scale deployed service nodes through seamless access to the online intelligent diagnosis model.
[0060] In some examples, the operating status data may include identification information of the microservice and identification information of other microservices that call the microservice. Then the monitoring node can determine the call link based on the identification information of the microservice and the identification information of the other microservices. The call link includes the microservice and the other microservices. The call link includes multiple microservices with call relationships. Each microservice in the call link is used to execute the transaction corresponding to the transaction type. The monitoring node can determine the corresponding transaction type based on the call link. For example, the monitoring node can provide a transaction type set, and the transaction type set includes one or more transaction types, and each transaction type corresponds to a call link. Therefore, the corresponding transaction type can be queried in the transaction type set according to the call link.
[0061] The same microservice can have different operation and maintenance solutions when executing transactions corresponding to different transaction types. To this end, the monitoring node can obtain the operation and maintenance solution of the microservice in the call link; a correspondence between the transaction type and the operation and maintenance solution can be established to form a knowledge base. The knowledge base includes one or more operation and maintenance solutions corresponding to transaction types. The knowledge base is used for query by operation and maintenance personnel. For example, a terminal device for operation and maintenance personnel can send a query request to the monitoring node, and the query request includes the transaction type. The monitoring node can receive the query request; the operation and maintenance solution corresponding to the transaction type can be obtained in the knowledge base; and the operation and maintenance solution can be fed back to the terminal device. The terminal device can receive and display the operation and maintenance solution. In this way, the operation and maintenance personnel can obtain the required and more reliable operation and maintenance solutions for each transaction type by querying the knowledge base.
[0062] See also Figure 2 The embodiment of this specification also provides a microservice monitoring method. The method is applied to a service node in a monitoring system. The method may include the following steps.
[0063] Step 11: Subscribe to the monitoring service configuration information from the registration center.
[0064] The service node may send a configuration information acquisition request to the registration center. After receiving the configuration information acquisition request, the registration center may feedback the configuration information of the monitoring service. This allows the service node to configure the monitoring software toolkit according to the configuration information. Alternatively, different microservices are deployed on different service nodes. Different microservices have different functions, and thus need to adopt different operating status data. To this end, the service node may send a configuration information acquisition request to the registration center, and the configuration information acquisition request may include the identification information of the service node. The registration center may receive the configuration information acquisition request; may obtain configuration information matching the identification information of the service node according to the correspondence between the identification information and the configuration information; and may send the configuration information to the service node. The service node may receive the configuration information; and may configure the monitoring software toolkit according to the configuration information. The configuration information may include the address information of the monitoring service and the monitoring parameters of the monitoring software toolkit. Among them, in the correspondence between the identification information and the configuration information, one identification information may correspond to one configuration information, and one configuration information may correspond to one or more identification information.
[0065] Step 12: Configure the monitoring software toolkit for the microservice according to the configuration information.
[0066] The service node can set the monitoring software toolkit according to the address information. The service node can send the running status data of the microservice to the monitoring node according to the address information of the monitoring service. The service node can set the monitoring software toolkit according to the monitoring parameters. The service node can collect the running status data of the microservice according to the data items required to be collected by the monitoring service; and can send the running status data of the microservice to the monitoring node according to the data upload conditions of the monitoring service.
[0067] Step 13: Collect the running status data of the microservice when it is called through the configured monitoring software toolkit.
[0068] Step 14: Send the running status data to the monitoring node through the configured monitoring software toolkit, so that the monitoring node monitors the running status of the microservice according to the running status data.
[0069] In some embodiments, the service node can collect the running status data of the microservice when it is called through the configured monitoring software toolkit; and can send the running status data to the monitoring node so that the monitoring node monitors the running status of the microservice according to the running status data. After receiving the call request for its own microservice, the service node can collect the running status data of the microservice when processing the call request through the configured monitoring software toolkit.
[0070] In some embodiments, after receiving a call request for its own microservice, the service node may collect the running status data of the microservice when processing the call request through a configured monitoring software toolkit.
[0071] The monitoring parameters are configured in the monitoring software toolkit. The monitoring parameters include the data items that need to be collected. The service node can collect the running status data of the microservice when it is called according to the data items indicated by the monitoring parameters. For example, the service node can collect the identification information of the microservice, the address information of the microservice, the name of the calling method, whether the call is successful, the return code of the failed call, the response time of the microservice, and the address information of the caller (such as the IP address).
[0072] Monitoring parameters are configured in the monitoring software toolkit. The monitoring parameters include upload conditions that need to be met to upload data to the monitoring node. This allows the service node to send the collected running status data to the monitoring node when the upload conditions are met. The upload conditions may include at least one of the following: the number of calls to the microservice reaches a set number, and the monitoring cycle is reached.
[0073] The service node sends the running status data when the upload conditions are met, so that the running status data of multiple calls can be aggregated and sent to the monitoring node. This can reduce network overhead, improve efficiency, and reduce the pressure on the monitoring system.
[0074] The monitoring method of the microservice of the embodiment of this specification can subscribe to the configuration information of the monitoring service from the registration center; the monitoring software toolkit of the microservice can be configured according to the configuration information; the running status data of the microservice when it is called can be collected through the configured monitoring software toolkit; the running status data can be sent to the monitoring node through the configured monitoring software toolkit, so that the monitoring node monitors the running status of the microservice according to the running status data. In this way, by embedding the monitoring software toolkit in the microservice of the service node, and by subscribing to the configuration information of the monitoring service from the registration center, the monitoring software toolkit of the microservice is configured; and then, by collecting and sending the running status data of the microservice when it is called to the monitoring node through the configured monitoring software toolkit, the running status of the microservice is monitored. Through the exposure and subscription mechanism of the monitoring service, the service node does not need to independently customize and maintain the configuration information. The implementation of monitoring will not cause additional overhead to the service node, and the invasiveness to the service node is small, which greatly reduces the cost of implementing microservice monitoring.
[0075] See also Figure 3 The embodiment of this specification also provides a microservice monitoring method. The method is applied to a monitoring node in a monitoring system. The method may include the following steps.
[0076] Step 21: Register the configuration information of the monitoring service in the registration center; so that the service node can subscribe to the configuration information of the monitoring service from the registration center and configure the monitoring software toolkit of the microservice according to the configuration information.
[0077] Step 22: Receive the running status data of the microservice when it is called, which is collected by the service node through the monitoring software toolkit.
[0078] Step 23: Perform abnormal analysis on the operating status data.
[0079] Step 24: When the analysis results indicate that the microservice is abnormal, diagnose the operating status data to obtain an operation and maintenance plan.
[0080] In some embodiments, the monitoring node may receive the operation status data uploaded by each service node; may perform an abnormality analysis on the operation status data of each service node; and may generate a prompt message when the analysis result indicates that an abnormality has occurred in a microservice. The prompt message includes the identification information of the abnormal microservice. The prompt message is used to prompt the microservice abnormality.
[0081] In some embodiments, when the analysis result indicates that the microservice is abnormal, the monitoring node can diagnose the running status data to obtain an operation and maintenance plan. The monitoring node can be deployed with a diagnostic model. The monitoring node can input the running status data sent by the service node into the diagnostic model to obtain an operation and maintenance plan. The diagnostic model can determine the cause of the failed call based on the return code of the failed call, and determine the possible problem points in combination with the response time of the microservice and the address information of the caller, thereby outputting the cause of the abnormality and the solution.
[0082] The monitoring method of the microservice in the embodiment of this specification can register the configuration information of the monitoring service in the registration center; can receive the running status data of the microservice when it is called, which is collected by the service node through the monitoring software toolkit; can perform abnormal analysis on the running status data; can diagnose the running status data and obtain an operation and maintenance plan when the analysis result indicates that the microservice is abnormal. In this way, while effectively monitoring the calling status of the service node, it also greatly improves the operation and maintenance response efficiency of large-scale deployment of service nodes by seamlessly accessing the online intelligent diagnosis model.
[0083] See also Figure 4 The embodiment of this specification also provides a microservice monitoring device, which is applied to a service node in a monitoring system. The monitoring device may include the following units.
[0084] A subscription unit 31, used to subscribe to the configuration information of the monitoring service from the registration center;
[0085] A configuration unit 32, configured to configure a monitoring software toolkit for the microservice according to the configuration information;
[0086] The collection unit 33 is used to collect the running status data of the microservice when it is called through the configured monitoring software toolkit;
[0087] The sending unit 34 is used to send the running status data to the monitoring node through the configured monitoring software toolkit, so that the monitoring node monitors the running status of the microservice according to the running status data.
[0088] See also Figure 5 The embodiment of this specification also provides a microservice monitoring device, which is applied to a monitoring node in a monitoring system. The monitoring device may include the following units.
[0089] A registration unit 41 is used to register the configuration information of the monitoring service in the registration center, so that the service node can subscribe to the configuration information of the monitoring service from the registration center and configure the monitoring software toolkit of the microservice according to the configuration information;
[0090] A receiving unit 42 is used to receive the running status data of the microservice when it is called, which is collected by the service node through the monitoring software toolkit;
[0091] An analysis unit 43, used for performing abnormal analysis on the operation status data;
[0092] The diagnosis unit 44 is used to diagnose the operation status data and obtain an operation and maintenance plan when the analysis result indicates that the microservice is abnormal.
[0093] The embodiments of the present specification also provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned microservice monitoring method when executing the computer program.
[0094] The embodiments of the present specification also provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned microservice monitoring method is implemented.
[0095] The embodiments of this specification also provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the above-mentioned microservice monitoring method is implemented.
[0096] Those skilled in the art will appreciate that this specification may be provided as a method, system, or computer program product. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0097] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products of the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. The computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0098] The various functional units in the embodiments of this specification may be integrated into one processing unit, or each functional unit may exist physically separately, or two or more functional units may be integrated into one processing unit.
[0099] Those skilled in the art will understand that the description of each embodiment in this specification has its own emphasis. For parts not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments. In addition, it is understood that after reading this specification, those skilled in the art can think of any combination of some or all of the embodiments listed in this specification without creative work, and these combinations are also within the scope of disclosure and protection of this specification.
[0100] Although the present specification is described by way of examples, it is known to those skilled in the art that the above examples are only used to help understand the core idea of the present specification. It is understood by those skilled in the art that there are many variations and changes in the present specification. It is hoped that the appended claims include these variations and changes without departing from the spirit of the present specification.
Claims
1. A microservice monitoring method, characterized in that: A service node applied to a monitoring system, wherein a microservice is deployed on the service node, and a monitoring software toolkit is integrated in the microservice; the monitoring system further comprises a registration center and a monitoring node, and the monitoring node registers configuration information of the monitoring service in the registration center; the method comprises: Subscribe to the configuration information of the monitoring service from the registration center; Configure the monitoring software toolkit for microservices based on the configuration information; Through the configured monitoring software toolkit, collect the running status data of the microservice when it is called; The running status data is sent to the monitoring node through the configured monitoring software toolkit, so that the monitoring node monitors the running status of the microservice according to the running status data.
2. The method according to claim 1, characterized in that The steps of subscribing to configuration information include: Sending a configuration information acquisition request to a registration center, wherein the configuration information acquisition request includes identification information of the service node; Receiving configuration information sent by the registration center that matches the identification information; The configuration information includes address information of the monitoring service and monitoring parameters of the monitoring software toolkit.
3. The method according to claim 1, characterized in that The steps of collecting operation status data include: After receiving a call request for a microservice, the running status data of the microservice when processing the call request is collected.
4. The method according to claim 3, characterized in that The running status data includes identification information of the microservice and identification information of other microservices that call the microservice. The monitoring node is used to determine a call link according to the identification information of the microservice and the identification information of the other microservices, determine a corresponding transaction type according to the call link, establish a correspondence between the transaction type and the operation and maintenance plan of the microservice in the call link, and form a knowledge base.
5. The method according to claim 1, characterized in that The steps of sending the running status data include: Through the configured monitoring software toolkit, when it is detected that the number of calls to the microservice reaches a set number, the operating status data of the microservice when the set number of calls is sent to the monitoring node; or, through the configured monitoring software toolkit, after it is detected that the monitoring cycle is reached, the operating status data collected during the monitoring cycle is sent to the monitoring node.
6. The method according to claim 1, characterized in that The method further comprises: Register the microservice's identification information and address information with the registration center.
7. The method according to claim 1, characterized in that The monitoring node is used to perform abnormal analysis on the running status data. When the analysis result indicates that the microservice is abnormal, the running status data is diagnosed to obtain an operation and maintenance plan.
8. A microservice monitoring method, characterized in that: A monitoring node applied to a monitoring system, wherein the monitoring system also includes a registration center and a service node; A microservice is deployed on the service node, and a monitoring software toolkit is integrated in the microservice; the method includes: Register the configuration information of the monitoring service in the registration center; so that the service node can subscribe to the configuration information of the monitoring service from the registration center and configure the monitoring software toolkit of the microservice according to the configuration information; Receiving the running status data of the microservice when it is called, which is collected by the service node through the monitoring software toolkit; Performing abnormality analysis on the operating status data; When the analysis results indicate that a microservice is abnormal, the operating status data is diagnosed to obtain an operation and maintenance plan.
9. A microservice monitoring device, characterized in that: A service node applied to a monitoring system, wherein a microservice is deployed on the service node, and a monitoring software toolkit is integrated in the microservice; the monitoring system further comprises a registration center and a monitoring node, and the monitoring node registers configuration information of the monitoring service in the registration center; the device comprises: A subscription unit is used to subscribe to the configuration information of the monitoring service from the registration center; A configuration unit, used to configure a monitoring software toolkit for microservices according to the configuration information; The collection unit is used to collect the running status data of the microservice when it is called through the configured monitoring software toolkit; The sending unit is used to send the running status data to the monitoring node through the configured monitoring software toolkit, so that the monitoring node monitors the running status of the microservice according to the running status data.
10. A microservice monitoring device, characterized in that: A monitoring node applied to a monitoring system, wherein the monitoring system also includes a registration center and a service node; A microservice is deployed on the service node, and a monitoring software toolkit is integrated in the microservice; the device includes: A registration unit is used to register the configuration information of the monitoring service in the registration center, so that the service node can subscribe to the configuration information of the monitoring service from the registration center and configure the monitoring software toolkit of the microservice according to the configuration information; A receiving unit, used to receive the running status data of the microservice when it is called, which is collected by the service node through the monitoring software toolkit; An analysis unit, used for performing abnormal analysis on the operation status data; The diagnostic unit is used to diagnose the running status data and obtain an operation and maintenance plan when the analysis result indicates that the microservice is abnormal.
11. A computer device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 8 by executing the instructions.
Citation Information
Cited By
Micro-service supervision method and device, equipment and storage medium
CN119996497A
