Application system monitoring method, apparatus and device

By establishing a monitoring indicator model for the application system and using the Go language to collect monitoring data, the problem of the Prometheus monitoring system being unable to meet the monitoring needs of multiple scenarios was solved, realizing comprehensive and accurate monitoring of the application system in multiple scenarios, and improving monitoring efficiency and accuracy.

CN116431442BActive Publication Date: 2026-02-10PEOPLE'S INSURANCE COMPANY OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310423754.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-19
Publication Date
2026-02-10
Estimated Expiration
2043-04-19

Smart Images

  • Figure CN116431442B_ABST
    Figure CN116431442B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an application system monitoring method, device and equipment, the method comprising: establishing a monitoring index model of an application system; the monitoring index model is used for monitoring indexes in multiple scenarios corresponding to the application system; according to the monitoring index model, monitoring data in multiple scenarios corresponding to the application system is collected; based on the monitoring data in multiple scenarios corresponding to the application system, index monitoring results in multiple scenarios corresponding to the application system are obtained. The method of the embodiments of the present application realizes comprehensive, accurate and effective monitoring of the application system in multiple scenarios, overcomes the problem that the deployment of the Prometheus monitoring system component in the prior art consumes more resources and increases maintenance costs, and the monitoring efficiency is low, and improves the monitoring efficiency and accuracy of the application system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of security technology, and in particular to an application system monitoring method, apparatus, and equipment. Background Technology

[0002] Application system monitoring can effectively improve application system security, and based on the monitoring results, it can formulate application optimization measures to maintain good application system performance, which is of great significance and importance.

[0003] In related technologies, the Prometheus monitoring system is used to monitor application systems. However, in actual application system operation and maintenance, it is necessary to monitor the system's operation based on multiple indicators across various scenarios, but the Prometheus monitoring system cannot meet these monitoring requirements. Therefore, how to achieve accurate and efficient monitoring of application systems across multiple scenarios is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0004] To address the problems in the prior art, embodiments of the present invention provide an application system monitoring method, apparatus, and device.

[0005] Specifically, the embodiments of the present invention provide the following technical solutions:

[0006] In a first aspect, embodiments of the present invention provide an application system monitoring method, comprising:

[0007] Establish a monitoring indicator model for the application system; the monitoring indicator model is used to monitor indicators for multiple scenarios corresponding to the application system.

[0008] Based on the monitoring indicator model, collect monitoring data from multiple scenarios corresponding to the application system;

[0009] Based on monitoring data from multiple scenarios corresponding to the application system, obtain the monitoring results of indicators for multiple scenarios corresponding to the application system.

[0010] Furthermore, establish a monitoring indicator model for the application system, including:

[0011] Establish a first-scenario monitoring sub-model, a second-scenario monitoring sub-model, and a third-scenario monitoring sub-model for the application system. The first-scenario monitoring sub-model is used to monitor the performance metrics of the operating system on which the application system resides. The second-scenario monitoring sub-model is used to monitor the process-related performance metrics of the application system. The third-scenario monitoring sub-model is used to monitor the interface-related performance metrics of the application system.

[0012] Based on the first scenario monitoring sub-model, the second scenario monitoring sub-model, and the third scenario monitoring sub-model, a monitoring indicator model for the application system is generated.

[0013] Furthermore, based on the monitoring indicator model, monitoring data is collected from multiple scenarios corresponding to the application system, including:

[0014] Based on the monitoring metric model, create a target configuration file; the target configuration file is used to provide the configuration information required when monitoring multiple scenarios corresponding to the application system.

[0015] Based on the target configuration file, collect monitoring data from multiple scenarios corresponding to the application system.

[0016] Furthermore, based on the target configuration file, monitoring data is collected for multiple scenarios corresponding to the application system, including:

[0017] Load the target configuration file;

[0018] Based on the configuration information in the target configuration file, system commands are invoked to collect monitoring data for multiple scenarios corresponding to the application system.

[0019] Furthermore, system commands are invoked to collect monitoring data from multiple scenarios corresponding to the application system, including:

[0020] Use the Go programming language to call system commands to collect monitoring data for multiple scenarios corresponding to the application system.

[0021] Furthermore, after establishing the monitoring indicator model for the application system, it also includes:

[0022] Use the Go programming language to determine the metric collection route; the metric collection route is used to indicate the access path for monitoring metrics.

[0023] Based on the monitoring indicator model, monitoring data is collected from multiple scenarios corresponding to the application system, including:

