Method and device for implementing monitoring microservices, storage medium and electronic device
By automatically generating and automatically adjusting the monitoring configuration files of microservices, and using the K-means clustering algorithm to process historical data, the problem of low monitoring efficiency in the microservice architecture is solved, and efficient monitoring and resource conservation is achieved.
Patent Information
- Application Number
- CN202310987121.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-07
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2043-08-07
AI Technical Summary
In the microservice architecture, it is difficult for the existing technology to efficiently monitor and adjust microservices, resulting in low operation and maintenance work efficiency and occupying a lot of human resources.
By determining the business type of microservices, obtaining historical monitoring configuration data and result data, automatically generating and automatically adjusting monitoring configuration files, using the K-means clustering algorithm to process registration and access data, generate initial monitoring configuration files, and performing them based on monitoring results Optimize and adjust.
It reduces manual intervention, realizes automatic generation and automatic adjustment of monitoring configuration files, improves overall monitoring efficiency, and saves resources.
Smart Images

Figure CN117009179B_ABST
Abstract
Description
Background Art
[0002] With the rapid development of computer technology and cloud computing technology, microservice architecture has become an inevitable choice. The large-scale microservices and the complexity of services have brought huge challenges to operation and maintenance.
[0003] In related technologies, when a new microservice needs to be monitored, a set of default monitoring configurations is usually provided indiscriminately, and then the operation and maintenance personnel make adjustments based on their own experience and observed data. This takes up more human resources and has low monitoring efficiency.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the present disclosure is to provide a method, device, electronic device and storage medium for implementing monitoring microservices, which can reduce manual intervention and realize automatic generation and automatic adjustment of monitoring configuration files, thereby saving adjustment resources and improving overall monitoring efficiency.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] According to one aspect of the present disclosure, a method for implementing monitoring microservices is provided, including: in response to a request to create a monitoring instance for a target microservice, determining a business type of the target microservice; obtaining historical monitoring configuration data of historical microservices under the business type, and generating a monitoring configuration file for the target microservice according to the historical monitoring configuration data; monitoring the target microservice using the monitoring configuration file, obtaining target monitoring result data of the target microservice, and obtaining historical monitoring result data of the historical microservice; updating the monitoring configuration file according to the historical monitoring result data and the target monitoring result data, so as to monitor the target microservice using the updated monitoring configuration file.
[0008] In one embodiment of the present disclosure, determining the business type of a target microservice includes: obtaining historical registration data and historical access data of a registered microservice, and obtaining target registration data of a target microservice; calling a K-means clustering algorithm and obtaining the number of types of business types; using the number of types as a clustering parameter of the K-means clustering algorithm, processing the historical registration data, the historical access data, and the target registration data through the K-means clustering algorithm, and thereby obtaining the business type of the registered microservice and the business type of the target microservice.
[0009] In one embodiment of the present disclosure, historical monitoring configuration data of a historical microservice includes: a historical fault response time of the historical microservice, and historical monitoring indicator parameters in each monitoring indicator of the historical microservice; wherein, generating a monitoring configuration file of a target microservice according to the historical monitoring configuration data includes: determining a historical microservice whose historical fault response time is less than a response time threshold as a first candidate microservice; and generating a monitoring configuration file of the target microservice according to the historical monitoring indicator parameters in each monitoring indicator of the first candidate microservice.
[0010] In one embodiment of the present disclosure, a monitoring configuration file of a target microservice is generated according to historical monitoring indicator parameters in each monitoring indicator of a first candidate microservice, including: determining a parameter mode corresponding to each monitoring indicator according to historical monitoring indicator parameters in each monitoring indicator of all first candidate microservices; determining initial monitoring indicator parameters in each monitoring indicator of the target microservice according to the parameter mode corresponding to each monitoring indicator; and generating a monitoring configuration file of the target microservice according to the initial monitoring indicator parameters.
[0011] In one embodiment of the present disclosure, the historical monitoring result data of the historical microservice includes: the historical indicator value of the historical microservice under each monitoring indicator; the target monitoring result data of the target microservice includes: the target indicator value of the target microservice under each monitoring indicator; wherein, the monitoring configuration file is updated according to the historical monitoring result data and the target monitoring result data, including: determining the historical operation characteristics of the historical microservice according to the historical indicator value of the historical microservice under each monitoring indicator; and determining the target operation characteristics of the target microservice according to the target indicator value of the target microservice under each monitoring indicator; determining the similarity between each historical microservice and the target microservice according to the historical operation characteristics and the target operation characteristics of each historical microservice; determining the historical microservice whose similarity exceeds the similarity threshold as the second candidate microservice; and updating the monitoring configuration file according to the historical indicator value of the second candidate microservice under each monitoring indicator and the target indicator value of the target microservice under each monitoring indicator.
[0012] In one embodiment of the present disclosure, according to the historical indicator values of the second candidate microservice under each monitoring indicator and the target indicator values of the target microservice under each monitoring indicator, the monitoring configuration file is updated, including: performing a correlation analysis of specified factors on the historical indicator values of the second candidate microservice under each monitoring indicator, and then determining the historical key indicators from the monitoring indicators; performing a correlation analysis of specified factors on the target indicator values of the target microservice under each monitoring indicator, and then determining the target key indicators from the monitoring indicators; determining the key monitoring indicators and the indicator parameters therein according to the historical key indicators and the target key indicators; updating the monitoring configuration file according to the key monitoring indicators and the indicator parameters therein; wherein the specified factors include failure factors and response time factors.
[0013] In one embodiment of the present disclosure, the monitoring configuration file is updated according to the historical indicator value of the second candidate microservice under each monitoring indicator and the target indicator value of the target microservice under each monitoring indicator, including: periodically analyzing the historical indicator value of the second candidate microservice under each monitoring indicator to obtain the operation change trend data of the second candidate microservice; periodically analyzing the target indicator value of the target microservice under each monitoring indicator to obtain the operation change trend data of the target microservice; determining the adjustment value of the collection frequency according to the operation change trend data of the second candidate microservice and the operation change trend data of the target microservice; updating the monitoring configuration file according to the adjustment value of the collection frequency; wherein the change trend data includes access volume change trend data, error rate change trend data and load change trend data.
[0014] In one embodiment of the present disclosure, according to the historical indicator value of the second candidate microservice under each monitoring indicator and the target indicator value of the target microservice under each monitoring indicator, the monitoring configuration file is updated, including: performing service quality analysis on the historical indicator value of the second candidate microservice under each monitoring indicator and the target indicator value of the target microservice under each monitoring indicator to obtain a service quality level range and a target service quality of the target microservice; determining a monitoring importance level of the target microservice according to the service quality level range and the target service quality; and updating the monitoring configuration file according to the monitoring importance level.
[0015] According to another aspect of the present disclosure, there is provided an implementation device for monitoring a microservice, characterized in that it includes: a business type determination module, used to determine the business type of a target microservice in response to a request to create a monitoring instance for a target microservice; a configuration file generation module, used to obtain historical monitoring configuration data of historical microservices under the business type, and generate a monitoring configuration file of the target microservice according to the historical monitoring configuration data; a monitoring module, used to monitor the target microservice using the monitoring configuration file, obtain target monitoring result data of the target microservice, and obtain historical monitoring result data of the historical microservice; a configuration file update module, used to update the monitoring configuration file according to the historical monitoring result data and the target monitoring result data, so as to monitor the target microservice using the updated monitoring configuration file.
[0016] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned method for implementing the monitoring microservice is implemented.
[0017] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the above-mentioned implementation method of the monitoring microservice by executing the executable instructions.
[0018] The implementation method of monitoring microservices provided by the embodiments of the present disclosure can, on the one hand, automatically generate and recommend an initial monitoring configuration file for the target microservice based on the historical monitoring configuration data used by the historical microservices of the same business type as the target microservice. Since the initial monitoring configuration file is generated based on the historical microservices of the same business type, the monitoring indicators therein are reasonably configured and have a good monitoring effect. On the other hand, after monitoring the target microservice for a period of time using the monitoring configuration file, the monitoring indicators that need to be adjusted, the operating rules, etc. can be automatically determined based on the historical monitoring result data of the historical microservices of the same business type as the target microservice, and the target monitoring result data of the target microservice, and then the monitoring configuration file of the target microservice is automatically optimized and adjusted based on the monitoring indicators or operating rules that need to be adjusted. The method provided by the present disclosure can reduce manual intervention, realize the automatic generation and automatic adjustment of the monitoring configuration file, thereby saving adjustment resources and improving the overall monitoring efficiency.
[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0021] Figure 1 A schematic diagram of a network architecture of a method for implementing a monitoring microservice in accordance with an embodiment of the present disclosure is shown;
[0022] Figure 2 A flowchart of a method for implementing monitoring microservices in an embodiment of the present disclosure is shown;
[0023] Figure 3 A flowchart of updating a monitoring configuration file in a method for implementing a monitoring microservice in an embodiment of the present disclosure is shown;
[0024] Figure 4 A schematic diagram showing a method for implementing a monitoring microservice in an embodiment of the present disclosure is shown;
[0025] Figure 5 A block diagram showing an implementation device for monitoring microservices according to an embodiment of the present disclosure; and
[0026] Figure 6 A structural block diagram of a computer device for implementing a monitoring microservice in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0027] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0028] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0029] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present disclosure, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0030] Figure 1 A schematic diagram of a network architecture to which an implementation method for monitoring microservices according to an embodiment of the present disclosure can be applied is shown.
[0031] like Figure 1 As shown, the system architecture may include a server 101, a network 102, and a client 103. The network 102 is used to provide a medium for a communication link between the client 103 and the server 101. The network 102 may include various connection types, such as wired, wireless communication links, or optical fiber cables.
[0032] In an exemplary embodiment, the server 101 may be a server that provides various services, such as a background management server that provides support for the device operated by the user using the client 103. The background management server may analyze and process the received request and other data, and feed back the processing results to the client 103. The server 101 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. In some practical applications, the server 101 may also be a server of a network platform, which may be, for example, a trading platform, a live broadcast platform, a social platform, or a music platform, etc., which is not limited in the embodiments of the present disclosure. Among them, the server may be a single server or a cluster formed by multiple servers, and the present disclosure does not limit the specific architecture of the server.
[0033] In an exemplary embodiment, the client 103 that transmits data with the server 101 may include, but is not limited to, electronic devices such as smart phones, desktop computers, tablet computers, laptops, smart speakers, digital assistants, AR (Augmented Reality) devices, VR (Virtual Reality) devices, and smart wearable devices, but is not limited to these.
[0034] In an exemplary embodiment, a user may register a target microservice through the client 103, during which a request to create a monitoring instance for the target microservice may be generated and sent to the server 101; the server 101 may receive the request to create a monitoring instance for the target microservice from the client 103, and thereby start to execute the implementation method for monitoring microservices provided in the present disclosure. In addition, the server 101 may also return the monitoring results obtained by monitoring the target microservice in the present disclosure to the client 103, so that the user may perform statistics, analysis, updates, and other processing based on the monitoring results.
[0035] In an exemplary embodiment, the process of server 101 for implementing the implementation method of monitoring microservices can be: server 101 determines the business type of the target microservice in response to a request to create a monitoring instance for the target microservice; server 101 obtains historical monitoring configuration data of historical microservices under the business type, and generates a monitoring configuration file for the target microservice based on the historical monitoring configuration data; server 101 monitors the target microservice using the monitoring configuration file, obtains target monitoring result data of the target microservice, and obtains historical monitoring result data of the historical microservice; server 101 updates the monitoring configuration file based on the historical monitoring result data and the target monitoring result data to monitor the target microservice using the updated monitoring configuration file.
[0036] In addition, it should be noted that Figure 1 What is shown is only one application environment of the implementation method of monitoring microservices provided by the present disclosure. Figure 1 The numbers of servers 101, networks 102 and clients 103 are merely illustrative, and any number of clients, networks and servers may be provided according to actual needs.
[0037] In order to enable ordinary persons in the art to better understand the technical solution of the present disclosure, the steps of the implementation method of the monitoring microservice in the exemplary embodiment of the present disclosure will be described in more detail below with reference to the accompanying drawings and embodiments.
[0038] Figure 2 A flowchart of a method for implementing a monitoring microservice in an embodiment of the present disclosure is shown. The method provided in the embodiment of the present disclosure can be implemented as follows: Figure 1 The server 101 or the client 103 shown is executed, but the present disclosure is not limited to this.
[0039] In the following examples, the server 101 is used as the execution subject for illustration.
[0040] like Figure 2 As shown, the implementation method of monitoring microservices provided by the embodiment of the present disclosure may include the following steps.
[0041] Step S201: In response to a request to create a monitoring instance for a target microservice, determine a business type of the target microservice.
[0042] In this step, when a user creates a new monitoring instance for a microservice, a creation request for a monitoring instance of a target microservice may be generated, and the microservice may be regarded as a target microservice. In some practical applications, the creation request may include business type information of the target microservice. In some other practical applications, business classification may also be performed based on the registration information of the target microservice to obtain the business type of the target microservice.
[0043] In some embodiments, "determining the business type of the target microservice" in step S201 may include: obtaining historical registration data and historical access data of registered microservices, and obtaining target registration data of the target microservice; calling the K-means clustering algorithm and obtaining the number of types of business types; using the number of types as a clustering parameter of the K-means clustering algorithm, processing the historical registration data, historical access data and target registration data through the K-means clustering algorithm, and then obtaining the business type of the registered microservice and the business type of the target microservice.
[0044] Among them, historical registration information may include information such as the business type, business scale, and business demand of registered microservices, and historical access data may include information such as data query information, access frequency, and API interface of registered microservices. In some practical applications, microservices can be classified according to the business areas they involve, for example, they can be divided into autonomous driving business types, social business types, financial business areas, shopping business areas, entertainment and game business areas, and short video business areas.
[0045] Step S203, obtaining historical monitoring configuration data of historical microservices under the business type, and generating a monitoring configuration file for the target microservice according to the historical monitoring configuration data.
[0046] Among them, the historical microservices under the business type can be regarded as registered microservices of the same type as the target microservice. The moment when the above creation request is generated can be regarded as the first moment, and then the historical monitoring configuration data of the registered microservices of the same type as the target microservice before the first moment is obtained, and then the sufficiently comprehensive historical monitoring configuration data can be used as the data basis to generate the initial monitoring configuration file for the target microservice.
[0047] In some embodiments, the historical monitoring configuration data of the historical microservice includes: the historical fault response time of the historical microservice, and the historical monitoring indicator parameters in each monitoring indicator of the historical microservice; based on this, "generating a monitoring configuration file of the target microservice according to the historical monitoring configuration data" in step S203 may include: determining a historical microservice whose historical fault response time is less than a response time threshold as a first candidate microservice; generating a monitoring configuration file of the target microservice according to the historical monitoring indicator parameters in each monitoring indicator of the first candidate microservice.
[0048] In this embodiment, the response threshold can be set according to actual needs, such as 500ms, 200ms, etc.; or determined according to all historical fault response times, such as the average of the first 40% of all historical fault response times, etc., which is not limited in this disclosure.
[0049] Historical microservices whose historical fault response time is less than the response time threshold can be considered as historical microservices with sufficiently fast fault response speed and sufficiently short fault response time. Therefore, the monitoring indicators used by this type of microservice (i.e., the first candidate microservice) can be used as a reference to generate a monitoring profile with the characteristic of fast fault response speed for the target microservice.
[0050] Among them, the monitoring indicators can be the items to be monitored, such as the number of requests, monitoring request time, request response speed, fault information, error rate, fault response time, QoS requirements, etc. The indicator parameters in the monitoring indicators can be variables in the corresponding items. For example, the monitoring indicator can be "counting the number of requests", and the indicator parameters can be the type of request, such as "query request" and "access to a specified page request". Then the monitoring indicators with this indicator parameter include: "counting the number of query requests" and "counting the number of requests to access a specified page". For another example, the monitoring indicator can be "counting fault information", and the indicator parameters can be, for example, the fault type, such as "cannot find data", "incorrect access rights", etc. Then the monitoring indicators with this indicator parameter include: "statistical information of the fault of not finding data", "statistical information of the fault of incorrect access rights", etc.
[0051] Alternatively, the indicator parameter can also be a preset frequency. For example, for the monitoring indicator of "counting the number of requests", the indicator parameter can be "counting once every 24 hours" or "counting once every 48 hours". Then the monitoring indicator with this indicator parameter can be: "counting the number of requests once every 24 hours" or "counting the number of requests once every 48 hours".
[0052] In some practical applications, for each monitoring indicator, the average value of the historical monitoring indicator parameters of all first candidate microservices can be taken as the indicator parameter in the monitoring indicator of the target microservice, or the parameter that appears more frequently in the historical monitoring indicator parameters of all first candidate microservices can be taken as the indicator parameter in the monitoring indicator of the target microservice.
[0053] In some embodiments, generating a monitoring configuration file for a target microservice based on historical monitoring indicator parameters in each monitoring indicator of a first candidate microservice includes: determining a parameter mode corresponding to each monitoring indicator based on historical monitoring indicator parameters in each monitoring indicator of all first candidate microservices; determining initial monitoring indicator parameters in each monitoring indicator of the target microservice based on the parameter mode corresponding to each monitoring indicator; and generating a monitoring configuration file for the target microservice based on the initial monitoring indicator parameters.
[0054] For example, if there are 10 historical microservices with the same business type as the target microservice (that is, there are 10 first candidate microservices), and the indicator parameter of the monitoring indicator "number of requests" of 8 of these 10 first candidate microservices is "count the number of requests once every 24 hours", then it can be considered that the parameter mode of the monitoring indicator "number of requests" is "count the number of requests once every 24 hours".
[0055] In this embodiment, the parameter mode corresponding to each monitoring indicator of all first candidate microservices can be regarded as a configuration option that can achieve the effect of fast fault response speed. Therefore, generating a monitoring configuration file for the target microservice according to the parameter mode corresponding to each monitoring indicator is more likely to make the monitoring of the target microservice have the effect of fast fault response speed.
[0056] Step S205: monitor the target microservice using the monitoring configuration file, obtain target monitoring result data of the target microservice, and obtain historical monitoring result data of the historical microservice.
[0057] The monitoring configuration file can be used to monitor the target microservice for a period of time, for example, from a first moment to a second moment (the second moment is after the first moment). Then, the target monitoring result data between the first moment and the second moment can be obtained. Correspondingly, the historical monitoring result data of the historical microservice before the second moment can be obtained, and then sufficiently comprehensive historical monitoring configuration data can be used as the data basis to adjust and update the monitoring configuration file for the target microservice.
[0058] Step S207: Update the monitoring configuration file according to the historical monitoring result data and the target monitoring result data, so as to monitor the target microservice using the updated monitoring configuration file.
[0059] After monitoring the target microservice for a period of time, the monitoring profile of the target microservice can be optimized again by using the relevant information of historical microservices of the same business type. Specifically, multi-faceted analysis and mining can be performed based on historical monitoring result data and target monitoring result data, so as to automatically determine the monitoring indicators that need to be adjusted, and then automatically and targetedly adjust and update the monitoring indicators in the monitoring profile, so as to further optimize and improve the monitoring profile of the target microservice and better realize the monitoring of the target microservice.
[0060] Through the implementation method of monitoring microservices provided by the present disclosure, the business type of the target microservice can be determined first, and then an initial monitoring configuration file can be automatically generated for the target microservice using the historical monitoring configuration data used by the historical microservices of the same business type; then after monitoring the target microservice for a period of time using the monitoring configuration file, the historical monitoring result data of the historical microservices of the same business type can be obtained, and combined with the target monitoring result data of the target microservice, the monitoring indicators in the monitoring configuration file can be automatically and targetedly adjusted and updated, and then the target microservice can be monitored using the updated monitoring configuration file. It can be seen that, on the one hand, this scheme can automatically generate and recommend an initial monitoring configuration file for the target microservice based on the historical monitoring configuration data used by the historical microservices of the same business type as the target microservice. Since the initial monitoring configuration file is generated based on the historical microservices of the same business type, the monitoring indicators therein are reasonably configured and have a good monitoring effect. On the other hand, after monitoring the target microservice for a period of time using the monitoring configuration file, the monitoring indicators that need to be adjusted, the operating rules, etc. can be automatically determined based on the historical monitoring result data of the historical microservices with the same business type as the target microservice and the target monitoring result data of the target microservice, and then the monitoring configuration file of the target microservice is automatically optimized and adjusted based on the monitoring indicators or operating rules that need to be adjusted. The method provided by the present disclosure can reduce manual intervention, realize automatic generation and automatic adjustment of the monitoring configuration file, thereby saving adjustment resources and improving the overall monitoring efficiency.
[0061] In some embodiments, the historical monitoring result data of the historical microservice includes: the historical indicator value of the historical microservice under each monitoring indicator; the target monitoring result data of the target microservice includes: the target indicator value of the target microservice under each monitoring indicator.
[0062] Among them, the indicator value (including the historical indicator value and the target indicator value) can be regarded as the monitoring result corresponding to each monitoring indicator. For example, the indicator value of the monitoring indicator "fault response time" can be data such as "10S", "10ms", etc.
[0063] Based on this, Figure 3 A flowchart of updating a monitoring configuration file in a method for implementing a monitoring microservice in an embodiment of the present disclosure is shown. Figure 3 As shown, in step S207, "updating the monitoring configuration file according to the historical monitoring result data and the target monitoring result data" may further include the following steps.
[0064] Step S301, determining the historical operation characteristics of the historical microservice according to the historical indicator values of the historical microservice under each monitoring indicator; and determining the target operation characteristics of the target microservice according to the target indicator values of the target microservice under each monitoring indicator.
[0065] In this step, the number of requests, request time, request response speed, fault information, error rate, fault response time, and QoS requirements of the historical microservice between the first moment and the second moment can be obtained, and each indicator value of the historical microservice can be normalized to obtain the historical operation characteristics of the historical microservice. Similarly, the number of requests, request time, request response speed, fault information, error rate, fault response time, and QoS requirements of the target microservice between the first moment and the second moment can be obtained, and each indicator value of the target microservice can be normalized to obtain the target operation characteristics of the target microservice.
[0066] Step S303: Determine the similarity between each historical microservice and the target microservice according to the historical operation characteristics of each historical microservice and the target operation characteristics.
[0067] In this step, the cosine similarity algorithm can be used to calculate the similarity between each historical operation feature and the target operation feature as the similarity between each historical microservice and the target microservice. The higher the similarity, the more similar the operation features of the historical microservice and the target microservice are, and the more valuable information can be mined from the historical operation data of the historical microservice for updating the monitoring configuration file of the target microservice.
[0068] Step S305: determine the historical microservices whose similarity exceeds the similarity threshold as the second candidate microservices.
[0069] The similarity threshold can be set according to actual needs, such as 80%, 60%, etc., which is not limited in this disclosure. By selecting the second candidate microservice based on the similarity threshold, a historical microservice that is more similar to the target microservice can be determined, so that information more suitable for updating the monitoring configuration file can be obtained.
[0070] Step S307: Update the monitoring configuration file according to the historical indicator value of the second candidate microservice under each monitoring indicator and the target indicator value of the target microservice under each monitoring indicator.
[0071] Among them, the operating characteristic dimensions of the second candidate microservice and the target microservice are similar, the historical indicator value of the second candidate microservice can reflect the historical operating law of the second candidate microservice, and the target indicator value can reflect the target operating law of the target microservice. Therefore, it can be considered that the historical operating law and the target operating law are similar. Therefore, based on the similar historical operating laws and target operating laws, common operating laws can be explored to provide adjustment strategies.
[0072] In some embodiments, step S307 may include: performing a correlation analysis of specified factors on the historical indicator values of the second candidate microservice under each monitoring indicator, and then determining the historical key indicators from the monitoring indicators; performing a correlation analysis of specified factors on the target indicator values of the target microservice under each monitoring indicator, and then determining the target key indicators from the monitoring indicators; determining the key monitoring indicators and the indicator parameters therein based on the historical key indicators and the target key indicators; updating the monitoring configuration file based on the key monitoring indicators and the indicator parameters therein; wherein the specified factors may include failure factors and response time factors.
[0073] In some embodiments, step S307 may include: periodically analyzing the historical indicator values of the second candidate microservice under each monitoring indicator to obtain the operation change trend data of the second candidate microservice; periodically analyzing the target indicator values of the target microservice under each monitoring indicator to obtain the operation change trend data of the target microservice; determining the adjustment value of the collection frequency according to the operation change trend data of the second candidate microservice and the operation change trend data of the target microservice; updating the monitoring configuration file according to the adjustment value of the collection frequency; wherein the change trend data includes access volume change trend data, error rate change trend data and load change trend data.
[0074] Specifically, by periodically analyzing the historical indicator values of the second candidate microservice under each monitoring indicator, historical access volume change trend data, historical error rate change trend data, and historical load change trend data can be obtained. By periodically analyzing the target indicator values of the target microservice under each monitoring indicator, target access volume change trend data, target error rate change trend data, and target load change trend data can be obtained. Then, based on the historical access volume change trend data, error rate change trend data, load change trend data, target access volume change trend data, target rate change trend data, and target change trend data, the adjustment value of the acquisition frequency can be determined, and then the corresponding configuration data in the monitoring configuration file can be updated. Among them, the acquisition frequency can also be regarded as a monitoring indicator.
[0075] In some embodiments, step S307 may include: performing service quality analysis on the historical indicator values of the second candidate microservice under each monitoring indicator and the target indicator values of the target microservice under each monitoring indicator to obtain a service quality level range and a target service quality of the target microservice; determining a monitoring importance level of the target microservice according to the service quality level range and the target service quality; and updating a monitoring configuration file according to the monitoring importance level.
[0076] In this embodiment, the target range to which the target service quality belongs can be determined from all service quality level ranges, and then the service quality level corresponding to the target range is determined as the monitoring importance level of the target microservice. The service quality level range can be divided by the service quality mean, wherein the service quality mean can also be obtained by service quality analysis, and the range greater than or equal to the service quality mean is regarded as a high-level range, and the range less than the service quality mean is regarded as a low-level range.
[0077] Figure 4 A schematic diagram of a method for implementing a monitoring microservice in an embodiment of the present disclosure is shown. Figure 4 As shown, the method in this embodiment can be implemented by the following modules: a configuration template recommendation module 401 , a rule mining module 402 , and a strategy adjustment module 403 .
[0078] The functions of the configuration template recommendation module 401 may include service classification and configuration template recommendation.
[0079] Regarding business classification, the configuration template recommendation module 401 can classify the target microservice and the registered historical microservices based on user registration information (including business type, business scale, business demand) and user access data (data query, access frequency, API interface). The business classification method uses the K-means clustering method, where the K value is the number of business types.
[0080] Regarding configuration template recommendation, the configuration template recommendation module 401 can first obtain historical data of historical microservices of the same business category from historical data, then count the configuration data of historical microservices with fast fault response speed, and then take the mode of the configurations of these microservices as the recommended initial configuration template, thereby providing a configuration template (monitoring configuration file) with high fault responsiveness.
[0081] In this embodiment, a big data storage module 404 may also be provided, and the big data storage module may be used to store microservice data of different business types, so the configuration template recommendation module 401 may obtain historical data from the big data storage module.
[0082] In this embodiment, a data collection module 405 may also be provided, which may be used to collect operating data of the target microservice within a period of time using the configuration template recommended by the configuration template recommendation module 401, and store the data in the database in the big data storage module.
[0083] The rule mining module 402 relies on historical microservice data similar to the target microservice, and its functions may include similarity matching and rule mining.
[0084] Regarding similarity matching, the rule mining module 402 can obtain characteristic indicators of historical microservices of the same business category, which can include, for example, the number of requests, request time, request response speed, fault information, error rate, fault response time, and QoS requirements within a time period. The above data is normalized and converted into a feature vector, and then the cosine similarity algorithm is used to find the similarity between the microservice in the historical data and the microservice.
[0085] Regarding rule mining, the rule mining module 402 can obtain a group of historical microservice data with high similarity that is matched, and use data analysis methods to mine the potential operating rules of this group of historical microservices. At the same time, the operating rules of the target microservice itself are mined. Among them, when the running time of this microservice is less than the preset duration (for example, half a year), the historical microservice rules similar to the business are given priority, and those exceeding the preset duration (for example, half a year) are equally important. Here, the priority of historical microservices can be reflected by setting different weights for historical microservices and target microservices (the weight of historical microservices is higher), and their equal importance can be reflected by setting the same weight for historical microservices and target microservices.
[0086] Specifically, using data analysis methods to mine the potential rules of this set of historical microservices and the operating rules of the microservices themselves can include: 1) using multiple regression to perform correlation analysis, mining key indicators associated with faults, and mining key indicators associated with response time. 2) using periodic analysis to mine the periodic change trends of access volume, error rate, and load. 3) using mean analysis to determine whether QoS (quality of service) is higher than the requirements of most microservices. If the QoS is higher, it can be considered a critical service.
[0087] The strategy adjustment module 403 can mainly determine the adjustment strategy according to the operation rules mined by the rule mining module 402. The adjustment strategy may include the collection frequency (monitoring index), collection index and alarm level to be adjusted.
[0088] Specifically, 1) Adjust the collection indicators: obtain the key indicators obtained from the correlation analysis from the rule mining module, increase the key indicators related to the error rate and response time, and appropriately reduce irrelevant monitoring indicators. 2) Adjust the collection frequency: periodically adjust the collection frequency according to the periodic laws of the number of visits, load and error time. For example, the load of autonomous driving is high during the day, so the collection frequency can be appropriately increased; the number of visits to e-commerce surges during the annual shopping festival, so the monitoring indicators and collection frequency can be appropriately increased. 3) Adjust the alarm level: Determine the importance of the service according to the level of QoS requirements, and grade the alarm. When a QoS requirement is higher than the general service requirement, it is usually an important service. For example, the QoS response time of the order service is much higher than the requirements of ordinary services such as collecting goods, it can be judged as an important service. When it is detected, a higher level of alarm can be used for alarm.
[0089] In this embodiment, an automatic configuration module 406 may be provided, which may be used to obtain the adjustment policy determined by the policy adjustment module 403, and then automatically configure the monitoring configuration file based on the adjustment policy to achieve automatic update of the monitoring configuration file.
[0090] Through the implementation method of monitoring microservices provided by this embodiment, firstly, since each type of business has significantly different business characteristics, different requirements, different operating rules, and different indicators of concern, different monitoring strategies can be configured according to business classification. In this embodiment, business classification is based on user registration information and access information, and monitoring configuration templates are recommended based on the historical data of other services in this business classification and subsequent monitoring strategies are adjusted, which can make the configuration template more reasonable and improve monitoring efficiency. Secondly, since there is no historical data or insufficient operating data when the microservice is deployed, this embodiment is set up with the steps of mining service operating rules by using the operating data of other microservices with high similarity in the same business classification, and automatically adjusts the monitoring strategy based on this rule, and the automation plug-in automatically maintains the monitoring file, thereby achieving the effect of reducing manual intervention, automatically adjusting the collection frequency and monitoring indicators, and improving monitoring efficiency.
[0091] It should be noted that the above figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0092] Figure 5 FIG. 5 is a block diagram of an implementation device 500 for monitoring microservices according to an embodiment of the present disclosure; Figure 5As shown, it includes: a business type determination module 501, which is used to determine the business type of the target microservice in response to a creation request for a monitoring instance of the target microservice; a configuration file generation module 502, which is used to obtain historical monitoring configuration data of historical microservices under the business type, and generate a monitoring configuration file for the target microservice according to the historical monitoring configuration data; a monitoring module 503, which is used to monitor the target microservice using the monitoring configuration file, obtain the target monitoring result data of the target microservice, and obtain the historical monitoring result data of the historical microservice; a configuration file update module 504, which is used to update the monitoring configuration file according to the historical monitoring result data and the target monitoring result data, so as to use the updated monitoring configuration file to monitor the target microservice.
[0093] Through the implementation device of the monitoring microservice provided by the present disclosure, on the one hand, an initial monitoring configuration file can be automatically generated and recommended for the target microservice based on the historical monitoring configuration data used by the historical microservices of the same business type as the target microservice. Since the initial monitoring configuration file is generated based on the historical microservices of the same business type, the monitoring indicators therein are reasonably configured and have a good monitoring effect. On the other hand, after the target microservice is monitored for a period of time using the monitoring configuration file, the monitoring indicators that need to be adjusted can be automatically determined, the operating rules can be excavated, etc., based on the historical monitoring result data of the historical microservices of the same business type as the target microservice, and the target monitoring result data of the target microservice, and then the monitoring configuration file of the target microservice can be automatically optimized and adjusted based on the monitoring indicators or operating rules that need to be adjusted. The method provided by the present disclosure can reduce manual intervention, realize the automatic generation and automatic adjustment of the monitoring configuration file, thereby saving adjustment resources and improving the overall monitoring efficiency.
[0094] In some embodiments, the business type determination module 501 determines the business type of the target microservice, including: obtaining historical registration data and historical access data of the registered microservice, and obtaining target registration data of the target microservice; calling the K-means clustering algorithm and obtaining the number of types of business types; using the number of types as a clustering parameter of the K-means clustering algorithm, processing the historical registration data, historical access data and target registration data through the K-means clustering algorithm, and then obtaining the business type of the registered microservice and the business type of the target microservice.
[0095] In some embodiments, the historical monitoring configuration data of the historical microservice includes: the historical fault response time of the historical microservice, and the historical monitoring indicator parameters in each monitoring indicator of the historical microservice; wherein the configuration file generation module 502 generates a monitoring configuration file for the target microservice according to the historical monitoring configuration data, including: determining a historical microservice whose historical fault response time is less than a response time threshold as a first candidate microservice; and generating a monitoring configuration file for the target microservice according to the historical monitoring indicator parameters in each monitoring indicator of the first candidate microservice.
[0096] In some embodiments, the configuration file generation module 502 generates a monitoring configuration file for the target microservice based on the historical monitoring indicator parameters in each monitoring indicator of the first candidate microservice, including: determining the parameter mode corresponding to each monitoring indicator based on the historical monitoring indicator parameters in each monitoring indicator of all first candidate microservices; determining the initial monitoring indicator parameters in each monitoring indicator of the target microservice based on the parameter mode corresponding to each monitoring indicator; and generating a monitoring configuration file for the target microservice based on the initial monitoring indicator parameters.
[0097] In some embodiments, the historical monitoring result data of the historical microservice includes: the historical indicator value of the historical microservice under each monitoring indicator; the target monitoring result data of the target microservice includes: the target indicator value of the target microservice under each monitoring indicator; wherein, the configuration file update module 504 updates the monitoring configuration file according to the historical monitoring result data and the target monitoring result data, including: determining the historical operation characteristics of the historical microservice according to the historical indicator value of the historical microservice under each monitoring indicator; and determining the target operation characteristics of the target microservice according to the target indicator value of the target microservice under each monitoring indicator; determining the similarity between each historical microservice and the target microservice according to the historical operation characteristics and the target operation characteristics of each historical microservice; determining the historical microservice whose similarity exceeds the similarity threshold as the second candidate microservice; and updating the monitoring configuration file according to the historical indicator value of the second candidate microservice under each monitoring indicator and the target indicator value of the target microservice under each monitoring indicator.
[0098] In some embodiments, the configuration file update module 504 updates the monitoring configuration file according to the historical indicator values of the second candidate microservice under each monitoring indicator and the target indicator values of the target microservice under each monitoring indicator, including: performing a correlation analysis of specified factors on the historical indicator values of the second candidate microservice under each monitoring indicator, and then determining the historical key indicators from the monitoring indicators; performing a correlation analysis of specified factors on the target indicator values of the target microservice under each monitoring indicator, and then determining the target key indicators from the monitoring indicators; determining the key monitoring indicators and the indicator parameters therein according to the historical key indicators and the target key indicators; updating the monitoring configuration file according to the key monitoring indicators and the indicator parameters therein; wherein the specified factors include failure factors and response time factors.
[0099] In some embodiments, the configuration file update module 504 updates the monitoring configuration file according to the historical indicator value of the second candidate microservice under each monitoring indicator and the target indicator value of the target microservice under each monitoring indicator, including: periodically analyzing the historical indicator value of the second candidate microservice under each monitoring indicator to obtain the operation change trend data of the second candidate microservice; periodically analyzing the target indicator value of the target microservice under each monitoring indicator to obtain the operation change trend data of the target microservice; determining the adjustment value of the collection frequency according to the operation change trend data of the second candidate microservice and the operation change trend data of the target microservice; updating the monitoring configuration file according to the adjustment value of the collection frequency; wherein the change trend data includes access change trend data, error rate change trend data and load change trend data.
[0100] In some embodiments, the configuration file update module 504 updates the monitoring configuration file according to the historical indicator values of the second candidate microservice under each monitoring indicator and the target indicator values of the target microservice under each monitoring indicator, including: performing service quality analysis on the historical indicator values of the second candidate microservice under each monitoring indicator and the target indicator values of the target microservice under each monitoring indicator to obtain a service quality level range and a target service quality of the target microservice; determining a monitoring importance level of the target microservice according to the service quality level range and the target service quality; and updating the monitoring configuration file according to the monitoring importance level.
[0101] Figure 5 The other contents of the embodiment can refer to the other embodiments mentioned above and will not be described in detail here.
[0102] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0103] Figure 6 The block diagram of a computer device for implementing a monitoring microservice in an embodiment of the present disclosure is shown. It should be noted that the electronic device shown in the figure is only an example and should not bring any limitation to the functions and scope of use of the embodiment of the present invention.
[0104] Refer to the following Figure 6 The electronic device 600 according to this embodiment of the present invention is described. Figure 6 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0105] like Figure 6 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include but are not limited to: at least one processing unit 610, at least one storage unit 620, and a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610).
[0106] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 610 can perform the following steps: Figure 2 The method shown in .
[0107] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 6201 and / or a cache storage unit 6202 , and may further include a read-only storage unit (ROM) 6203 .
[0108] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0109] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0110] The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 660. As shown, the network adapter 660 communicates with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0111] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.
[0112] The program product for implementing the above method according to the embodiment of the present invention may adopt a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.
[0113] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0114] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0115] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0116] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0117] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0118] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0119] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0120] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A method for implementing monitoring microservices, characterized in that: include: In response to a request to create a monitoring instance for a target microservice, determine a business type of the target microservice; Acquire historical monitoring configuration data of historical microservices under the business type, and generate a monitoring configuration file for the target microservice according to the historical monitoring configuration data; Using the monitoring configuration file to monitor the target microservice, obtain target monitoring result data of the target microservice, and obtain historical monitoring result data of the historical microservice; The monitoring configuration file is updated according to the historical monitoring result data and the target monitoring result data, so as to monitor the target microservice using the updated monitoring configuration file; Wherein, determining the business type of the target microservice includes: Obtain historical registration data and historical access data of a registered microservice, and obtain target registration data of the target microservice; call a K-means clustering algorithm and obtain the number of types of business types; use the number of types as a clustering parameter of the K-means clustering algorithm, process the historical registration data, the historical access data and the target registration data through the K-means clustering algorithm, and then obtain the business type of the registered microservice and the business type of the target microservice; The historical monitoring configuration data of the historical microservice includes: the historical fault response time of the historical microservice, and the historical monitoring indicator parameters of each monitoring indicator of the historical microservice; wherein the monitoring configuration file of the target microservice is generated according to the historical monitoring configuration data, including: Determine the historical microservice whose historical fault response time is less than the response time threshold as the first candidate microservice; generate the monitoring configuration file of the target microservice according to the historical monitoring indicator parameters in each monitoring indicator of the first candidate microservice; The historical monitoring result data of the historical microservice includes: the historical indicator value of the historical microservice under each monitoring indicator; the target monitoring result data of the target microservice includes: the target indicator value of the target microservice under each monitoring indicator; wherein, updating the monitoring configuration file according to the historical monitoring result data and the target monitoring result data includes: Determine the historical operation characteristics of the historical microservice according to the historical indicator values of the historical microservice under each monitoring indicator; and determine the target operation characteristics of the target microservice according to the target indicator values of the target microservice under each monitoring indicator; determine the similarity between each historical microservice and the target microservice according to the historical operation characteristics of each historical microservice and the target operation characteristics; determine the historical microservice whose similarity exceeds a similarity threshold as a second candidate microservice; and update the monitoring configuration file according to the historical indicator values of the second candidate microservice under each monitoring indicator and the target indicator values of the target microservice under each monitoring indicator.
2. The method according to claim 1, characterized in that Generating a monitoring configuration file for the target microservice according to historical monitoring indicator parameters in each monitoring indicator of the first candidate microservice includes: Determine the parameter mode corresponding to each monitoring indicator according to the historical monitoring indicator parameters of each monitoring indicator of all first candidate microservices; Determine the initial monitoring indicator parameters of each monitoring indicator of the target microservice according to the parameter mode corresponding to each monitoring indicator; Generate a monitoring configuration file for the target microservice according to the initial monitoring indicator parameters.
3. The method according to claim 1, characterized in that According to the historical indicator value of the second candidate microservice under each monitoring indicator and the target indicator value of the target microservice under each monitoring indicator, the monitoring configuration file is updated, including: Performing correlation analysis of specified factors on the historical indicator values of the second candidate microservice under each monitoring indicator, and then determining historical key indicators from the monitoring indicators; Performing a correlation analysis of the specified factors on the target indicator values of the target microservice under each monitoring indicator, and then determining the target key indicator from the monitoring indicators; Determine key monitoring indicators and indicator parameters therein according to the historical key indicators and the target key indicators; Updating the monitoring configuration file according to the key monitoring indicators and the indicator parameters therein; The specified factors include failure factors and response time factors.
4. The method according to claim 1, characterized in that According to the historical indicator value of the second candidate microservice under each monitoring indicator and the target indicator value of the target microservice under each monitoring indicator, the monitoring configuration file is updated, including: Periodically analyzing the historical indicator values of the second candidate microservice under each monitoring indicator to obtain operation change trend data of the second candidate microservice; Periodically analyze the target indicator values of the target microservice under each monitoring indicator to obtain operation change trend data of the target microservice; Determine an adjustment value of the collection frequency according to the operation change trend data of the second candidate microservice and the operation change trend data of the target microservice; Updating the monitoring configuration file according to the adjustment value of the acquisition frequency; The change trend data include access volume change trend data, error rate change trend data and load change trend data.
5. The method according to claim 1, characterized in that According to the historical indicator value of the second candidate microservice under each monitoring indicator and the target indicator value of the target microservice under each monitoring indicator, the monitoring configuration file is updated, including: Performing a service quality analysis on the historical indicator values of the second candidate microservice under each monitoring indicator and the target indicator values of the target microservice under each monitoring indicator to obtain a service quality level range and a target service quality of the target microservice; Determine the monitoring importance level of the target microservice according to the service quality level range and the target service quality; The monitoring configuration file is updated according to the monitoring importance level.
6. A device for monitoring microservices, characterized in that: include: A business type determination module, configured to determine the business type of a target microservice in response to a request to create a monitoring instance for the target microservice; A configuration file generation module, used to obtain historical monitoring configuration data of historical microservices under the business type, and generate a monitoring configuration file for the target microservice according to the historical monitoring configuration data; A monitoring module, used to monitor the target microservice using the monitoring configuration file, obtain target monitoring result data of the target microservice, and obtain historical monitoring result data of the historical microservice; A configuration file updating module, used to update the monitoring configuration file according to the historical monitoring result data and the target monitoring result data, so as to monitor the target microservice using the updated monitoring configuration file; The business type determination module determines the business type of the target microservice, including: Obtain historical registration data and historical access data of a registered microservice, and obtain target registration data of the target microservice; call a K-means clustering algorithm and obtain the number of types of business types; use the number of types as a clustering parameter of the K-means clustering algorithm, process the historical registration data, the historical access data and the target registration data through the K-means clustering algorithm, and then obtain the business type of the registered microservice and the business type of the target microservice; The historical monitoring configuration data of the historical microservice includes: the historical fault response time of the historical microservice, and the historical monitoring indicator parameters of each monitoring indicator of the historical microservice; wherein the configuration file generation module generates the monitoring configuration file of the target microservice according to the historical monitoring configuration data, including: Determine the historical microservice whose historical fault response time is less than the response time threshold as the first candidate microservice; generate the monitoring configuration file of the target microservice according to the historical monitoring indicator parameters in each monitoring indicator of the first candidate microservice; The historical monitoring result data of the historical microservice includes: the historical indicator value of the historical microservice under each monitoring indicator; the target monitoring result data of the target microservice includes: the target indicator value of the target microservice under each monitoring indicator; wherein the configuration file update module updates the monitoring configuration file according to the historical monitoring result data and the target monitoring result data, including: Determine the historical operation characteristics of the historical microservice according to the historical indicator values of the historical microservice under each monitoring indicator; and determine the target operation characteristics of the target microservice according to the target indicator values of the target microservice under each monitoring indicator; determine the similarity between each historical microservice and the target microservice according to the historical operation characteristics of each historical microservice and the target operation characteristics; determine the historical microservice whose similarity exceeds a similarity threshold as a second candidate microservice; and update the monitoring configuration file according to the historical indicator values of the second candidate microservice under each monitoring indicator and the target indicator values of the target microservice under each monitoring indicator.
7. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method for implementing the monitoring microservice according to any one of claims 1 to 5 is implemented.
8. An electronic device, characterized in that: include: one or more processors; A storage device, used to store one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the implementation method of the monitoring microservice according to any one of claims 1 to 5.
