Non-intrusive process monitoring methods, devices, equipment, and storage media

By obtaining the monitoring program registration information of Java processes from the service list, remotely collecting and storing monitoring data, the problem of non-intrusive Java process monitoring is solved, and remote management of Java processes and historical data tracing are realized.

CN115422008BActive Publication Date: 2026-03-13CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-14
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing technologies cannot monitor Java processes non-intrusively, cannot obtain historical running information of Java processes, and are difficult to remotely manage Java processes on multiple nodes.

Method used

The registration information of the monitoring program corresponding to the target process is obtained by obtaining the pre-registered service list. The monitoring program is remotely invoked to collect the monitoring data of the target process and the data is stored in the specified storage space to achieve non-intrusive process monitoring.

Benefits of technology

It enables remote monitoring of Java processes and acquisition of historical running data, avoiding the need to restart Java processes and impacting performance, and improving the observability of Java processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115422008B_ABST
    Figure CN115422008B_ABST
Patent Text Reader

Abstract

This application provides a non-intrusive process monitoring method, apparatus, device, and storage medium, relating to the field of process monitoring technology. The method includes: responding to a monitoring command, determining the target process to be monitored; determining the monitoring program corresponding to the target process through a pre-registered service list, obtaining the registration information of the monitoring program, the service list including registration information for different monitoring programs; invoking the monitoring program according to its registration information, obtaining monitoring data of the target process through preset data acquisition commands in the monitoring program, and storing the monitoring data in a designated storage space. This application enables remote invocation of the corresponding monitoring program to collect and store monitoring data of the target process when monitoring of the target process is required, by obtaining the registration information of the monitoring program corresponding to the target process through a service list, thereby facilitating the subsequent acquisition of the historical running status of the target process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of process monitoring technology, and in particular to a non-intrusive process monitoring method, a non-intrusive process monitoring device, an electronic device, and a computer-readable storage medium. Background Technology

[0002] Because Java programs run on the JVM (Java Virtual Machine), and the JVM hides information such as GC (Garbage Collection) and dynamic memory allocation, understanding the runtime status of a Java process requires knowing its memory usage and GC activity. Currently, existing technologies for obtaining this information involve either attaching a Java agent probe package at Java application startup to acquire JVM runtime data, or attaching an external process to the target Java process's user space and executing commands to obtain the target Java process's memory usage and GC activity.

[0003] However, existing technologies have the following problems: If a Java application running stably online is to integrate existing technologies, the Java process needs to be restarted, which may cause some special applications to be lost; the Java agent method adds corresponding logic before and after the bytecode when the Java application starts, which essentially modifies the final compiled machine code, thereby introducing uncertainty into the original logic, which may lead to unexpected errors, and the use of the Java agent method will reduce the running performance of the original function; at the same time, existing technologies cannot accurately know the historical running status of a Java process over a certain period of time, and it is difficult to remotely monitor and manage Java processes on multiple nodes. Summary of the Invention

[0004] This application provides a non-intrusive process monitoring method, apparatus, device, and storage medium to solve the problem that existing technologies cannot non-intrusively monitor Java processes and cannot obtain the historical running status of Java processes.

[0005] The first aspect of this application provides a non-intrusive process monitoring method, comprising:

[0006] In response to monitoring commands, determine the target process to be monitored;

[0007] The monitoring program corresponding to the target process is determined by the pre-registered service list, and the registration information of the monitoring program is obtained. The service list includes the registration information corresponding to different monitoring programs.

[0008] The monitoring program is invoked based on its registration information. The monitoring data of the target process is obtained through preset data acquisition commands in the monitoring program, and the monitoring data is stored in the specified storage space.

[0009] Optionally, the method further includes:

[0010] Receive the registration request from the monitoring program and obtain the registration information of the monitoring program;

[0011] If the monitoring program meets the registration requirements, the registration information of the monitoring program is written into the service list.

[0012] The registration information of the monitoring program includes process information of at least one process to be monitored. The at least one process to be monitored runs in the same runtime space, and the monitoring program is deployed in the runtime space of the at least one process to be monitored.

[0013] Optionally, the registration information of the monitoring program includes:

[0014] The monitoring program includes its IP address, port ID, and process ID of at least one process to be monitored.

[0015] Optionally, the registration information of the monitoring program corresponding to the target process can be obtained through a pre-registered service list, including:

[0016] Obtain the process ID of the target process;