[0024] Based on the indicator collection route, the monitoring data of multiple scenarios corresponding to the application system are encapsulated to obtain the encapsulated monitoring data of multiple scenarios.

[0025] The Prometheus SDK is used to convert the encapsulated monitoring data from multiple scenarios into a standardized format that the Prometheus server can recognize, and then the data is collected by the server.

[0026] Furthermore, before collecting monitoring data from multiple scenarios corresponding to the application system based on the monitoring indicator model, the following steps are also included:

[0027] Obtain application system metric monitoring query requests; the query requests are used to request the collection of metrics of the application system under multiple scenarios based on the Prometheus server, and to display, monitor and alert on the metrics.

[0028] Secondly, embodiments of the present invention also provide an application system monitoring device, comprising:

[0029] The module is used to build a monitoring indicator model for the application system; the monitoring indicator model is used to monitor indicators for multiple scenarios corresponding to the application system.

[0030] The data acquisition module is used to collect monitoring data from multiple scenarios corresponding to the application system based on the monitoring indicator model.

[0031] The monitoring module is used to obtain the monitoring results of indicators for multiple scenarios corresponding to the application system based on the monitoring data of multiple scenarios corresponding to the application system.

[0032] Thirdly, embodiments of the present invention also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the application system monitoring method as described in the first aspect.

[0033] Fourthly, embodiments of the present invention also provide a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the application system monitoring method as described in the first aspect.

[0034] Fifthly, embodiments of the present invention also provide a computer program product, including a computer program that, when executed by a processor, implements the application system monitoring method as described in the first aspect.

[0035] The application system monitoring method, apparatus, and device provided in this invention establish a monitoring indicator model for the application system. This model includes indicators for multiple scenarios corresponding to the application system that require monitoring. Based on this model, comprehensive and accurate monitoring of multiple scenarios affecting the application system can be achieved. Furthermore, by displaying the monitoring data from these multiple scenarios within the Prometheus monitoring system, monitoring results can be obtained. This overcomes the limitation of existing technologies where components in the Prometheus monitoring system can only monitor limited scenarios and cannot meet the monitoring needs of multiple application systems. It achieves comprehensive, accurate, and effective monitoring of the application system across multiple scenarios. On the other hand, it also overcomes the problems of existing technologies where deploying Prometheus monitoring system components requires more resources, increases maintenance costs, and has lower monitoring efficiency, thus improving the monitoring efficiency and accuracy of the application system. Attached Figure Description

[0036] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0037] Figure 1 This is a flowchart illustrating the application system monitoring method provided in an embodiment of the present invention;

[0038] Figure 2 This is a schematic diagram of the monitoring indicator model of the application system provided in the embodiments of the present invention;

[0039] Figure 3 This is another flowchart illustrating the application system monitoring method provided in this embodiment of the invention;

[0040] Figure 4 This is a schematic diagram of the structure of the application system monitoring device provided in an embodiment of the present invention;

[0041] Figure 5 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0043] The method of this invention can be applied to application system monitoring scenarios, realizing comprehensive, accurate and effective monitoring of application systems in multiple scenarios. It overcomes the problems of the Prometheus monitoring system components in the prior art requiring more resources and increasing maintenance costs, and having low monitoring efficiency, thereby improving the monitoring efficiency and accuracy of application systems.

[0044] In related technologies, the Prometheus monitoring system is used to monitor application systems. However, in actual application system operation and maintenance, it is necessary to monitor the system's operation based on multiple indicators across various scenarios, but the Prometheus monitoring system cannot meet these monitoring requirements. Therefore, how to achieve accurate and efficient monitoring of application systems across multiple scenarios is a technical problem that urgently needs to be solved by those skilled in the art.

[0045] The application system monitoring method of this invention establishes a monitoring indicator model for the application system. This model includes indicators for multiple scenarios corresponding to the application system that require monitoring. Based on this model, comprehensive and accurate monitoring of multiple scenarios affecting the application system can be achieved. Furthermore, by displaying the monitoring data from these multiple scenarios within the Prometheus monitoring system, monitoring results can be obtained. This overcomes the limitation of existing technologies where components in the Prometheus monitoring system can only monitor limited scenarios and cannot meet the monitoring needs of multiple application systems. It achieves comprehensive, accurate, and effective monitoring of the application system across multiple scenarios. On the other hand, it also overcomes the problems of existing technologies where deploying Prometheus monitoring system components requires more resources, increases maintenance costs, and has lower monitoring efficiency, thus improving the monitoring efficiency and accuracy of the application system.

