Application performance monitoring method and apparatus, storage medium, and electronic device
By registering and configuring a monitoring plugin for the query server in a Java application, and listening to and reporting performance metric information, the problem of incomplete performance monitoring in Java applications is solved, and flexible and comprehensive performance monitoring is achieved.
Patent Information
- Application Number
- CN202210027178.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-11
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2042-01-11
AI Technical Summary
Existing Java application performance monitoring solutions based on the Spring framework lack flexibility and cannot comprehensively monitor application performance metrics, especially database load performance metrics, leading to significant operational risks.
Register a monitoring plugin configured with a query server in the target application. The query server listens for query ports for performance metrics, receives query requests from the monitoring server, determines the metric type, and returns the corresponding target metric information, thereby enabling proactive monitoring of multiple performance metrics.
It enables the monitoring server to proactively acquire multiple performance metrics of target applications, solving the problem of incomplete monitoring and improving the flexibility and comprehensiveness of monitoring.
Smart Images

Figure CN114416508B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of application monitoring, in particular to an application performance monitoring method and device, a storage medium and an electronic device. BACKGROUND
[0002] The Java application based on the Spring framework is not perfect in the performance monitoring solution of the Java application adapted to the Spring framework because the Spring framework technology is relatively old. The open source monitoring solutions supporting the Java application include Prometheus and zabbix, but they only support the basic application index monitoring at the JVM level and lack the function implementation of adapting various performance index monitoring.
[0003] In the current application performance monitoring method, fixed plug-ins are used to obtain specified indexes, and other index information of the application cannot be obtained, for example, the load performance index information of the application about the database cannot be monitored. This leads to a great risk in the running of the application. That is, the flexibility of the existing application performance monitoring is poor, which leads to incomplete application performance monitoring, thereby leading to a great risk in the running of the application.
[0004] In view of the above problems, no effective solution has been proposed. SUMMARY
[0005] The embodiments of the present application provide an application performance monitoring method and device, a storage medium and an electronic device to at least solve the technical problem of incomplete application performance monitoring due to poor flexibility of the application performance monitoring.
[0006] According to an aspect of the embodiments of the present application, an application performance monitoring method is provided, including: registering a monitoring plug-in in a target application, wherein the monitoring plug-in is internally provided with a query server, and the query server is used for monitoring and querying various performance indexes of the target application; starting the query server, listening to a query port, wherein the query port is a communication port of the query server for querying the performance indexes; receiving a query request sent by a monitoring server through the query port, determining the index type corresponding to the query request, and returning target index information corresponding to the index type to the monitoring server through the query port.
[0007] According to another aspect of the embodiments of the present application, there is further provided an application performance monitoring device, comprising: a registration unit configured to register a monitoring plug-in in a target application, wherein the monitoring plug-in is internally provided with a query server configured to monitor and query each performance index of the target application; a listening unit configured to listen to a query port in a case that the query server is started, wherein the query port is a communication port of the query server for querying the performance index; a determination unit configured to determine an index type corresponding to a query request in a case that the query request sent by a monitoring server is received by the query port; and a return unit configured to return target index information corresponding to the index type to the monitoring server through the query port.
[0008] According to still another aspect of the embodiments of the present application, there is further provided a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is configured to execute the application performance monitoring method when running.
[0009] According to still another aspect of the embodiments of the present application, there is further provided an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the application performance monitoring method through the computer program.
[0010] In the embodiments of the present application, the monitoring plug-in configured with the query server is registered in the target application, the query port for the performance index of the target application is listened to through the start of the query server, the corresponding index type of the query request sent by the monitoring server is determined when the query request is received by the query port, the corresponding performance index information of the target application is obtained by the monitoring plug-in, and the performance index information is fed back to the monitoring server through the query port, so that the query request of the monitoring server for actively pulling the performance index of the target application is received by the query server in the monitoring plug-in, the performance index is corresponded to the query port provided by the query server, the obtaining of the multiple performance indexes of the target application is realized, the purpose of the active monitoring and obtaining of the multiple performance indexes of the target application by the monitoring server is achieved, the technical effect that the performance indexes of the target application are flexibly and comprehensively monitored by the monitoring server is realized, and the technical problem that the application performance monitoring is not comprehensive due to the poor flexibility of the application performance monitoring is solved. BRIEF DESCRIPTION OF DRAWINGS
[0011] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and serve to explain the principles of the application. In the drawings:
[0012] Figure 1Fig. 1 is a schematic diagram of an application environment of an optional application performance monitoring method according to an embodiment of the present application;
[0013] Figure 2 Fig. 2 is a flowchart of an optional application performance monitoring method according to an embodiment of the present application;
[0014] Figure 3 Fig. 3 is a flowchart of an optional application performance monitoring method according to an embodiment of the present application;
[0015] Figure 4 Fig. 4 is a flowchart of an optional application performance monitoring method according to an embodiment of the present application;
[0016] Figure 5 Fig. 5 is a flowchart of an optional application performance monitoring method according to an embodiment of the present application;
[0017] Figure 6 Fig. 6 is an interaction timing diagram of an optional application performance monitoring method according to an embodiment of the present application;
[0018] Figure 7 Fig. 7 is an interaction timing diagram of an optional application performance monitoring method according to an embodiment of the present application;
[0019] Figure 8 Fig. 8 is a structural diagram of an optional application performance monitoring device according to an embodiment of the present application;
[0020] Figure 9 Fig. 9 is a structural diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0021] In order to make the personnel in the art better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by the personnel in the art without creative labor should belong to the scope of protection of the present application.
[0022] It is to be understood that the terminology "first", "second" and the like used throughout this specification and the annexed drawings is merely intended to distinguish between similar objects and not necessarily to describe a specific sequential or chronological order. It is to be understood that the use of the terms "including", "comprising" or "having" and variations thereof throughout this specification and the annexed drawings is intended to cover the nature of the specification that the processes, methods, objects, products, compositions and / or apparatuses described herein can comprise, include and / or have one or more of the features, elements, steps, operations, objects, components and / or units thereof without necessarily excluding other features, elements, steps, operations, objects, components and / or units thereof. It is to be understood that the terminology "consisting of" is intended to cover the nature of the specification that the processes, methods, objects, products, compositions and / or apparatuses described herein can only include the features, elements, steps, operations, objects, components and / or units thereof that are specifically recited in the specification without necessarily excluding other features, elements, steps, operations, objects, components and / or units thereof.
[0023] According to an aspect of the embodiments of the present application, there is provided an application performance monitoring method, which can be applied in the environment as shown in Figure 1 The terminal device 102 interacts with the monitoring server 112 through the network 110 for application performance monitoring, for the application performance of the target application 104 installed in the terminal device 102. The application performance monitoring of the target application 104 is not limited to being implemented by sequentially performing S102 to S108.
[0024] Registering a monitoring plug-in. A monitoring plug-in is registered in the target application 104, and the monitoring plug-in is internally provided with a query server for monitoring and querying various performance indicators of the target application. Listening to a query port. In the case that the query server is started, a query port is listened to, and the query port is a communication port of the query server for querying performance indicators. Determining an indicator type. In the case that the query port receives a query request sent by the monitoring server 112, the indicator type corresponding to the query request is determined. Returning target indicator information. The target indicator information corresponding to the indicator type is returned to the monitoring server 112 through the query port.
[0025] In the case that the monitoring server 112 receives the indicator information, the indicator information is not limited to being stored in the database 114, and the indicator information is processed by the processing engine 116 to implement the performance monitoring of the target application through the indicator information.
[0026] Optionally, in the embodiment, the terminal device can be a terminal device configured with a client of a target application, and can include, but is not limited to, at least one of a mobile phone (such as an Android mobile phone, an IOS mobile phone, etc.), a notebook computer, a tablet computer, a palm computer, a MID (Mobile Internet Device), a PAD, a desktop computer, a smart television, etc. The target application is not limited to a software application, and the software application is not limited to a video application, an instant messaging application, a browser application, an educational application, etc. The network can include, but is not limited to, a wired network including a local area network, a metropolitan area network, and a wide area network, and a wireless network including Bluetooth, WIFI, and other wireless communication networks. The monitoring server can be a single server, a server cluster composed of multiple servers, or a cloud server. The above is only an example, and the embodiment is not limited in this regard.
[0027] As an optional implementation, as shown in Figure 2 The application performance monitoring method includes the following steps.
[0028] S202, registering a monitoring plug-in in the target application, wherein the monitoring plug-in is built-in with a query server, and the query server is used for monitoring and querying each performance indicator of the target application.
[0029] In the above S202, the monitoring plug-in is not limited to a monitoring plug-in corresponding to a monitoring server monitoring the target application. The monitoring plug-in is registered in the target application, so that the monitoring server monitors the performance of the target application through the monitoring plug-in.
[0030] Optionally, the query server in the monitoring plug-in is not limited to a query port used to provide monitoring of the performance indicators of the target application by the monitoring server. Different performance indicators are not limited to corresponding different query ports, and the monitoring server obtains the performance indicator information of the target application through the query port.
[0031] S204, in the case where the query server is started, listening to a query port, wherein the query port is a communication port of the query server used for querying the performance indicators.
[0032] In the above S204, the start of the query server is not limited to being realized through the start of the monitoring plug-in at the same time as the start of the target application. In the case where the monitoring plug-in is registered to the target application, the monitoring plug-in is started at the same time as the start of the target application.
[0033] In the case where the monitoring plug-in is started, the communication connection between the monitoring server and the query server is not limited to being started, so as to realize the query monitoring of the performance indicators of the target application by the monitoring server through the query server.
[0034] In the case that the query server provides multiple query ports available for performance index query and each query port corresponds to different performance index, the monitoring server is not limited to obtaining the performance index information of the target application through the query port provided by the query server.
[0035] S206, in the case that the query port receives the query request sent by the monitoring server, the index type corresponding to the query request is determined.
[0036] In the case that the target application is started, the interface information of the query interface is not limited to being sent to the monitoring server, so that the monitoring server sends a query request through the query interface, and the index type and performance index corresponding to the query request received through the query interface are determined.
[0037] S208, the target index information corresponding to the index type is returned to the monitoring server through the query port.
[0038] In the case that the index message corresponding to the query request initiated by the monitoring server is determined, the monitoring plug-in obtains the corresponding index information, and returns the index information to the monitoring server through the query port, so that the monitoring server obtains the performance index information of the target application.
[0039] The performance index of the target application is not limited to the state performance data and data performance data generated when the target application is running, for example, the state performance data of the database when the target application is running.
[0040] In the embodiment of the present application, the monitoring plug-in configured with the query server is registered in the target application, the query port for the performance index of the target application is listened to through the start of the query server, when the query request sent by the monitoring server is received in the query port, the corresponding performance index information of the target application is obtained by the monitoring plug-in through the determination of the index type corresponding to the query request, so as to feed back the performance index information to the monitoring server through the query port. The query server in the monitoring plug-in receives the query request of the monitoring server for actively pulling the performance index of the target application, the performance index corresponding to the query port provided by the query server is realized, the multiple performance indexes of the target application are obtained, the purpose of the active monitoring and obtaining of the multiple performance indexes of the target application by the monitoring server is achieved, the technical effect that the monitoring server flexibly and comprehensively monitors the performance index of the target application is realized, and the technical problem that the application performance monitoring is not comprehensive due to the poor flexibility of the application performance monitoring is solved.
[0041] As an optional implementation manner, as shown in Figure 3 The above-mentioned registration of the monitoring plug-in in the target application includes:
[0042] S302, determine the container configuration file of the monitoring plug-in according to the database type corresponding to the target application;
[0043] S304, load the container configuration file to initialize the metric register of the monitoring plug-in in the container startup process of the monitoring plug-in, wherein the metric register is used to obtain the metric information;
[0044] S306, register the metric collection component in the metric register.
[0045] Optionally, registering the monitoring plug-in in the target application includes loading the configuration file and registering the metric collection component in the metric register. Loading the configuration file includes determining the corresponding container configuration file according to the database type of the target application, so that the monitoring plug-in obtains the performance indicators related to the database of the target application.
[0046] Optionally, in the case where the container configuration file is loaded, the metric register in the monitoring plug-in is initialized, and the metric register is used to obtain and store the metric information of the target application. The metric register is not limited to registering a plurality of metric collection components, and each metric collection component is not limited to being used to obtain and store the corresponding metric information.
[0047] Optionally, before registering the metric collection component in the metric register, the query server is not limited to being initialized. The initialization of the query server is not limited to including the initialization of the request processor component, the initialization of the query port, and the setting initialization of the thread pool processing.
[0048] In the case where the query server is initialized, registering the metric collection component in the metric register is not limited to sequentially performing the following steps:
[0049] S1, configure the query port corresponding to the metric collection component. Determine the query port associated with the current metric collection component from the communication port of the query server;
[0050] S2, configure the query instruction corresponding to the query port. The corresponding metric information is specified through the query instruction.
[0051] As an optional implementation, as shown in Figure 4 the above registering the metric collection component in the metric register includes:
[0052] S402, register the first metric collection component, wherein the first metric collection component is used to obtain the attribute metric information of the target application;
[0053] S404, determine the second metric collection component corresponding to the target application according to the database type, wherein the second metric collection component is used to obtain the database metric information associated with the target application;
[0054] S406, register the second index collection component.
[0055] Optionally, the attribute index information of the target application is not limited to the JVM class index indicating the Java application. The database index information of the target application is not limited to the database connection pool index data indicating the Java application. Meanwhile, it is not limited to obtaining other application index information by registering other index collection components in the index register.
[0056] To realize the acquisition of the database index information, it is not limited to configuring the second index collection component according to the application database type.
[0057] Taking the HTTP server as an example, the process of registering the monitoring plug-in in the target application is not limited to as shown in Figure 5 When the Java application starts to trigger the HTTP server to start, the process of registering the monitoring plug-in starts to execute.
[0058] S502, initialize the index register;
[0059] S504, register the JVM-related index collector component to the index register;
[0060] S506, determine the type of the JDBC database connection pool component used, so as to determine the index collector component corresponding to the application database type. The database connection pool component type is not limited to including: Tomcat JDBC, DBCP2, Druid, HikariCP, etc.
[0061] S508, load the database connection pool index collector component configuration;
[0062] S510, register the JDBC database connection pool index collector component to the index register;
[0063] S512, initialize the HTTP server and set the port number to be listened to. Determine the port for monitoring the performance index of the Java application from the HTTP server;
[0064] S514, initialize the HTTP request processor component;
[0065] S516, set the HTTP server context binding information, and bind the health check interface and the index query interface context. The context binding information corresponds to the query instruction, and the corresponding query instruction is determined through the context of the request. The query instruction includes health check and index query. The health check is used to query the running state of the application, and the index query is used to obtain the performance index;
[0066] S518, set the thread pool processor;
[0067] S520, the HTTP server is started in daemon mode, listens to a specified port, and receives an HTTP protocol request. The specified port is a port corresponding to the metric collection component, and the HTTP protocol request is a query request sent by the monitoring server.
[0068] As an optional implementation, the above-mentioned before listening to the query port further includes: determining a state instruction and a data instruction corresponding to the query port, wherein the state instruction is used to instruct to query state metric information of the target application, and the data instruction is used to instruct to query data metric information of the target application, and the data metric information includes attribute metric information and database metric information.
[0069] Optionally, the state instruction is not limited to be a bound request context, and a context configured for the query port is used, so that when the query request is received, the context in the query request is matched to determine whether the query request queries the application running state or the performance metric data. For example, the state instruction is configured as “ / - / healthy”, so that when “ / - / healthy” is matched in the context of the query request, it is determined that the application running state is to be returned. The data instruction is configured as “ / metrics”, so that when “ / metrics” is matched in the context of the query request, it is determined that the performance metric data is to be returned.
[0070] As an optional implementation, the above-mentioned determining the instruction type corresponding to the query request includes: determining the instruction type corresponding to the query request according to a query instruction carried in the query request, wherein the query instruction includes the state instruction and the data instruction.
[0071] Returning the target metric information corresponding to the metric type to the monitoring server through the query port includes: in a case where the metric type is a state type corresponding to the state instruction, returning state information indicating a running state of the target application through the query port; and in a case where the metric type is a data type corresponding to the data instruction, calling the first metric collection component and the second metric collection component through the metric register to return the obtained attribute metric information and database metric information to the monitoring server.
[0072] Optionally, in a case where it is determined to return the performance metric data corresponding to the data instruction, all registered metric collection components in the metric register are not limited to be obtained, and each metric collection component is sequentially called to obtain the performance metric data corresponding to the metric collection component. In a case where the performance metric data is multiple, the obtained multiple performance metric data is not limited to be encapsulated after data aggregation processing, and the encapsulated performance metric data is returned to the monitoring server. The encapsulation processing of the performance metric data is not limited here, and in a case where the query server is an HTTP server, the query server is not limited to encapsulate the performance metric data into a text format.
[0073] Taking a monitoring server as a Prometheus server, the application performance index monitoring interaction is not limited to the above-mentioned. The Prometheus server as a request end of the application performance monitoring server registers a monitoring plug-in in the application end, including an HTTP request processor, an index register, a JVM class index collector and a database connection pool index collector registered in the index register. A1, the Prometheus server initiates an HTTP request. The HTTP request is used to request monitoring of application performance. The HTTP request processor determines the corresponding query interface through the HTTP request context matching in the case of receiving the HTTP request. Figure 6
[0074] In the case of matching “ / - / healthy”, A2, the HTTP request processor determines the health check interface, and returns the index exposure service state normal information. The current running state of the application is fed back through the returned index information. In the case of matching “ / metrics”, A3, the HTTP request processor determines the query index data interface.
[0075] In the case of determining that the application index data needs to be returned, A4, the index data is obtained from the index register. The index register traverses the registered index collector in the case of receiving the instruction of obtaining the index data. Assuming that the JVM class index collector is traversed first, and then the database connection pool index collector is traversed, A5, the index register obtains the JVM index data from the JVM class index collector. A6, the JVM class index collector returns the JVM index data to the index register. A7, the index register obtains the database connection pool index data from the database connection pool index collector. A8, the database connection pool index collector returns the database connection pool index data to the index register.
[0076] In the case of traversing the index collector, the index register performs data aggregation on each index data, and executes A9 to return the aggregated index data to the HTTP request processor. The HTTP request processor receives the aggregated index data, executes A10 to return the application index data to the Prometheus server, and thus completes the acquisition of the application index data by the Prometheus server.
[0077] As an optional implementation, after the target index information corresponding to the index type is returned to the monitoring server through the query port, the above-mentioned further includes:
[0078] S1, processing the target index information to form an index chart corresponding to the target index information;
[0079] S2, displaying the index chart.
[0080] Optionally, in the case that the monitoring server obtains the target indicator information of the application, that is, the performance indicator data, it is not limited to interacting the performance indicator data with the monitoring system, so that the monitoring system processes the performance indicator data and displays it in the form of an indicator icon in the case of obtaining the performance indicator data, to realize visual display of application performance indicator data monitoring.
[0081] The monitoring system is not limited to being associated with the monitoring server to realize interaction of application performance indicators. For example, Grafana system is selected to correspond to the Prometheus server. It is not limited to configuring the data source of the monitoring server in the monitoring system to obtain the application performance indicator data received by the monitoring server.
[0082] As an optional implementation, after returning the target indicator information corresponding to the indicator type to the monitoring server through the query port, the method further includes: in the case that the indicator information included in the target indicator information exceeds the corresponding indicator threshold, displaying alarm information, wherein the alarm information is used to prompt the target application performance anomaly.
[0083] Optionally, the indicator threshold is configured in the monitoring system to automatically trigger alarm information in the case that the obtained application performance indicator data exceeds the indicator threshold, and display the alarm information to alert the application indicator anomaly.
[0084] The monitoring and display interaction of application performance indicator data is not limited to as shown in Figure 7 The application HTTP server is used to represent the monitoring plug-in registered in the application, Prometheus is used to represent that the used monitoring server is a Prometheus server, and Grafana is used to represent that the monitoring system is a Grafana system.
[0085] A1, the Prometheus server requests the application to expose the metrics interface address at a fixed time interval. The Prometheus server actively sends a performance indicator acquisition request to the application HTTP server.
[0086] A2, the application HTTP server returns the metrics data. In the case that the application HTTP server receives the query request sent by the Prometheus server, the application HTTP server obtains the metrics data and returns it to the Prometheus server.
[0087] A3, the Grafana system sends a query to the Prometheus server for the metrics data of the application. The Grafana system is configured with a monitoring panel for visualization, and is also configured with a data source connected to the Prometheus server to query the performance indicator data of the application from the Prometheus server, including JVM indicators, database connection indicators, and other indicator data. Upon obtaining the metrics data, the Grafana system displays the metrics data in the monitoring panel in the form of a chart, without limitation.
[0088] A4, the Prometheus server returns the corresponding metrics data.
[0089] A5, the user requests the Grafana system to query the database connection monitoring panel of the application.
[0090] A6, the Grafana system returns the corresponding database connection metrics data and displays the metrics data in the form of a chart.
[0091] A7, the user sets an alarm rule in the Grafana system to automatically alarm when the indicator reaches a certain threshold.
[0092] A8, the Grafana system sends an alarm information when the indicator triggers the alarm rule. The sending of the alarm information is not limited to being displayed in the monitoring panel to notify the user of the alarm information.
[0093] It should be noted that, for the foregoing method embodiments, in order to simply describe, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the action sequence described, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily necessary for the present application.
[0094] According to another aspect of the embodiments of the present application, an application performance monitoring device for implementing the above-mentioned application performance monitoring method is also provided. As shown in Figure 8 the device comprises:
[0095] The registration unit 802 is configured to register a monitoring plug-in in the target application, wherein the monitoring plug-in is internally provided with a query server, and the query server is used for monitoring and querying various performance indicators of the target application.
[0096] The monitoring unit 804 is configured to listen to a query port in the case that the query server is started, wherein the query port is a communication port for querying performance indicators in a plurality of communication ports of the query server.
[0097] The determining unit 806 is configured to determine the metric type corresponding to the query request in a case where the query port receives the query request sent by the monitoring server.
[0098] The returning unit 808 is configured to return the target metric information corresponding to the metric type to the monitoring server through the query port.
[0099] Optionally, the registering unit 802 includes:
[0100] The determining module is configured to determine the container configuration file of the monitoring plug-in according to the database type corresponding to the target application.
[0101] The loading module is configured to load the container configuration file to initialize the metric register of the monitoring plug-in in a container startup process of the monitoring plug-in, where the metric register is used to acquire metric information.
[0102] The registering module is configured to register the metric collection component in the metric register.
[0103] Optionally, the registering module includes:
[0104] The first registering module is configured to register the first metric collection component, where the first metric collection component is used to acquire attribute metric information of the target application.
[0105] The type module is configured to determine the second metric collection component corresponding to the target application according to the database type, where the second metric collection component is used to acquire database metric information associated with the target application.
[0106] The second registering module is configured to register the second metric collection component.
[0107] Optionally, the application performance monitoring device further includes a port unit configured to determine state instructions and data instructions corresponding to the query port before determining the query port, where the state instructions are used to instruct to query state metric information of the target application, and the data instructions are used to instruct to query data metric information of the target application, and the data metric information includes attribute metric information and database metric information.
[0108] Optionally, the application performance monitoring device is further configured to determine the instruction type corresponding to the query request according to a query instruction carried in the query request, where the query instruction includes the state instructions and the data instructions; in a case where the metric type is a state type corresponding to the state instructions, return state information indicating a running state of the target application through the query port; and in a case where the metric type is a data type corresponding to the data instructions, call the first metric collection component and the second metric collection component through the metric register, and return the acquired attribute metric information and database metric information to the monitoring server.
[0109] Optionally, the application performance monitoring device further comprises a display unit configured to process the target index information to form an index chart corresponding to the target index information after returning the target index information corresponding to the index type to the monitoring server through the query port, and display the index chart.
[0110] Optionally, the application performance monitoring device further comprises an alarm unit configured to display alarm information in a case where the index information included in the target index information exceeds the corresponding index threshold after returning the target index information corresponding to the index type to the monitoring server through the query port, wherein the alarm information is used to prompt that the target application performance is abnormal.
[0111] In the embodiment of the present application, the monitoring plug-in configured with the query server is registered in the target application, the query port for the performance index of the target application is listened to through the start of the query server, when the query request sent by the monitoring server is received at the query port, the monitoring plug-in acquires the corresponding performance index information of the target application by determining the index type corresponding to the query request, thereby achieving the purpose of the active monitoring and acquisition of the multiple performance indexes of the target application by the monitoring server through the way that the performance index information is fed back to the monitoring server through the query port, the query request of the monitoring server for actively pulling the performance index of the target application is received through the query server in the monitoring plug-in, the multiple performance indexes of the target application are acquired through the query port corresponding to the performance index provided by the query server, the technical effect that the performance indexes of the target application are flexibly and comprehensively monitored by the monitoring server is achieved, and the technical problem that the application performance monitoring is not comprehensive due to the poor flexibility of the application performance monitoring is solved.
[0112] According to another aspect of the embodiment of the present application, an electronic device for implementing the above-mentioned application performance monitoring method is further provided, which can be the terminal device or the server as shown in the drawings. Figure 1 As shown in the drawings, the electronic device comprises a memory 902 and a processor 904, the memory 902 stores a computer program, and the processor 904 is configured to execute the steps in any one of the method embodiments by the computer program. Figure 9
[0113] Optionally, in the embodiment, the electronic device can be located in at least one of the multiple network devices in the computer network.
[0114] Optionally, in the embodiment, the processor can be configured to execute the following steps by the computer program:
[0115] S1, register a monitoring plug-in in a target application, wherein the monitoring plug-in is internally provided with a query server, and the query server is used for monitoring and querying various performance indexes of the target application;
[0116] S2, in a case where the query server is started, listen to a query port, wherein the query port is a communication port of the query server for querying performance indexes;
[0117] S3, in a case where the query port receives a query request sent by a monitoring server, determine an index type corresponding to the query request;
[0118] S4, return target index information corresponding to the index type to the monitoring server through the query port.
[0119] Optionally, those skilled in the art can understand that, Figure 9 The structure shown is only schematic, and the electronic device can also be a smart phone (such as an Android phone, an IOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, or the like. Figure 9 It does not limit the structure of the electronic device. For example, the electronic device can further include more or fewer components (such as a network interface, etc.) than those shown in Figure 9 , or have a different configuration from Figure 9 .
[0120] The memory 902 can be used to store software programs and modules, such as program instructions / modules corresponding to the application performance monitoring method and device in the embodiments of the present application. The processor 904 executes various functional applications and data processing by running the software programs and modules stored in the memory 902, that is, implements the application performance monitoring method described above. The memory 902 can include a high-speed random access memory, and can also include a non-volatile memory, such as one or more magnetic storage devices, a flash memory, or other non-volatile solid-state memories. In some examples, the memory 902 can further include a memory remotely arranged with respect to the processor 904, which can be connected to the terminal through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The memory 902 can be used to store, but is not limited to, monitoring plug-ins, target index information, and the like. As an example, as shown in Figure 9 , the memory 902 can include, but is not limited to, the registration unit 802, the listening unit 804, the determination unit 806, and the return unit 808 in the application performance monitoring device described above. In addition, other module units in the application performance monitoring device described above can also be included, but are not limited to, which will not be described in detail in this example.
[0121] Optionally, the transmission device 906 is configured to receive or send data via a network. Examples of the network include a wired network and a wireless network. In an example, the transmission device 906 includes a network adapter (NIC), which can be connected to other network devices and routers through a network cable to communicate with the Internet or a local area network. In an example, the transmission device 906 is a radio frequency (RF) module, which is configured to communicate with the Internet in a wireless manner.
[0122] In addition, the electronic device further includes a display 908 configured to display the target index information, and a connection bus 910 configured to connect various module components in the electronic device.
[0123] In other embodiments, the terminal device or the server can be a node in a distributed system, and the distributed system can be a blockchain system. The blockchain system can be a distributed system formed by the plurality of nodes connected through network communication. The nodes can form a peer-to-peer (P2P) network, and any computing device, such as a server or a terminal, can become a node in the blockchain system by joining the P2P network.
[0124] According to an aspect of the present application, a computer program product or computer program is provided, which includes computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to enable the computer device to perform the method provided in any of the various optional implementation manners of the application performance monitoring aspect. The computer program is configured to execute the steps in any of the method embodiments when running.
[0125] Optionally, in the present embodiment, the computer readable storage medium can be configured to store a computer program for executing the following steps:
[0126] S1, registering a monitoring plug-in in a target application, wherein the monitoring plug-in is built-in with a query server, and the query server is configured to monitor and query various performance indexes of the target application;
[0127] S2, listening to a query port in a case where the query server is started, wherein the query port is a communication port of the query server for querying the performance indexes;
[0128] S3, in the case that the query port receives the query request sent by the monitoring server, determining the index type corresponding to the query request;
[0129] S4, returning the target index information corresponding to the index type to the monitoring server through the query port.
[0130] Optionally, in the embodiment, all or part of the steps in the various methods of the above-described embodiments can be completed by instructing the hardware related to the terminal device by a program, and the program can be stored in a computer readable storage medium, and the storage medium can include a flash disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, etc.
[0131] The serial numbers of the above-described embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
[0132] The integrated units in the above-described embodiments, if realized in the form of software function units and sold or used as independent products, can be stored in the above-described computer readable storage medium. Based on such understanding, the technical solutions of the present application or the whole or part of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions for causing one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0133] In the above-described embodiments of the present application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0134] In several embodiments provided in the present application, it should be understood that the disclosed client can be implemented by other ways. Among them, the above-described device embodiments are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed each other can be through some interfaces, indirect coupling or communication connection between units or modules, and can be electrical or other forms.
[0135] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0136] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0137] The above is only the preferred embodiment of the present application, and it should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.
Claims
1. An application performance monitoring method, characterized in that, include: Register a monitoring plugin in the target application, wherein the monitoring plugin has a built-in query server, which is used to monitor and query various performance indicators of the target application, and the monitoring plugin starts simultaneously with the startup of the target application. When the query server is started through the startup of the monitoring plugin, it listens on the query port, wherein the query port is the communication port used for querying performance indicators among the multiple communication ports of the query server. When the query port receives a query request sent by the monitoring server, the type of metric corresponding to the query request is determined. The target indicator information corresponding to the indicator type is returned to the monitoring server through the query port; The step of determining the instruction type corresponding to the query request includes: determining the instruction type corresponding to the query request based on the query instruction carried in the query request, wherein the query instruction includes a status instruction and a data instruction, the status instruction is used to indicate querying the status indicator information of the target application, and the data instruction is used to indicate querying the data indicator information of the target application, the data indicator information including attribute indicator information and database indicator information; Returning the target indicator information corresponding to the indicator type to the monitoring server through the query port includes: When the indicator type is a status type corresponding to the status instruction, status information indicating the running status of the target application is returned through the query port; When the indicator type is a data type corresponding to the data instruction, the first indicator collection component and the second indicator collection component are called through the indicator register to return the acquired attribute indicator information and the database indicator information to the monitoring server.
2. The method according to claim 1, characterized in that, Registering the monitoring plugin in the target application includes: The container configuration file of the monitoring plugin is determined based on the database type corresponding to the target application; During the container startup process of the monitoring plugin, the container configuration file is loaded to initialize the indicator register of the monitoring plugin, wherein the indicator register is used to obtain the indicator information; Register the indicator collection component in the indicator register.
3. The method according to claim 2, characterized in that, The step of registering the indicator collection component in the indicator register includes: Register the first indicator collection component, wherein the first indicator collection component is used to obtain the attribute indicator information of the target application; The second indicator collection component corresponding to the target application is determined according to the database type, wherein the second indicator collection component is used to obtain the database indicator information associated with the target application; Register the second indicator collection component.
4. The method according to claim 3, characterized in that, Before listening to the query port, it also includes: Determine the status command and data command corresponding to the query port.
5. The method according to claim 1, characterized in that, After returning the target indicator information corresponding to the indicator type to the monitoring server through the query port, the process also includes: The target indicator information is processed to form an indicator chart corresponding to the target indicator information; The indicator chart is displayed.
6. The method according to claim 1, characterized in that, After returning the target indicator information corresponding to the indicator type to the monitoring server through the query port, the process also includes: If any of the target metrics exceeds the corresponding threshold, an alarm message is displayed, which is used to indicate that the target application is experiencing performance abnormalities.
7. An application performance monitoring device, characterized in that, Used to perform the application performance monitoring method of claim 1.
8. A computer-readable storage medium comprising a stored program, characterized in that, When the program runs, it executes the method described in any one of claims 1 to 6.
9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 6 via the computer program.
Citation Information
Patent Citations
Plug-in-form-based cloud server performance collection management system
CN110275810A
Monitoring method and device
CN113688149A