[0017] The registration information of the process ID of the target process included in the service list is determined to be the target registration information of the monitoring program corresponding to the target process;

[0018] The IP address and port ID corresponding to the monitoring program are obtained through the target registration information.

[0019] Optionally, the data acquisition command includes a virtual machine information acquisition command, and the monitoring data includes:

[0020] The virtual machine information corresponding to the target process;

[0021] The virtual machine information includes garbage collection information and thread exception status information.

[0022] Optionally, the virtual machine information collection commands include the Jstat command and the jstack command.

[0023] Optionally, after storing the monitoring data in a designated storage space, the method further includes:

[0024] Obtain the storage time of the monitoring data;

[0025] If the storage time of the monitoring data reaches the first storage time, the monitoring data is compressed.

[0026] If the storage time of the monitoring data reaches the second storage time, the monitoring data is deleted from the specified storage space;

[0027] The second storage time is greater than the first storage time.

[0028] A second aspect of this application provides a non-intrusive process monitoring device, comprising:

[0029] The instruction receiving module is configured to determine the target process to be monitored in response to monitoring instructions;

[0030] The data acquisition module is configured to determine the monitoring program corresponding to the target process through a pre-registered service list, and obtain the registration information of the monitoring program, wherein the service list includes the registration information corresponding to different monitoring programs;

[0031] The process monitoring module is configured to call the monitoring program based on the registration information of the monitoring program, obtain the monitoring data of the target process through the preset data acquisition commands in the monitoring program, and store the monitoring data in the specified storage space.

[0032] A third aspect of this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0033] The memory stores computer-executed instructions;

[0034] The processor executes computer execution instructions stored in the memory to implement the above-described method.

[0035] A fourth aspect of this application provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, are used to implement the above-described method.

[0036] A fifth aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0037] This application registers monitoring programs deployed on different nodes in a service list. When monitoring of a target process is required, the registration information of the monitoring program corresponding to the target process can be obtained through the service list. This allows for remote invocation of the corresponding monitoring program to collect and store the monitoring data of the target process, which is beneficial for obtaining the historical running status of the target process later. Attached Figure Description

[0038] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0039] Figure 1 A flowchart illustrating the non-intrusive process monitoring method provided in this application embodiment;

[0040] Figure 2 This is a target process monitoring logic diagram provided in the embodiments of this application;

[0041] Figure 3 A schematic block diagram of a non-intrusive process monitoring device provided in an embodiment of this application;

[0042] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0043] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0044] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for illustration and explanation of the embodiments of this application and are not intended to limit the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0045] It should be noted that if the embodiments of this application involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicators will also change accordingly.

[0046] Furthermore, if the embodiments of this application involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.

[0047] Before describing this application, the following terms will be explained:

[0048] JVM (Java Virtual Machine): The Java Virtual Machine is used to isolate the complexity of the underlying operating system and provide a runtime environment for Java programs.

[0049] GC (Garbage Collection): Garbage collection. Java is a language with implicit garbage collection. Unlike C++, users do not need to worry about garbage memory reclamation.

[0050] Non-intrusive: Whether it is explicit instrumentation in the code or code injection into interpreted and semi-compiled languages, it is intrusive to the source code. Completely non-intrusive means that there is no logical modification to the source code at all.

[0051] Observability refers to the ability to measure the internal state of a system by examining its output metrics. If the current operating state of a system can be inferred solely from the output data, then the system is considered observable.

[0052] Service Registry: The service registry is a core component for service-oriented management, similar to a directory service. It is mainly used to store storage information, such as URL strings and routing information.

[0053] Prometheus: Prometheus is an open-source monitoring solution for collecting and aggregating metrics as time-series data, serving as both a data store and a data aggregator.

[0054] Grafana: An open-source application for visualizing large amounts of measurement data, serving as a dashboard for displaying metric data.

[0055] like Figure 1 As shown, in the first aspect of this application, a non-intrusive process monitoring method is provided, comprising:

[0056] S100: In response to a monitoring command, determine the target process to be monitored;

[0057] S200. Determine the monitoring program corresponding to the target process through the pre-registered service list, and obtain the registration information of the monitoring program. The service list includes the registration information corresponding to different monitoring programs.

[0058] S300: Based on the registration information of the monitoring program, the monitoring program is invoked, and the monitoring data of the target process is obtained through the preset data acquisition commands in the monitoring program, and the monitoring data is stored in the specified storage space.