[0046] The following is combined with Figures 1-5 The technical solution of the present invention will be described in detail with reference to specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0047] Figure 1 This is a flowchart illustrating an embodiment of the application system monitoring method provided by this invention. Figure 1 As shown, the method provided in this embodiment includes:

[0048] Step 101: Establish a monitoring indicator model for the application system; the monitoring indicator model is used to monitor indicators for multiple scenarios corresponding to the application system.

[0049] Specifically, in related technologies, components based on the Prometheus monitoring system can only monitor a specific scenario. However, in the actual operation and maintenance of application systems, it is necessary to combine multiple indicators from multiple scenarios to monitor the system's operation. In other words, the Prometheus monitoring system can only monitor a limited number of scenarios separately, which cannot meet the monitoring needs of multiple scenarios. Moreover, the deployment of multiple components of the Prometheus monitoring system requires more resources, increases maintenance costs, and has low monitoring efficiency.

[0050] To address the aforementioned issues, this embodiment of the invention first establishes a monitoring indicator model for the application system. This model is used to monitor indicators across multiple scenarios corresponding to the application system. Optionally, the application system in this application can be an application program. Optionally, during the operation of the application system, it may be affected by factors in multiple scenarios, such as the operating environment or connected peripheral systems. Therefore, to ensure the normal operation of the application system, it is necessary to monitor indicators across multiple scenarios affecting the application system, thereby promptly identifying and resolving potential problems and risks during its operation. Optionally, the monitoring indicator model for the application system in this application includes indicators that need to be monitored in multiple scenarios corresponding to the application system, the definition methods for each indicator in each scenario, and the methods for obtaining the data corresponding to each indicator.

[0051] Step 102: Based on the monitoring indicator model, collect monitoring data for multiple scenarios corresponding to the application system;

[0052] Specifically, after establishing a monitoring indicator model for the application system, this invention collects monitoring data from multiple scenarios corresponding to the application system based on the monitoring indicator model. This allows for the collection of relevant data from multiple scenarios affecting the operation of the application system, such as the memory space and disk size in the scenario of the operating system on which the application system resides, and external port information in the scenario of external connections corresponding to the application system. Thus, based on the monitoring data from multiple scenarios corresponding to the application system, the application system can be monitored comprehensively and accurately.

[0053] Step 103: Based on the monitoring data of multiple scenarios corresponding to the application system, obtain the indicator monitoring results of multiple scenarios corresponding to the application system.

[0054] Specifically, after collecting monitoring data from multiple scenarios corresponding to the application system, this embodiment of the invention can display the monitoring data from multiple scenarios corresponding to the application system in the Prometheus monitoring system, thereby obtaining the monitoring results from multiple scenarios corresponding to the application system.

[0055] To ensure the normal operation of the application system, the method in the above embodiments first establishes a monitoring indicator model for the application system. This model includes indicators for multiple scenarios corresponding to the application system that require monitoring. Based on this model, comprehensive and accurate monitoring of multiple scenarios affecting the application system can be achieved. Furthermore, by displaying the monitoring data from these multiple scenarios within the Prometheus monitoring system, monitoring results can be obtained. This overcomes the limitation of existing technologies where components in the Prometheus monitoring system can only monitor limited scenarios and cannot meet the monitoring needs of multiple application scenarios, thus achieving comprehensive, accurate, and effective monitoring of the application system across multiple scenarios. On the other hand, it also overcomes the problems of existing technologies where deploying Prometheus monitoring system components requires more resources, increases maintenance costs, and has lower monitoring efficiency, thereby improving the monitoring efficiency and accuracy of the application system.

[0056] In one embodiment, establishing a monitoring indicator model for the application system includes:

[0057] Establish a first-scenario monitoring sub-model, a second-scenario monitoring sub-model, and a third-scenario monitoring sub-model for the application system. The first-scenario monitoring sub-model is used to monitor the performance metrics of the operating system on which the application system resides. The second-scenario monitoring sub-model is used to monitor the process-related performance metrics of the application system. The third-scenario monitoring sub-model is used to monitor the interface-related performance metrics of the application system.

[0058] Based on the first scenario monitoring sub-model, the second scenario monitoring sub-model, and the third scenario monitoring sub-model, a monitoring indicator model for the application system is generated.

[0059] Specifically, in the process of establishing the monitoring indicator model of the application system in this embodiment of the invention, a monitoring system for multiple scenarios corresponding to the application system is established. This system not only monitors the performance indicators related to the application system's own processes, but also monitors the performance indicators of the operating system corresponding to the application system's operating environment, and monitors the performance indicators related to the connection interfaces that interact with the application system. Thus, based on the performance indicators related to the application system's own processes, the performance indicators of the operating system corresponding to the application system's operating environment, and the performance indicators related to the connection interfaces that interact with the application system, comprehensive, accurate, and precise monitoring of the application system can be achieved.

[0060] For example, such as Figure 2As shown, the monitoring metric model of the application system includes a first scenario monitoring sub-model, a second scenario monitoring sub-model, and a third scenario monitoring sub-model. The first scenario monitoring sub-model includes performance metrics of the operating system corresponding to the application system's runtime environment; the second scenario monitoring sub-model includes performance metrics related to the application system's own processes; and the third scenario monitoring sub-model includes performance metrics related to the connection interfaces that interact with the application system. An example is shown below:

[0061] (1) Performance metrics of the operating system corresponding to the application system's operating environment: Startup days, metric name: app_os_start_date; Disk space, metric name: app_os_disk_rate; CPU utilization, metric name: app_os_cpu_rate; Memory utilization, metric name: app_os_mem_rate;

[0062] (2) Performance metrics related to the application system's own processes: number of process connections, metric name: app_process_con_count; number of process threads, metric name: app_process_thread_count; number of FullGCs, metric name: app_process_fullgc_count;

[0063] (3) Performance metrics related to the connection interface that interacts with the application system: its own service status, metric name: app_inter_http_status; service status of surrounding systems, metric name: app_inter_service_status.

[0064] By establishing the first scenario monitoring sub-model, the second scenario monitoring sub-model, and the third scenario monitoring sub-model, we can fully understand the application system's HTTP service status, process connection count, process thread count, and other application metrics. We can also clearly understand whether the CPU, memory, and storage status of the operating system are normal, and monitor whether the interface services of surrounding systems are normal. Thus, we can comprehensively, accurately, and precisely determine whether an application system can provide services to the outside world normally, achieving comprehensive, accurate, and precise monitoring of the application system.

[0065] The method described in the above embodiments establishes a monitoring system for multiple scenarios corresponding to the application system. It not only monitors the performance indicators related to the application system's own processes, but also monitors the performance indicators of the operating system corresponding to the application system's operating environment and the performance indicators related to the connection interfaces that interact with the application system. Therefore, based on the performance indicators related to the application system's own processes, the performance indicators of the operating system corresponding to the application system's operating environment, and the performance indicators related to the connection interfaces that interact with the application system, it is possible to achieve comprehensive, accurate, and precise monitoring of the application system.

[0066] In one embodiment, monitoring data is collected from multiple scenarios corresponding to the application system based on a monitoring indicator model, including:

[0067] Based on the monitoring metric model, create a target configuration file; the target configuration file is used to provide the configuration information required when monitoring multiple scenarios corresponding to the application system.

[0068] Based on the target configuration file, collect monitoring data from multiple scenarios corresponding to the application system.

[0069] Specifically, after establishing the monitoring indicator model, this embodiment of the invention can collect monitoring data from multiple scenarios corresponding to the application system based on the monitoring indicator model, thereby achieving comprehensive, accurate, and precise monitoring of the application system. Optionally, after establishing the monitoring indicator model, this embodiment of the invention also creates a target configuration file; wherein, the target configuration file is used to provide the configuration information required for monitoring multiple scenarios corresponding to the application system, such as the port, attributes, connection method, and other information of the connection interface that interacts with the application system; thus, based on the configuration information required for monitoring multiple scenarios corresponding to the application system, it is possible to quickly and accurately collect data from multiple scenarios corresponding to the application system, avoiding the problems of inability to obtain data due to lack of relevant configuration information or low efficiency and low accuracy due to the need for manual input.

[0070] The method described in the above embodiments creates a target configuration file through a monitoring indicator model, thereby obtaining the configuration information required for monitoring multiple scenarios corresponding to the application system. Based on the target configuration information, it is possible to quickly and accurately collect data from multiple scenarios corresponding to the application system, avoiding the problems of inability to obtain data due to lack of relevant configuration information or low efficiency and low accuracy due to the need for manual input.

[0071] In one embodiment, monitoring data for multiple scenarios corresponding to the application system is collected according to the target configuration file, including:

[0072] Load the target configuration file;