[0059] Thus, by registering the monitoring programs deployed on different nodes in the service list, this application allows the registration information of the monitoring program corresponding to the target process to be obtained through the service list when monitoring of the target process is required. This enables remote invocation of the corresponding monitoring program to collect monitoring data of the target process and store the monitoring data, which is beneficial for obtaining the historical running status of the target process in the future.

[0060] Specifically, the method in this embodiment is applied to a server. A monitoring program is pre-deployed on each node terminal to monitor the Java processes of the corresponding nodes. The monitoring program can execute monitoring of the corresponding Java process according to the call instructions from the server and return monitoring data to the server. When monitoring a specific Java process is required, the server can find out which node the Java process is running on and which monitoring program needs to be called to obtain its monitoring data by querying the service list based on the process's identifier. For example, each monitoring program can be pre-registered with the server. The server generates a service list based on the registration information of each monitoring program and sorts the registration information of each monitoring program in the service list according to registration time or node address. In one specific instance of this embodiment, the registration information of the monitoring program may include unique process identifiers for all Java processes running on the node corresponding to the monitoring program. Thus, after receiving a monitoring instruction, the server can query the service list for registration information including the process identifier of the target Java process, thereby determining the monitoring program to be invoked and calling that monitoring program based on the registration information to obtain the corresponding monitoring data. In another specific instance of this embodiment, a correspondence between all Java processes and their corresponding monitoring programs can be pre-established. For example, an index table can be created linking the process identifiers of each Java process to the program identifiers of the monitoring program. The program identifier of the monitoring program can be the registration information identifier in the service list, or it can be a parameter from the registration information, such as the IP address of the node where the monitoring program is deployed. This way, after receiving a monitoring instruction, the server can find the corresponding monitoring program based on the process identifier index of the target Java process and execute the corresponding monitoring instruction. By registering the monitoring programs deployed on each node terminal with a remote server, the server can call the corresponding monitoring program based on the target Java process to collect monitoring data, thus achieving remote monitoring of Java processes running on different nodes. In this embodiment, after obtaining the monitoring data, the server also stores the obtained monitoring data in the database according to the process identifier of the Java process, thereby enabling the observability of the Java process and tracing the historical operation of the Java process.

[0061] In this embodiment, the registration method for the monitoring program includes: receiving a registration request from the monitoring program and obtaining the registration information of the monitoring program; if it is determined that the monitoring program meets the registration conditions, writing the registration information of the monitoring program into the service list; the registration information of the monitoring program includes process information of at least one process to be monitored, at least one process to be monitored running in the same runtime space, and the monitoring program being deployed in the runtime space of at least one process to be monitored.

[0062] like Figure 2 As shown, this embodiment builds a registry center on the server based on Consul to manage the registration information of monitoring programs. Through the Prometheus auto-discovery strategy, it pulls the service list from Consul and obtains the IP information of all node terminals. Consul is a clustered environment typically used to manage service discovery and configuration management in microservice architectures. In this embodiment, the server acts as the server of the Consul cluster, and each node terminal is a node in the Consul cluster, thereby enabling the monitoring program to register with the registry center and generate service lists, etc. Prometheus is an existing open-source monitoring solution that can be used to collect and aggregate metrics as time-series data. The specific deployment methods of Consul and Prometheus are existing technologies and are not limited here. In this embodiment, the monitoring program is deployed on the same runtime space, i.e., the same node terminal, of the Java processes to be monitored. When registering, the monitoring program first sends a registration request to the registration center. This registration request includes the monitoring program's registration information, which at least includes the IP address and port ID of the node where the monitoring program is deployed, and the process ID of at least one process to be monitored. The process ID of the process to be monitored can be the URL information or process number of a Java process, and the registration information can include the process IDs of multiple Java processes. The registration center receives the registration request and determines whether it is valid. For example, the registration center can determine whether the monitoring program meets the registration conditions by checking if the IP address in the registration request belongs to a valid IP address range; this is not limited here. If the registration center determines the registration request is valid, it writes the corresponding registration information into the service list. For example, each service in the service list includes a registration information ID and the corresponding registration information, so that when the server receives a monitoring command, it can quickly index the corresponding monitoring program based on the process ID of the target process. To achieve observability of the target process, the server in this embodiment also deploys Grafana to display the acquired monitoring data in real time.