[0073] Based on the configuration information in the target configuration file, system commands are invoked to collect monitoring data for multiple scenarios corresponding to the application system.

[0074] Specifically, after creating the target configuration file—that is, obtaining the configuration information required for monitoring multiple scenarios corresponding to the application system—this embodiment of the invention maps and loads the configuration file on the client. Then, based on the configuration information in the target configuration file, monitoring data for multiple scenarios corresponding to the application system can be collected by calling system commands. This embodiment of the invention collects monitoring data for multiple scenarios corresponding to the application system by calling system commands, i.e., by calling operating system commands or network functions. Compared to existing technologies that collect data through scripts or the Prometheus monitoring system that collects monitoring data based on plugins, this effectively improves the efficiency of obtaining monitoring indicators for multiple scenarios corresponding to the application system, thus improving the overall monitoring efficiency for multiple scenarios.

[0075] The method described in the above embodiments collects monitoring data from multiple scenarios corresponding to the application system by calling system commands. Compared with the prior art of collecting data through scripts or the Prometheus monitoring system based on plugins, this method can effectively improve the efficiency of obtaining monitoring indicators from multiple scenarios corresponding to the application system and improve the monitoring efficiency of multiple scenarios corresponding to the application system.

[0076] In one embodiment, system commands are invoked to collect monitoring data from multiple scenarios corresponding to the application system, including:

[0077] Use the Go programming language to call system commands to collect monitoring data for multiple scenarios corresponding to the application system.

[0078] Specifically, in this embodiment of the invention, the Go language can also be used to call system commands to collect monitoring data in multiple scenarios corresponding to the application system. That is, by utilizing the lightweight and high-performance characteristics of the Go Gin framework, the efficiency of obtaining monitoring indicators in multiple scenarios corresponding to the application system can be quickly and efficiently improved. This provides a flexible and reliable method for obtaining monitoring indicators in multiple scenarios corresponding to the target application system, thereby improving the efficiency and flexibility of obtaining monitoring indicators.

[0079] In one embodiment, after establishing the monitoring indicator model for the application system, the method further includes:

[0080] The Go programming language is used to determine the metric collection route; the metric collection route is used to indicate the access path of the monitoring metrics.

[0081] Based on the aforementioned monitoring indicator model, monitoring data is collected from multiple scenarios corresponding to the application system, including:

[0082] Based on the aforementioned indicator collection route, the monitoring data of multiple scenarios corresponding to the application system are encapsulated to obtain the encapsulated monitoring data of multiple scenarios.

[0083] The Prometheus SDK is used to convert the encapsulated monitoring data from multiple scenarios into a standardized format that the Prometheus server can recognize, and then the data is collected by the server.

[0084] Specifically, in this invention, after establishing the monitoring metric model of the application system, the metric collection route can be determined, that is, the storage location information corresponding to the monitoring data and the access path of the monitoring metrics can be determined. Optionally, the lightweight and high-performance characteristics of the Gogin framework can be used to quickly build a web service to provide a default metric collection route " / metrics", that is, the acquired metrics can be stored in the location area corresponding to " / metrics". Further, after determining the metric collection route and obtaining the monitoring data of multiple scenarios corresponding to the application system, the monitoring data of multiple scenarios corresponding to the application system can be encapsulated to obtain the encapsulated monitoring data of multiple scenarios. Optionally, the acquired monitoring metrics of multiple scenarios of the application system can be encapsulated based on the Prometheus SDK and registered in the Prometheus registry, so that the monitoring data of multiple scenarios corresponding to the application system can be displayed in the Prometheus monitoring system, thereby obtaining the monitoring results of multiple scenarios corresponding to the application system.

[0085] The method described in the above embodiments encapsulates monitoring data from multiple scenarios corresponding to the application system, obtaining encapsulated monitoring data for multiple scenarios. This encapsulated monitoring data is then sent to the server, enabling the display of monitoring data from multiple scenarios within the Prometheus monitoring system. This overcomes the limitations of existing technologies where the Prometheus monitoring system can only monitor limited scenarios and cannot meet the monitoring needs of multiple application scenarios. It also overcomes the problems of existing technologies where deploying Prometheus monitoring system components requires more resources, increases maintenance costs, and has lower monitoring efficiency, thus improving the monitoring efficiency and accuracy of the application system.

[0086] In one embodiment, before collecting monitoring data from multiple scenarios corresponding to the application system based on the monitoring indicator model, the method further includes:

[0087] Obtain application system indicator monitoring query request; the query request is used to request the collection of indicators of the application system under multiple scenarios based on the Prometheus server, and to display, monitor and alarm the indicators.

[0088] Specifically, in this embodiment of the invention, monitoring data for multiple scenarios corresponding to the application system can be collected according to the monitoring needs of the application system. For example, monitoring data for multiple scenarios can be collected when the application system is busy, and not when the application system is idle. That is, before collecting monitoring data for multiple scenarios corresponding to the application system according to the monitoring indicator model, the application system indicator monitoring query request is obtained to determine whether it is necessary to monitor the indicators of the application system in multiple scenarios. Optionally, the indicator collection for multiple scenarios of the application system is only performed when the application system indicator monitoring query request is received; if the application system indicator monitoring query request is not received, the indicator collection for multiple scenarios of the application system is not performed, thereby reducing resource consumption and improving the flexibility of application system monitoring.

[0089] The method in the above embodiments collects monitoring data for multiple scenarios corresponding to the application system according to the monitoring needs of the application system. That is, the multi-scenario indicator collection of the application system is only carried out when an application system indicator monitoring query request is received. If no application system indicator monitoring query request is received, the multi-scenario indicator collection of the application system is not carried out, thereby reducing resource consumption and improving the flexibility of application system monitoring.

[0090] For example, the application system monitoring method in this embodiment of the invention, such as... Figure 3 As shown,

[0091] First, establish a monitoring indicator model for the application system, which involves establishing various indicators required for application system monitoring, such as operating system, processes, interface services, and HTTP information, and defining the namespace, system name, indicator name, and label for each indicator according to specifications.

[0092] Then, determine the metric collection route. Optionally, the GoGin framework can be used to publish a web service to the " / metrics" terminal, and modules such as os, net, and HTTP client can be used to develop and collect various metrics. Optionally, the model module can be used to map the exporter YAML configuration file, the service module can be used to develop metrics in various directions, and the controller module can be used to control service calls, encapsulate data types according to the Prometheus SDK specification, and register in the registry. At the same time, Gin BasicAuth technology can be used to implement HTTP Basic authentication to ensure data security. For example, a web service can be built using the GoGin framework, defining the service port and the data collection terminal " / metrics" route, and using BasicAuth technology to implement HTTP authentication to ensure the security of collected data; the model module can create a configuration file structure to realize the mapping and loading of configuration files, which are used for some JDK environment, service port, peripheral interfaces, and BasicAuth key information required for the initial loading of the exporter; the service layer can be used to obtain metrics of different dimensions. In the service module, osService, processService, and interfaceService are defined, and the exec, net, and HTTP client technologies of os are used to develop operating system, process, and peripheral interface related metrics, respectively. All metrics are collected by calling Linux operating system commands or network functions via Go to maximize metric acquisition efficiency. Metrics like `app_os` and `app_process` directly retrieve operating system information using the `exec` function of the `os` module according to a predefined `sh` script. Metrics like `app_inter` obtain interface status and HTTP status codes using the `net` module and the `curl` command.

[0093] Finally, the monitoring data from multiple scenarios corresponding to the application system are encapsulated to obtain encapsulated monitoring data for multiple scenarios. This encapsulated monitoring data is then sent to the server. Optionally, the acquired metrics can be registered according to the Prometheus SDK and returned to the " / metrics" terminal for collection by the Prometheus Server. After the program is compiled and started, the exporter is configured on the Prometheus Server, and the collected metric information can be queried in the Prometheus console. This enables the display of monitoring data from multiple scenarios corresponding to the application system within the Prometheus monitoring system, overcoming the problem that existing technologies based on Prometheus monitoring systems can only monitor limited scenarios and cannot meet the monitoring needs of multiple application scenarios. It also overcomes the problems of existing technologies where deploying Prometheus monitoring system components requires more resources, increases maintenance costs, and has lower monitoring efficiency, thus improving the monitoring efficiency and accuracy of the application system.

[0094] The method described above can be used in the field of application system monitoring based on the Linux operating system. It utilizes the Gin technology of the Go language combined with the Prometheus SDK to monitor indicators of application systems in multiple scenarios. It can be used to monitor personalized indicators of application systems, realize the customized development of various application monitoring indicators according to the actual needs of enterprises, and push the time-series data formed according to the Prometheus specification to the server. This accurately obtains various indicator data that affect the operation of application systems, improves monitoring accuracy, reduces the waste of operating resources, and lowers resource utilization.

[0095] The application system monitoring device provided by the present invention is described below. The application system monitoring device described below can be referred to in correspondence with the application system monitoring method described above.