[0063] The process involves obtaining the registration information of the monitoring program corresponding to the target process through a pre-registered service list. This includes: obtaining the process ID of the target process; determining that the registration information in the service list containing the process ID of the target process is the target registration information of the monitoring program corresponding to the target process; and obtaining the IP address and port ID of the monitoring program through the target registration information. Specifically, the server can receive external monitoring commands. For example, users can manually input or select a specified Java process through a human-computer interaction interface to generate monitoring commands for that specific Java process. Alternatively, the server can pre-determine the target Java process to be monitored and automatically generate monitoring commands for the target Java process within a pre-determined data collection period at a pre-determined data collection frequency. For example, it can be set to collect monitoring data for target processes A and B at a frequency of 5 minutes per session from 0:00 to 9:00 every day, and collect monitoring data for target processes C and D at a frequency of 2 minutes per session from 9:00 to 24:00 every day. Based on the process ID of the target process in the monitoring command, the server searches the service list for registration information containing that process ID, obtains the IP address and port ID from the corresponding registration information, determines the corresponding monitoring program based on the obtained IP address and port ID, and calls the pre-deployed monitoring program to obtain the monitoring data of the target process.

[0064] In this embodiment, the data acquisition commands include virtual machine information acquisition commands, and the monitoring data includes: virtual machine information corresponding to the target process; the virtual machine information includes garbage collection information and thread exception status information. The virtual machine information acquisition commands include the Jstat command and the jstack command. Jstat, short for "Java Virtual Machine Statistics monitoring tool," is a command-line utility included in the JDK. The jstat command can obtain JVM data generated during the runtime of a Java process. Jstat primarily utilizes JVM built-in instructions to monitor the resources and performance of Java applications in real time, including monitoring heap memory and garbage collection status, as well as class loading and compiler monitoring. The monitoring data obtained by the Jstat command is mapped from a shared file to memory using mmap. This shared file stores JVM runtime metrics for the Java process, such as garbage collection information and thread exception status information. Typically, the JVM updates the shared memory value every 50ms. Since Jstat reads the corresponding memory value (JVM data) by reading the shared memory, it can quickly obtain the monitoring data of the target process without modifying the target process's code, achieving non-intrusive monitoring of the target process. Understandably, the monitoring program can also obtain load information from the node terminals. This load information may include CPU usage information such as CPU utilization and CPU load, memory usage information such as memory usage, remaining memory, and virtual memory swap space, network traffic information such as sending and receiving traffic, and disk read / write information such as write speed and read speed. Specifically, the monitoring program can use the `iostat` command to view CPU usage, network card information, and disk usage, and the `free` command to display the amount of unused and used memory, as well as the memory buffers used by the kernel. These details are not limited here.

[0065] The monitoring program in this embodiment can be developed using the Golang or Rust language. It runs in the user space of the target Java process. The monitoring program accepts server calls by exposing a specific HTTP interface. The server can accurately locate the corresponding HTTP interface of the monitoring program based on the obtained IP address and port ID, and then call the monitoring program through that interface. Each time the interface is called, the corresponding Jstat command is executed using the exec package to obtain the monitoring data of the target process, i.e., the JVM running information of the target process at the current moment. Furthermore, when monitoring the running status of the target process, there is no need to restart the target process, thus achieving completely non-intrusive monitoring. Additionally, this embodiment integrates clients of service registration middleware such as Eureka, Consul, and ETCD within the monitoring program, enabling the registration of information such as IP address and port ID with the registry center.

[0066] For each target process, the server stores the collected monitoring data in a designated location in the database according to the collection time, thus forming historical JVM information data for each target process. This allows for diagnosis of the cause of the Java process's failure by using its historical JVM information after an abnormal crash. For each Java process to be monitored, since real-time data is typically acquired, to reduce data volume and save storage space, this embodiment stores the monitoring data in a designated storage space. The method further includes: obtaining the storage time of the monitoring data; if the storage time of the monitoring data reaches a first storage time, compressing the monitoring data; if the storage time of the monitoring data reaches a second storage time, deleting the monitoring data from the designated storage space; where the second storage time is greater than the first storage time. In this embodiment, the storage time of the monitoring data of each target process can be monitored periodically. For example, the storage time of all current monitoring data of target process A can be obtained from the database. For instance, if the storage time of monitoring data 1 of target process A is January 1st and the current time is January 5th, and the preset first storage time is 7 days, the storage time has not reached the first storage time, indicating that the data can reflect the recent operating status of target process A and plays an important role in the abnormal diagnosis of target process A. Therefore, monitoring data 1 is not processed. If the storage time of monitoring data 1 of target process A is January 1st and the current time is January 10th, the storage time has reached the first storage time, indicating that the data can reflect the operating status of target process A to a certain extent and plays an important role in the abnormal diagnosis of target process A. While diagnosing anomalies in process A has some value, its importance is lower than that of data whose storage time has not reached the first storage time limit. In this case, existing compression algorithms can be used to compress monitoring data 1. If the storage time of monitoring data 1 for target process A is January 1st, the current time is January 20th, and the preset second storage time is 15 days, its storage time has not reached the second storage time limit, indicating that the data has been stored for a relatively long time and can no longer reflect the recent operating status of target process A. This data has very low importance for diagnosing anomalies in target process A. In order to avoid occupying too much storage space and save storage resources, monitoring data 1 is deleted from the database. This ensures that the monitoring data can effectively reflect the operating status of the target process while saving data storage resources.