[0096] Figure 4 This is a schematic diagram of the application system monitoring device provided by the present invention. The application system monitoring device provided in this embodiment includes:

[0097] Module 410 is used to establish a monitoring indicator model for the application system; the monitoring indicator model is used to monitor indicators in multiple scenarios corresponding to the application system.

[0098] The acquisition module 420 is used to collect monitoring data from multiple scenarios corresponding to the application system based on the monitoring indicator model.

[0099] The monitoring module 430 is used to obtain the indicator monitoring results of multiple scenarios corresponding to the application system based on the monitoring data of multiple scenarios corresponding to the application system.

[0100] Optionally, the establishment module 410 is specifically used to: establish a first scenario monitoring sub-model, a second scenario monitoring sub-model, and a third scenario monitoring sub-model for the application system; the first scenario monitoring sub-model is used to monitor the performance indicators of the operating system where the application system resides; the second scenario monitoring sub-model is used to monitor the process-related performance indicators of the application system; and the third scenario monitoring sub-model is used to monitor the interface-related performance indicators of the application system.

[0101] Based on the first scenario monitoring sub-model, the second scenario monitoring sub-model, and the third scenario monitoring sub-model, a monitoring indicator model for the application system is generated.

[0102] Optionally, the acquisition module 420 is specifically used to: create a target configuration file based on the monitoring indicator model; the target configuration file is used to provide the configuration information required when monitoring multiple scenarios corresponding to the application system;

[0103] Based on the target configuration file, collect monitoring data from multiple scenarios corresponding to the application system.

[0104] Optionally, the acquisition module 420 is specifically used for: loading the target configuration file;

[0105] Based on the configuration information in the target configuration file, system commands are invoked to collect monitoring data for multiple scenarios corresponding to the application system.

[0106] Optionally, the acquisition module 420 is specifically used to: use the Go language to call system commands to acquire monitoring data in multiple scenarios corresponding to the application system.

[0107] Optionally, the establishment module 410 is specifically used to: determine the indicator collection route using the Go language; the indicator collection route is used to indicate the access path of the monitoring indicators;

[0108] Optionally, the monitoring module 430 is specifically used to: based on the indicator collection route, encapsulate the monitoring data of multiple scenarios corresponding to the application system to obtain the encapsulated monitoring data of multiple scenarios;

[0109] The Prometheus SDK is used to convert the encapsulated monitoring data from multiple scenarios into a standardized format that the Prometheus server can recognize, and then the data is collected by the server.

[0110] Optionally, the monitoring module 430 is specifically used to: obtain application system indicator monitoring query requests; the query requests are used to request the collection of indicators of the application system under multiple scenarios based on the Prometheus server, and to display, monitor and alarm the indicators.

[0111] The apparatus of this invention is used to execute the method in any of the foregoing method embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.

[0112] Figure 5 A schematic diagram of the physical structure of an electronic device is provided. This electronic device may include a processor 510, a communications interface 520, a memory 530, and a communication bus 540. The processor 510, communications interface 520, and memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute an application system monitoring method. This method includes: establishing a monitoring indicator model for the application system; using the monitoring indicator model to monitor indicators under multiple scenarios corresponding to the application system; collecting monitoring data under multiple scenarios corresponding to the application system based on the monitoring indicator model; and obtaining the indicator monitoring results under multiple scenarios corresponding to the application system based on the monitoring data.

[0113] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0114] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, and when the program instructions are executed by a computer, the computer is able to execute the application system monitoring method provided by the above methods, the method including: establishing a monitoring indicator model for the application system; using the monitoring indicator model to monitor indicators under multiple scenarios corresponding to the application system; collecting monitoring data under multiple scenarios corresponding to the application system according to the monitoring indicator model; and obtaining indicator monitoring results under multiple scenarios corresponding to the application system based on the monitoring data under multiple scenarios corresponding to the application system.

[0115] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is implemented to perform the application system monitoring methods provided above. The method includes: establishing a monitoring indicator model for the application system; using the monitoring indicator model to monitor indicators under multiple scenarios corresponding to the application system; collecting monitoring data under multiple scenarios corresponding to the application system according to the monitoring indicator model; and obtaining indicator monitoring results under multiple scenarios corresponding to the application system based on the monitoring data under multiple scenarios corresponding to the application system.