[0067] like Figure 3As shown, a second aspect of this application provides a non-intrusive process monitoring device, comprising: an instruction receiving module configured to determine a target process to be monitored in response to a monitoring instruction; a data acquisition module configured to determine the monitoring program corresponding to the target process through a pre-registered service list, and acquire the registration information of the monitoring program, wherein the service list includes registration information corresponding to different monitoring programs; and a process monitoring module configured to call the monitoring program based on the registration information of the monitoring program, acquire monitoring data of the target process through a preset data acquisition command in the monitoring program, and store the monitoring data in a specified storage space.

[0068] In some specific instances, the monitoring device also includes: a registration module, configured to receive registration requests from monitoring programs and obtain registration information of the monitoring programs; and, if it is determined that the monitoring programs meet the registration conditions, to write the registration information of the monitoring programs into the service list; the registration information of the monitoring programs includes process information of at least one process to be monitored, at least one process to be monitored running in the same runtime space, and the monitoring program is deployed in the runtime space of at least one process to be monitored.

[0069] In some specific instances, the registration information of the monitoring program includes: the IP address of the monitoring program, the port ID, and the process ID of at least one process to be monitored.

[0070] In some specific instances, the data acquisition module is configured to: obtain the process ID of the target process; determine the registration information of the monitoring program corresponding to the target process as the registration information of the service list that includes the process ID of the target process; and obtain the IP address and port ID of the monitoring program through the target registration information.

[0071] In some specific instances, data acquisition commands include virtual machine information acquisition commands, and the monitored data includes: virtual machine information corresponding to the target process; virtual machine information includes garbage collection information and thread abnormal status information.

[0072] In some specific instances, virtual machine information collection commands include the Jstat command and the jstack command.

[0073] In some specific instances, the monitoring device also includes: a storage module configured to acquire the storage time of monitoring data; if the storage time of the monitoring data reaches a first storage time, compress the monitoring data; if the storage time of the monitoring data reaches a second storage time, delete the monitoring data from the specified storage space; the second storage time is greater than the first storage time.

[0074] The non-intrusive process monitoring device provided in this application embodiment can be used to execute the technical solution of the non-intrusive process monitoring method in the above embodiment. Its implementation principle and technical effect are similar, and will not be repeated here.

[0075] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software via processing elements; they can be fully implemented in hardware; or some modules can be implemented by processing elements calling software, while others are implemented in hardware. For example, the data acquisition module can be a separate processing element, or it can be integrated into a chip in the above device. Alternatively, it can be stored as program code in the memory of the above device, and its functions can be called and executed by a processing element. The implementation of other modules is similar. Moreover, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed through integrated logic circuits in the hardware of the processor element or through software instructions.

[0076] A third aspect of this application provides an electronic device, including: a processor and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the above-described method.

[0077] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4 As shown, the electronic device may include: transceiver 121, processor 122, and memory 123.

[0078] Processor 122 executes computer execution instructions stored in memory, causing processor 122 to perform the scheme in the above embodiments. Processor 122 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0079] The memory 123 is connected to the processor 122 via the system bus and completes communication between them. The memory 123 is used to store computer program instructions.

[0080] Transceiver 121 can be used to obtain the task to be run and its configuration information.

[0081] The system bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in the diagram, but this does not indicate that there is only one bus or one type of bus. Transceivers are used to enable communication between database access devices and other computers (e.g., clients, read-write libraries, and read-only libraries). Memory may include random access memory (RAM) and may also include non-volatile memory.

[0082] The electronic device provided in this application embodiment can be the terminal device described in the above embodiments.

[0083] This application also provides a chip for executing instructions, which is used to execute the task scheduling method described in the above embodiments.

[0084] A fourth aspect of this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the above-described method.

[0085] A fifth aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0086] In summary, this application can be applied to scenarios where Java programs malfunction and troubleshooting is hindered, potentially due to memory allocation or GC issues; where the target Java program has crashed, making it impossible to obtain memory or GC data using traditional node terminal login methods, thus hindering the reproduction of the Java process's execution; or where it is necessary to monitor the running status of Java programs at any time, such as core programs like Kafka, Hadoop, and Flink; or where Java applications that cannot be restarted to obtain observability, such as Kafka, Hadoop, and Flink, require only manual startup of the monitoring program in the user space of the target Java program by maintenance personnel, without restarting the original Java program. This application obtains monitoring data of the target Java process in a completely non-intrusive manner, without substantially intruding on the original logic of the target Java process, and has no impact on the performance of the Java application. This application also manages the monitoring of each Java process by building a registry center, writing the registration information of each monitoring program into a service list. By reading the registration information in the service list, the monitoring nodes of Java processes can be automatically discovered without manual configuration. Meanwhile, this application achieves Java process observability by regularly maintaining monitoring data of Java processes and compressing or deleting the monitoring data based on its storage time. This ensures that the stored monitoring data effectively reflects the running status of Java processes while also effectively saving storage resources.

[0087] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0088] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A non-intrusive process monitoring method, characterized in that, include: In response to monitoring commands, determine the target process to be monitored; The monitoring program corresponding to the target process is determined by the pre-registered service list, and the registration information of the monitoring program is obtained. The service list includes the registration information corresponding to different monitoring programs. The monitoring program is invoked based on its registration information, and monitoring data of the target process is obtained through preset data acquisition commands in the monitoring program. The monitoring data is then stored in a specified storage space. The registration information of the monitoring program includes process information of at least one process to be monitored, the at least one process to be monitored runs in the same runtime space, and the monitoring program is deployed in the runtime space of the at least one process to be monitored. The registration information of the monitoring program includes: The monitoring program includes its IP address, port ID, and process ID of at least one process to be monitored. The registration information of the monitoring program corresponding to the target process is obtained through the pre-registered service list, including: Obtain the process ID of the target process; The registration information of the process ID of the target process included in the service list is determined to be the target registration information of the monitoring program corresponding to the target process; The IP address and port ID corresponding to the monitoring program are obtained through the target registration information.

2. The non-intrusive process monitoring method according to claim 1, characterized in that, The method further includes: Receive the registration request from the monitoring program and obtain the registration information of the monitoring program; If the monitoring program meets the registration requirements, the registration information of the monitoring program is written into the service list.

3. The non-intrusive process monitoring method according to claim 1, characterized in that, The data acquisition commands include virtual machine information acquisition commands, and the monitoring data includes: The virtual machine information corresponding to the target process; The virtual machine information includes garbage collection information and thread exception status information.

4. The non-intrusive process monitoring method according to claim 3, characterized in that, The virtual machine information collection commands include the Jstat command and the jstack command.

5. The non-intrusive process monitoring method according to claim 1, characterized in that, After storing the monitoring data in the designated storage space, the method further includes: Obtain the storage time of the monitoring data; If the storage time of the monitoring data reaches the first storage time, the monitoring data is compressed. If the storage time of the monitoring data reaches the second storage time, the monitoring data is deleted from the specified storage space; The second storage time is greater than the first storage time.

6. A non-intrusive process monitoring device, employing the non-intrusive process monitoring method as described in any one of claims 1-5, characterized in that, The device includes: The instruction receiving module is configured to determine the target process to be monitored in response to monitoring instructions; The data acquisition module is configured to determine the monitoring program corresponding to the target process through a pre-registered service list, and obtain the registration information of the monitoring program, wherein the service list includes the registration information corresponding to different monitoring programs; The process monitoring module is configured to call the monitoring program based on the registration information of the monitoring program, obtain the monitoring data of the target process through the preset data acquisition commands in the monitoring program, and store the monitoring data in the specified storage space.

7. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-5.

9. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1-5.

Citation Information

Patent Citations

  • Method for monitoring software running state

    CN101996106A

  • Virtual machine process monitoring method and related device

    CN114327775A