[0116] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0117] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An application system monitoring method, applied to the Prometheus monitoring system, characterized in that, include: Establish a monitoring indicator model for the application system; The monitoring indicator model is used to monitor indicators in multiple scenarios corresponding to the application system. Based on the monitoring indicator model, monitoring data is collected from multiple scenarios corresponding to the application system. Based on monitoring data from multiple scenarios corresponding to the application system, obtain the indicator monitoring results for multiple scenarios corresponding to the application system. The establishment of the monitoring indicator model for the application system includes: Establish a first scenario monitoring sub-model, a second scenario monitoring sub-model, and a third scenario monitoring sub-model for the application system; the first scenario monitoring sub-model is used to monitor the performance indicators of the operating system on which the application system resides; the second scenario monitoring sub-model is used to monitor the process-related performance indicators of the application system; the third scenario monitoring sub-model is used to monitor the interface-related performance indicators of the application system. Based on the first scenario monitoring sub-model, the second scenario monitoring sub-model, and the third scenario monitoring sub-model, a monitoring indicator model for the application system is generated. The step of collecting monitoring data from multiple scenarios corresponding to the application system based on the monitoring indicator model includes: Based on the monitoring indicator model, a target configuration file is created; the target configuration file is used to provide the configuration information required for monitoring multiple scenarios corresponding to the application system. Based on the target configuration file, monitoring data is collected for multiple scenarios corresponding to the application system.

2. The application system monitoring method according to claim 1, characterized in that, The step involves collecting monitoring data from multiple scenarios corresponding to the application system based on the target configuration file, including: Load the target configuration file; Based on the configuration information in the target configuration file, system commands are invoked to collect monitoring data from multiple scenarios corresponding to the application system.

3. The application system monitoring method according to claim 2, characterized in that, The system commands are invoked to collect monitoring data from multiple scenarios corresponding to the application system, including: Use the Go programming language to call system commands to collect monitoring data for multiple scenarios corresponding to the application system.

4. The application system monitoring method according to claim 3, characterized in that, After establishing the monitoring indicator model for the application system, it also includes: The Go programming language is used to determine the metric collection route; the metric collection route is used to indicate the access path of the monitoring metrics. The method of obtaining the monitoring results of indicators for multiple scenarios corresponding to the application system based on monitoring data includes: Based on the aforementioned indicator collection route, the monitoring data of multiple scenarios corresponding to the application system are encapsulated to obtain the encapsulated monitoring data of multiple scenarios. The Prometheus SDK is used to convert the encapsulated monitoring data from multiple scenarios into a standardized format that the Prometheus server can recognize, and then the data is collected by the server.

5. The application system monitoring method according to claim 4, characterized in that, Before collecting monitoring data from multiple scenarios corresponding to the application system based on the monitoring indicator model, the process also includes: Obtain application system indicator monitoring query request; the query request is used to request the collection of indicators of the application system under multiple scenarios based on the Prometheus server, and to display, monitor and alarm the indicators.

6. An application system monitoring device, characterized in that, include: Establish a module for building monitoring indicator models for application systems; The monitoring indicator model is used to monitor indicators in multiple scenarios corresponding to the application system. The establishment of the application system monitoring indicator model includes: establishing a first scenario monitoring sub-model, a second scenario monitoring sub-model, and a third scenario monitoring sub-model for the application system; the first scenario monitoring sub-model is used to monitor the performance indicators of the operating system on which the application system resides; the second scenario monitoring sub-model is used to monitor the process-related performance indicators of the application system; the third scenario monitoring sub-model is used to monitor the interface-related performance indicators of the application system; and the monitoring indicator model of the application system is generated based on the first scenario monitoring sub-model, the second scenario monitoring sub-model, and the third scenario monitoring sub-model. The data acquisition module is used to acquire monitoring data for multiple scenarios corresponding to the application system according to the monitoring indicator model. Acquiring monitoring data for multiple scenarios corresponding to the application system according to the monitoring indicator model includes: creating a target configuration file according to the monitoring indicator model; the target configuration file is used to provide the configuration information required for monitoring multiple scenarios corresponding to the application system; and acquiring monitoring data for multiple scenarios corresponding to the application system according to the target configuration file. The monitoring module is used to obtain the monitoring results of indicators for multiple scenarios corresponding to the application system based on the monitoring data of multiple scenarios corresponding to the application system.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the application system monitoring method as described in any one of claims 1 to 5.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the application system monitoring method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Monitoring method, device and system

    CN106095641A

  • Extensible and pluggable cloud native monitoring system platform and monitoring method thereof

    CN115695465A