CN112764990A - Target process monitoring method and device and computer equipment - Google Patents

Target process monitoring method and device and computer equipment Download PDF

Info

Publication number
CN112764990A
CN112764990A CN202110035630.2A CN202110035630A CN112764990A CN 112764990 A CN112764990 A CN 112764990A CN 202110035630 A CN202110035630 A CN 202110035630A CN 112764990 A CN112764990 A CN 112764990A
Authority
CN
China
Prior art keywords
index
target process
plug
type
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110035630.2A
Other languages
Chinese (zh)
Other versions
CN112764990B (en
Inventor
李闰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Ziroom Information Technology Co Ltd
Original Assignee
Beijing Ziroom Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Ziroom Information Technology Co Ltd filed Critical Beijing Ziroom Information Technology Co Ltd
Priority to CN202110035630.2A priority Critical patent/CN112764990B/en
Publication of CN112764990A publication Critical patent/CN112764990A/en
Application granted granted Critical
Publication of CN112764990B publication Critical patent/CN112764990B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method and a device for monitoring a target process and computer equipment, wherein the monitoring method comprises the following steps: determining a key class contained in the target process according to the content information of the target process; determining the index type of each index in the target process according to the key class; determining the type of the acquisition plug-in according to the index type; calling a collection plugin with a pre-declaration according to the plugin type to collect a corresponding index value in a target process; and monitoring the target process according to the acquired index value. By implementing the method, the corresponding index acquisition plug-in is determined by combining with the judgment of the key classes existing in the target process, and the corresponding index values are acquired by calling various index acquisition plug-ins declared in advance in the user process, so that the acquisition of various index items can be realized under the conditions of not invading user codes and not switching data sources, namely, various index acquisition modes are integrated, the user terminal can conveniently acquire various index values, and the high coverage of monitoring indexes is realized.

Description

Target process monitoring method and device and computer equipment
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for monitoring a target process and computer equipment.
Background
Any service can not be monitored and alarmed, and the service which is separated from the monitoring system can not be called as the true high-availability service. In practical application, the service needs to be monitored, problems can be accurately predicted and found, and operation and maintenance personnel are informed in time to ensure high availability of the service. The complete monitoring system comprises two aspects of monitoring and alarming: namely, whether each index of the service can be successfully collected and monitored, and whether the problem can be timely notified to operation and maintenance personnel after the problem occurs. In the related art, a monitoring system for a service realizes index monitoring in a mode of invading a user code, while a fixed index collection command exists in the monitoring mode of invading the user code, and indexes in various forms exist in the actual service and need to be collected, so that incomplete index collection is caused and user experience is seriously influenced.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for monitoring a target process, and a computer device, so as to solve the problem that in the related art, by using a monitoring manner of intruding a user code, index collection is incomplete and user experience is seriously affected due to index acquisition.
According to a first aspect, an embodiment of the present invention provides a method for monitoring a target process, including: determining a key class contained in a target process according to content information of the target process; determining the index type of each index in the target process according to the key class; determining the type of the acquisition plug-in according to the index type; calling a collection plugin with a pre-declaration according to the plugin type to collect a corresponding index value in the target process; and monitoring the target process according to the acquired index value.
With reference to the first aspect, in a first embodiment of the first aspect, the method further includes: determining the display type of the index according to the acquired index value; and registering the index and the display type thereof in an index management center.
With reference to the first aspect, in a second embodiment of the first aspect, the method further includes: receiving a data access request of a user, and displaying a corresponding index according to the data access request.
With reference to the first aspect, in a third implementation manner of the first aspect, the pre-declared collection plug-in includes: jvm an indicator insert; the calling a pre-declared acquisition plugin according to the plugin type to acquire a corresponding index value in the target process includes: and when the collection plug-in of the pre-declaration is determined to be an jvm index plug-in, calling a corresponding tool kit according to the identification information of the index, and collecting the corresponding index value by calling the tool kit.
With reference to the first aspect, in a fourth implementation manner of the first aspect, the pre-declared collection plug-in includes: acquiring plug-ins of abnormal log indexes; the calling a pre-declared acquisition plugin according to the plugin type to acquire a corresponding index value in the target process includes: when the acquisition plug-in is determined to be an abnormal log index acquisition plug-in, calling the abnormal log index acquisition plug-in to acquire all abnormal log information generated when the target process is executed; determining the content information of all abnormal logs according to the information of all abnormal logs; determining interception parameters according to the content information of all the abnormal log information; and acquiring corresponding index values according to the interception parameters.
With reference to the fourth embodiment of the first aspect, in the fifth embodiment of the first aspect, the method further includes: and counting the same abnormal log information according to all the abnormal log information, and determining the abnormal triggering times.
With reference to the third implementation manner of the first aspect, in a sixth implementation manner of the first aspect, the pre-declared collection plug-in includes: the system comprises a first acquisition plug-in unit, a second acquisition plug-in unit and a third acquisition plug-in unit, wherein the first acquisition plug-in unit comprises a dubbo index acquisition plug-in unit, a draid index acquisition plug-in unit and an actual custom index acquisition plug-in unit; the calling a pre-declared acquisition plugin according to the plugin type to acquire a corresponding index value in the target process includes: when the acquisition plug-in is determined to be the first acquisition plug-in and the index value is an interface time consumption class index, determining a key method which is corresponding to the key class and is used for acquiring the index; creating a preprocessing item and a post-processing item according to the key class and the key method; recording a first timestamp in the pre-processing item; recording a second timestamp in the post-processing item; and acquiring index values of the interface time consumption class according to the first time stamp and the second time stamp.
According to a second aspect, an embodiment of the present invention provides a monitoring system for a target process, including: the key class screening module is used for determining key classes contained in the target process according to the content information of the target process; the index type determining module is used for determining the index type according to the key class; the plug-in type determining module is used for determining the type of the collected plug-in according to the index type; the calling platform is used for calling a collection plug-in unit of a pre-declaration according to the plug-in unit type to collect the corresponding index value in the target process; and the monitoring module is used for monitoring the target process according to the acquired index value.
With reference to the second aspect, in a first embodiment of the second aspect, the system further comprises: the display type determining module is used for determining the display type of the index according to the acquired index value;
the registration module is used for registering the index and the display type thereof in an index management center;
the index management center is used for registering various indexes and corresponding display types thereof, receiving a data access request of a user, and displaying the corresponding indexes according to the data access request.
According to a third aspect, an embodiment of the present invention provides a computer device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the steps of the method for monitoring a target process according to the first aspect or any one of the embodiments of the first aspect.
According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the monitoring method for a target process described in the first aspect or any one of the embodiments of the first aspect.
The technical scheme of the invention has the following advantages:
the invention provides a method and a device for monitoring a target process and computer equipment, wherein the monitoring method comprises the following steps: determining a key class contained in the target process according to the content information of the target process; determining the index type of each index in the target process according to the key class; determining the type of the acquisition plug-in according to the index type; calling a collection plugin with a pre-declaration according to the plugin type to collect a corresponding index value in a target process; and monitoring the target process according to the acquired index value. By implementing the method and the device, the problems that index collection is incomplete and user experience is seriously influenced due to the fact that index values are collected only through a user code invasion mode and a fixed command in the related technology are solved, the corresponding index collection plug-in is determined by combining with the judgment of key classes existing in a target process, and corresponding index values are collected by calling various index collection plug-ins declared in advance in a user process, so that collection of various index items can be achieved under the conditions that user codes are not invaded and data sources are not switched, namely, various index collection modes are integrated, a user terminal can conveniently obtain various index values, and high coverage of monitoring indexes is achieved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a specific example of a monitoring method of a target process in an embodiment of the present invention;
fig. 2 is a flowchart of another specific example of a monitoring method of a target process in the embodiment of the present invention;
FIG. 3 is a block diagram illustrating a process of collecting abnormal log index data in a monitoring method for a target process according to an embodiment of the present invention;
FIG. 4 is a block diagram illustrating a process of collecting interface time consumption classes in a monitoring method for a target process according to an embodiment of the present invention;
FIG. 5 is a schematic block diagram of a specific example of a monitoring apparatus for a target process in an embodiment of the present invention;
FIG. 6 is a schematic block diagram of another specific example of a monitoring device of a target process in an embodiment of the present invention;
FIG. 7 is a diagram showing an exemplary embodiment of a computer device.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to realize high availability of the service, the service needs to be monitored, and the complete monitoring system comprises two aspects of monitoring and alarming, wherein on one hand, whether each index of the service can be successfully collected and monitored or not is judged, and on the other hand, whether the problem can be timely notified to a developer after the problem occurs in the service is judged. In fact, the purpose of monitoring the indicators is to enable developers to predict, discover, and quickly locate problems. The purpose of monitoring the existence is not only to help the developer quickly determine the tool for troubleshooting after the fault occurs, but also to prevent the fault from being generated. For example, when a Java Virtual Machine (JVM) process executes, garbage collection is frequently triggered, so that the response speed of a server is slow, the interface RT is increased, and the process is in an ascending trend; the problem can be pushed to developers by collecting JVM indexes such as garbage collection frequency and memory ratio, and the problem can be paid attention and repaired before interface load (RT) becomes high.
In order to realize quick positioning of problems existing in the user process, the method can be started from two aspects, namely selection of monitoring indexes on one hand and collection of the monitoring indexes on the other hand, developers can predict the problem generating position according to the collected monitoring index values, and can pay attention to, position and solve the problems in time.
In fact, whether the user process (service) is operating normally is not determined by a single index, but is often determined by the values of various monitoring indexes, for example, when the user process (service) is a JVM process, the monitoring indexes can be divided into the following three levels:
1. system level (host class index): a cpu load, a memory, a network io and a disk;
2. service level (container type index): cpu load, memory, tcp connection number, GC recovery condition, thread pool state, middleware (e.g., db connection pool), interface RT;
3. service level (custom index): and applying the self-defined service index.
In the related art, the problem that index collection is incomplete and user experience is seriously affected mainly by collecting index values only through a user code intrusion mode and a fixed command, for example, the problem that index collection is incomplete through a relatively fixed linux command, is provided.
An embodiment of the present invention provides a method for monitoring a target process, as shown in fig. 1, including:
step S11: determining a key class contained in the target process according to the content information of the target process; in this embodiment, the target process may be a user process or a service; the content information of the target process may be user code information; specifically, the key class existing in the user service may be extracted according to the code information of the user service.
Step S12: determining the index type of each index in the target process according to the key class; in the present embodiment, the index types of each index include: the method comprises the following steps of (1) obtaining an abnormal log index, a first index and an jvm index, wherein the first index comprises a dubbo index, a draid index and an actual custom index; specifically, the index type of the index which is present in the target process and needs to be collected may be determined according to whether the corresponding key class is present in the user process.
Step S13: determining the type of the acquisition plug-in according to the index type; in this embodiment, the collection plug-in includes: the system comprises an abnormal log index acquisition plug-in, a first acquisition plug-in and an jvm index plug-in, wherein the first acquisition plug-in comprises a dubbo index acquisition plug-in, a draid index acquisition plug-in and an Actuator custom index acquisition plug-in; specifically, according to the index type of the index needing to be collected in the target process, which collection plug-in needs to be called to collect the index value is determined. For example, when it is determined that the type of metric that needs to be collected is an jvm metric, it is determined that jvm metric plug-in needs to be invoked at this time.
Step S14: calling a collection plugin with a pre-declaration according to the plugin type to collect a corresponding index value in a target process; in this embodiment, the multiple acquisition plugins described in the above embodiments are declared in advance in the user process, and specifically, each acquisition plugin may be packaged to generate a packaging plugin in jar format, which is stored in a preset folder of the target process, and then the packaging plugin in jar format may be loaded into a preset Loader (classloader) through a Serial Peripheral Interface (SPI) interface, and at the same time, metadata information of each acquisition plugin is placed in a preset Proxy server (Interreceptor Proxy), so that each acquisition plugin is preloaded in the target process, for example, in a JVM process. Specifically, when the index is a JVM type index, the corresponding index value can be directly collected by calling JVM index plug-in.
Step S15: and monitoring the target process according to the acquired index value. In this embodiment, the collected index values may be a garbage collection frequency and a memory ratio, and it may be determined whether the target process has a problem according to a change in the collected garbage collection frequency and a change in the memory ratio, for example, when the garbage collection frequency is high or low and the memory ratio suddenly becomes high, it may be determined that the JVM process has a problem at this time.
The invention provides a monitoring method of a target process, which comprises the following steps: determining a key class contained in the target process according to the content information of the target process; determining the index type of each index in the target process according to the key class; determining the type of the acquisition plug-in according to the index type; calling a collection plugin with a pre-declaration according to the plugin type to collect a corresponding index value in a target process; and monitoring the target process according to the acquired index value. By implementing the method and the device, the problems that index collection is incomplete and user experience is seriously influenced due to the fact that index values are collected only through a user code invasion mode and a fixed command in the related technology are solved, the corresponding index collection plug-in is determined by combining with the judgment of key classes existing in a target process, and corresponding index values are collected by calling various index collection plug-ins declared in advance in a user process, so that collection of various index items can be achieved under the conditions that user codes are not invaded and data sources are not switched, namely, various index collection modes are integrated, a user terminal can conveniently obtain various index values, and high coverage of monitoring indexes is achieved.
As an alternative embodiment of the present invention, as shown in fig. 2, the monitoring method further includes:
step S16: determining the display type of the index according to the acquired index value; in the present embodiment, the display types of the index may include an increasable and decreasable type, a monotonically increasing type, a histogram type, and a data sample type.
Specifically, the incremental and decremental type (Gauge) may represent index data in which sample data may be changed arbitrarily, such as temperature and memory usage; it may also be used for "totals" that increase or decrease over time, e.g., the number of concurrent requests by the current third party. The monotonically increasing type (Count) may represent index data in which sample data is monotonically increased in the case where the monitoring system is not reset, for example, the number of requests for service, the number of completed tasks, the number of times of error occurrence, and the like.
Histogram type (Histogram) generally represents: the data is sampled over a period of time and counted into configurable buckets, which may be subsequently screened for samples by a specified interval, or counted for a total number of samples, and finally generally presented as histogram metric data, e.g., request duration or response size.
The data sample type (Summary) may represent a data sample result stored and displayed in quantiles over a period of time, e.g., a request duration or a response size, etc.
Step S17: and registering the indexes and the display types thereof in an index management center. In this embodiment, the index values and the corresponding display types may constitute index items, and the generated index items are registered in the index item management center one by one.
As an optional embodiment of the present invention, the monitoring method further comprises:
and receiving a data access request of a user, and displaying a corresponding index according to the data access request. In this embodiment, each metric item generated by the method described in the foregoing embodiment is registered in a metric item management center (Prometheus registry), and meanwhile, when the target process starts executing, that is, when the main program of the target process is preloaded, an Http service process (Http Server) is created, an Http service processor (Prometheus Handler) of an interface is set, and a port sequence number may be 5656. When the 5656 port of the target process is called, a call command (Http Request) is handed to the prometheus Handler for processing; further, the metrics (actually stored in Map) registered in the metric management center (prometheus registry) are converted into strings recognizable by prometheus in the Http service processor, and output to the Http return entity (Http Response). Thus, each time the pointer service-three-party open source service (prometheus-server) end initiates a pointer collection action (requesting the 5656 port of the main program), the pointer data is obtained.
As an optional embodiment of the invention, the pre-declared acquisition plugin comprises: jvm an indicator insert; correspondingly, the step S14, invoking a pre-declared collection plug-in according to the plug-in type to collect the corresponding index value in the target process, includes:
when the collection plug-in unit is determined to be the jvm index plug-in unit, the corresponding tool kit is called according to the identification information of the index, and the corresponding index value is collected by calling the tool kit. In this embodiment, when the index type to be collected is the jvm index, first, a representation type "jvm _ xxx" of jvm index is determined, and then a corresponding tool kit is determined according to the representation type of jvm index, for example, the tool kit may include: OperatingSystemMXBean, RuntimeMXBean, MemoryMXBean, MemoryPoolMXbeans, Garbagcollector MXbeans, PlatformMXbeans, Garbagcollector MXbeans, ThreadMXBean, ClassLoadingMXBean. Each of the above toolkits is stored in advance in the jvm process java.
As an optional embodiment of the invention, the pre-declared acquisition plugin comprises: acquiring plug-ins of abnormal log indexes; accordingly, as shown in fig. 3, in the step S14, the invoking a pre-declared collection plug-in according to the plug-in type to collect the corresponding index value in the target process includes:
step S21: when the acquisition plug-in is determined to be an abnormal log index acquisition plug-in, calling the abnormal log index acquisition plug-in to collect all abnormal log information generated when the target process is executed; in the embodiment, all the abnormal log information generated by the target process during execution is collected, including different log frames, such as log4j log frame, log4j2 log frame, and logback log frame.
Step S22: determining content information of all abnormal logs according to all abnormal log information; in this embodiment, content information in each abnormal log information is extracted, where the content information includes: log level information, stack information, trigger time information (i.e., log creation time information), Thread ID information (Thread ID), record information ID (trace ID), and user-defined metadata information.
Step S23: determining interception parameters according to the content information of all abnormal log information; in this embodiment, the interception parameter may be destination address information of the log frame, and specifically, the log destination address information (append) of the corresponding log frame is intercepted according to the content information of the abnormal log information.
Step S24: and acquiring corresponding index values according to the interception parameters. In this embodiment, intercepting the prefixes of lo4j, log4j2, and logback, and pushing the logs in an asynchronous manner after the prefixes output the logs to the user-specified applicator, may determine that the display type of the abnormal log indicator may be a Gauge type.
As an optional embodiment of the present invention, the monitoring method further comprises: and counting the same abnormal log information according to all the abnormal log information, and determining the abnormal triggering times. In this embodiment, the same abnormal log is aggregated to count the triggering times, and when the triggering times of the abnormal log exceed a preset threshold, an alarm prompt message may be generated, specifically, the alarm policy message may be defined by the user terminal itself, and includes: trigger conditions, alarm modes, alarm initiating users and alarm receiving users.
As an optional embodiment of the invention, the pre-declared acquisition plugin comprises: a first collection insert, the first collection insert comprising: a dubbo index acquisition plug-in, a draid index acquisition plug-in and an Actuator custom index acquisition plug-in; accordingly, as shown in fig. 4, in the step S14, the invoking a pre-declared collection plug-in according to the plug-in type to collect the corresponding index value in the target process includes:
step S31: when the acquisition plug-in is determined to be the first acquisition plug-in and the index value is the interface time consumption class index, determining a key method for acquiring the index corresponding to the key class; in this embodiment, specifically, when the acquisition plug-in is a dubbo acquisition plug-in, that is, the index type is dubbo-provider, and the index value is an interface time consumption index item, it is determined that the key class thereof is com.albaba.dubbo.rpc.proxy.abstract Proxy explorer, and the corresponding key method is invoke; when the index type is a drive type, the key class is com.
Step S32: creating a preprocessing item and a post-processing item according to the key class and the key method; in the embodiment, a pre-processing item (preprocessing) and a post-processing item (postprocessing) are created for the key method of the key class through a preset section creation method (javasest); specifically, when the index type is dubbo-provider and the index value is an interface time consumption index item, a preprocessing item is created before the execution of the key method, and a post-processing item is created after the execution of the key method.
Step S33: recording a first timestamp in the pre-processing item; in the present embodiment, the first time stamp T1 is recorded in a preprocessing item (preprocessing).
Step S34: recording the second timestamp in the post-processing item; in the present embodiment, the second time stamp T2 is recorded in the post-processing item (postprocess).
Step S35: and acquiring index values of the interface time consumption class according to the first time stamp and the second time stamp. In this embodiment, the difference between T2 and T1 is the interface time consumption, i.e. the collected index value. When the collected index value is the interface time consumption index, the display type of the index can be determined to be the Guage type, then the index item is registered to enter an index item management center, and the user terminal can directly take the index from the index management center when calling the index.
In an alternative embodiment, the monitoring method of the target process described in the above embodiment is described in detail in combination with the dubbo index.
Firstly, each acquisition plug-in can be packaged to generate a packaging plug-in jar format, the packaging plug-in is stored in a preset folder of a target process, then the packaging plug-in jar format can be loaded into a preset Loader (classloader) through a Serial Peripheral Interface (SPI), and meanwhile, metadata information of each acquisition plug-in is placed into a preset Proxy server (Intercaptor Proxy), so that each acquisition plug-in is loaded in the target process, for example, a JVM process in advance.
Secondly, an add Transformer (initialization) can be called in a preset method (pieman) for creating a preprocessing item and a post-processing item in a key method, that is, creating a preposed and postpositioned method of an entry point (Abstract explorer, Abstract Proxy explorer), distinguishing parameters used by different interceptors according to metadata information of a preset Proxy server, and calling a specific method of the interceptors in a reflection mode, that is, determining the interception parameters.
Secondly, after creating the interceptor, the display type of the corresponding indicator may be determined, for example, a prosoeus indicator of a Histogram type is created within the interception method, specifically, the indicator value range may be [0, 10, 20, 30, 50, 100, 200, 300, 500, 1000, 2000, 3000, 5000], so that the invoke time consumption is calculated after invoking the invoke method of the dubbo indicator each time, and the indicator of the Histogram display type is generated.
Secondly, registering the index, specifically, when the target process starts to execute, that is, when the main program of the target process is preloaded, creating http server, setting prometheus Handler of the interface, and the port serial number may be 5656. When the 5656 port of the target process is called, the http Request is handed to a prometheus Handler for processing; further, the pointer (actually stored by Map) registered in the Prometheus registry is converted into a character string recognizable by Prometheus in the handler, and is output to Http Response. Thus, each time the prometheus-server end initiates a pointer collection action (requesting the 5656 port of the main program), the pointer data will be obtained.
In particular, the Interreceptor Proxy must be loaded by the target Loader (App Class Loader), since the classLoader that loads the main program of the target process may be a subclass of App ClassLoader (e.g., Tomcat will create its own classLoader for each container, the parent of which is App ClassLoader).
According to the monitoring method of the target process, provided by the embodiment of the invention, the plug-in can be directly hung on the target process by combining with the java agent, code intrusion is not required, and no perception of a user side is realized; by combining the service index acquisition and reporting modes, richer indexes can be acquired; by combining with abnormal log pushing, richer index acquisition functions can be realized; by combining the determination of the display type of the index, various indexes (jvm, dubbo, cp, custom index and abnormal log) can be output by using a unified format, so that the user terminal can conveniently obtain and look up the indexes.
An embodiment of the present invention further provides a monitoring system for a target process, as shown in fig. 5, including:
the key class screening module 41 is configured to determine a key class included in the target process according to the content information of the target process; the detailed implementation can be referred to the related description of step S11 in the above method embodiment.
An index type determining module 42, configured to determine an index type according to the key class; the detailed implementation can be referred to the related description of step S12 in the above method embodiment.
A plug-in type determining module 43, configured to determine, according to the index type, a type of the collection plug-in; the detailed implementation can be referred to the related description of step S13 in the above method embodiment.
The calling platform 44 is used for calling the collection plug-in unit of the pre-declaration according to the plug-in unit type to collect the corresponding index value in the target process; the detailed implementation can be referred to the related description of step S14 in the above method embodiment.
And the monitoring module 45 is used for monitoring the target process according to the acquired index value. The detailed implementation can be referred to the related description of step S15 in the above method embodiment.
The monitoring device of the target process solves the problems that index collection is incomplete and user experience is seriously influenced due to the fact that index values are collected only through a user code intrusion mode and a fixed command in the related technology, determines a corresponding index collection plug-in unit by combining judgment of key classes existing in the target process, collects corresponding index values by calling various index collection plug-ins declared in advance in the user process, can achieve collection of various index items under the conditions of not invading user codes and not switching data sources, namely integrates various index collection modes, facilitates a user terminal to obtain various index values, and achieves high coverage of monitoring indexes.
As an optional embodiment of the present invention, the monitoring system further comprises:
a display type determining module 46, configured to determine a display type of the index according to the acquired index value; the detailed implementation can be referred to the related description of step S16 in the above method embodiment.
A registration module 47, configured to register the index and the display type thereof in the index management center; the detailed implementation can be referred to the related description of step S17 in the above method embodiment.
And the index management center 48 is used for registering various indexes and display types corresponding to the indexes, receiving a data access request of a user, and displaying the corresponding indexes according to the data access request.
An embodiment of the present invention further provides a computer device, as shown in fig. 6, the computer device may include a processor 51 and a memory 52, where the processor 51 and the memory 52 may be connected by a bus 50 or in another manner, and fig. 6 takes the example of connection by the bus 50.
The processor 51 may be a Central Processing Unit (CPU). The Processor 51 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or combinations thereof.
The memory 52 is a non-transitory computer readable storage medium, and can be used for storing non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the target process monitoring method in the embodiment of the present invention. The processor 51 executes various functional applications and data processing of the processor by running non-transitory software programs, instructions and modules stored in the memory 52, that is, implements the monitoring method of the target process in the above-described method embodiment.
The memory 52 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by the processor 51, and the like. Further, the memory 52 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 52 may optionally include memory located remotely from the processor 51, and these remote memories may be connected to the processor 51 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more modules are stored in the memory 52 and when executed by the processor 51 perform a method of monitoring a target process as in the embodiments of fig. 1-4.
The details of the computer device can be understood by referring to the corresponding descriptions and effects in the embodiments shown in fig. 1 to fig. 4, and are not described herein again.
The embodiment of the present invention further provides a non-transitory computer readable medium, where the non-transitory computer readable storage medium stores a computer instruction, and the computer instruction is used to enable a computer to execute the target process monitoring method described in any of the above embodiments, where the storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviation: HDD), or a Solid-State Drive (SSD); the storage medium may also comprise a combination of memories of the kind described above.
It should be understood that the above examples are only for clarity of illustration and are not intended to limit the embodiments. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. And are neither required nor exhaustive of all embodiments. And obvious variations or modifications therefrom are within the scope of the invention.

Claims (10)

1. A method for monitoring a target process, comprising:
determining a key class contained in a target process according to content information of the target process;
determining the index type of each index in the target process according to the key class;
determining the type of the acquisition plug-in according to the index type;
calling a collection plugin with a pre-declaration according to the plugin type to collect a corresponding index value in the target process;
and monitoring the target process according to the acquired index value.
2. The method of claim 1, further comprising:
determining the display type of the index according to the acquired index value;
and registering the index and the display type thereof in an index management center.
3. The method of claim 1, wherein the pre-declared collection plug-in comprises: jvm an indicator insert;
the calling a pre-declared acquisition plugin according to the plugin type to acquire a corresponding index value in the target process includes:
and when the collection plug-in of the pre-declaration is determined to be an jvm index plug-in, calling a corresponding tool kit according to the identification information of the index, and collecting the corresponding index value by calling the tool kit.
4. The method of claim 1, wherein the pre-declared collection plug-in comprises: acquiring plug-ins of abnormal log indexes;
the calling a pre-declared acquisition plugin according to the plugin type to acquire a corresponding index value in the target process includes:
when the acquisition plug-in is determined to be an abnormal log index acquisition plug-in, calling the abnormal log index acquisition plug-in to acquire all abnormal log information generated when the target process is executed;
determining the content information of all abnormal logs according to the information of all abnormal logs;
determining interception parameters according to the content information of all the abnormal log information;
and acquiring corresponding index values according to the interception parameters.
5. The method of claim 4, further comprising: and counting the same abnormal log information according to all the abnormal log information, and determining the abnormal triggering times.
6. The method of claim 3, wherein the pre-declared collection plug-in comprises: the system comprises a first acquisition plug-in unit, a second acquisition plug-in unit and a third acquisition plug-in unit, wherein the first acquisition plug-in unit comprises a dubbo index acquisition plug-in unit, a draid index acquisition plug-in unit and an actual custom index acquisition plug-in unit;
the calling a pre-declared acquisition plugin according to the plugin type to acquire a corresponding index value in the target process includes:
when the acquisition plug-in is determined to be the first acquisition plug-in and the index value is an interface time consumption class index, determining a key method which is corresponding to the key class and is used for acquiring the index;
creating a preprocessing item and a post-processing item according to the key class and the key method;
recording a first timestamp in the pre-processing item;
recording a second timestamp in the post-processing item;
and acquiring index values of the interface time consumption class according to the first time stamp and the second time stamp.
7. A system for monitoring a target process, comprising:
the key class screening module is used for determining key classes contained in the target process according to the content information of the target process;
the index type determining module is used for determining the index type according to the key class;
the plug-in type determining module is used for determining the type of the collected plug-in according to the index type;
the calling platform is used for calling a collection plug-in unit of a pre-declaration according to the plug-in unit type to collect the corresponding index value in the target process;
and the monitoring module is used for monitoring the target process according to the acquired index value.
8. The system of claim 7, further comprising:
the display type determining module is used for determining the display type of the index according to the acquired index value;
the registration module is used for registering the index and the display type thereof in an index management center;
the index management center is used for registering various indexes and corresponding display types thereof, receiving a data access request of a user, and displaying the corresponding indexes according to the data access request.
9. A computer device, comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the one processor to cause the at least one processor to perform the steps of the method of monitoring of a target process of any one of claims 1 to 6.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of monitoring a target process according to any one of claims 1 to 6.
CN202110035630.2A 2021-01-12 2021-01-12 Target process monitoring method and device and computer equipment Active CN112764990B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110035630.2A CN112764990B (en) 2021-01-12 2021-01-12 Target process monitoring method and device and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110035630.2A CN112764990B (en) 2021-01-12 2021-01-12 Target process monitoring method and device and computer equipment

Publications (2)

Publication Number Publication Date
CN112764990A true CN112764990A (en) 2021-05-07
CN112764990B CN112764990B (en) 2021-11-16

Family

ID=75701533

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110035630.2A Active CN112764990B (en) 2021-01-12 2021-01-12 Target process monitoring method and device and computer equipment

Country Status (1)

Country Link
CN (1) CN112764990B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113342373A (en) * 2021-05-31 2021-09-03 杭州沃趣科技股份有限公司 Implementation method and system for Prometheus universal collector

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11212837A (en) * 1998-01-26 1999-08-06 Nec Corp Method and device for language processing and storage medium recording language processing program
CN101207623A (en) * 2006-12-21 2008-06-25 国际商业机器公司 Method and system for monitoring resources servicing a business transaction
FR2997522A1 (en) * 2012-10-26 2014-05-02 Infovista Sa METHOD FOR A NETWORK MONITORING SYSTEM TO EVALUATE NON-INTRUSIVE USER RESUME AT THE LOAD OF A WEB PAGE
CN104268060A (en) * 2014-10-17 2015-01-07 浪潮电子信息产业股份有限公司 Data center monitoring system capable of customizing extended monitoring items
CN105490864A (en) * 2014-09-16 2016-04-13 钛马信息网络技术有限公司 Business module monitoring method based on OSGI
US20160196324A1 (en) * 2015-01-05 2016-07-07 Iguazio Systems Ltd. Service oriented data management and architecture
US20170124464A1 (en) * 2015-10-28 2017-05-04 Fractal Industries, Inc. Rapid predictive analysis of very large data sets using the distributed computational graph
CN107391744A (en) * 2017-08-10 2017-11-24 东软集团股份有限公司 Data storage, read method, device and its equipment
CN108363610A (en) * 2018-02-09 2018-08-03 华为技术有限公司 A kind of control method and equipment of virtual machine monitoring plug-in unit
CN109684219A (en) * 2018-12-26 2019-04-26 百度在线网络技术(北京)有限公司 System performance testing method, apparatus and storage medium
CN111459762A (en) * 2020-04-03 2020-07-28 杭州趣维科技有限公司 Monitoring and calling chain system and method based on byte code technology and CAT
CN112052078A (en) * 2019-06-06 2020-12-08 阿里巴巴集团控股有限公司 Time-consuming determination method and device
CN112181764A (en) * 2020-09-23 2021-01-05 南京南瑞继保电气有限公司 Kubernetes resource data monitoring method and device
CN112527599A (en) * 2020-12-15 2021-03-19 康键信息技术(深圳)有限公司 Intelligent monitoring method and device, electronic equipment and readable storage medium

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11212837A (en) * 1998-01-26 1999-08-06 Nec Corp Method and device for language processing and storage medium recording language processing program
CN101207623A (en) * 2006-12-21 2008-06-25 国际商业机器公司 Method and system for monitoring resources servicing a business transaction
FR2997522A1 (en) * 2012-10-26 2014-05-02 Infovista Sa METHOD FOR A NETWORK MONITORING SYSTEM TO EVALUATE NON-INTRUSIVE USER RESUME AT THE LOAD OF A WEB PAGE
CN105490864A (en) * 2014-09-16 2016-04-13 钛马信息网络技术有限公司 Business module monitoring method based on OSGI
CN104268060A (en) * 2014-10-17 2015-01-07 浪潮电子信息产业股份有限公司 Data center monitoring system capable of customizing extended monitoring items
US20160196324A1 (en) * 2015-01-05 2016-07-07 Iguazio Systems Ltd. Service oriented data management and architecture
US20170124464A1 (en) * 2015-10-28 2017-05-04 Fractal Industries, Inc. Rapid predictive analysis of very large data sets using the distributed computational graph
CN107391744A (en) * 2017-08-10 2017-11-24 东软集团股份有限公司 Data storage, read method, device and its equipment
CN108363610A (en) * 2018-02-09 2018-08-03 华为技术有限公司 A kind of control method and equipment of virtual machine monitoring plug-in unit
CN109684219A (en) * 2018-12-26 2019-04-26 百度在线网络技术(北京)有限公司 System performance testing method, apparatus and storage medium
CN112052078A (en) * 2019-06-06 2020-12-08 阿里巴巴集团控股有限公司 Time-consuming determination method and device
CN111459762A (en) * 2020-04-03 2020-07-28 杭州趣维科技有限公司 Monitoring and calling chain system and method based on byte code technology and CAT
CN112181764A (en) * 2020-09-23 2021-01-05 南京南瑞继保电气有限公司 Kubernetes resource data monitoring method and device
CN112527599A (en) * 2020-12-15 2021-03-19 康键信息技术(深圳)有限公司 Intelligent monitoring method and device, electronic equipment and readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
博客园_宜信技术: "宜信智能监控平台建设实践", 《HTTPS://WWW.CNBLOGS.COM/YIXINJISHU/P/11895974.HTML》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113342373A (en) * 2021-05-31 2021-09-03 杭州沃趣科技股份有限公司 Implementation method and system for Prometheus universal collector
CN113342373B (en) * 2021-05-31 2022-04-22 杭州沃趣科技股份有限公司 Implementation method and system for Prometheus universal collector

Also Published As

Publication number Publication date
CN112764990B (en) 2021-11-16

Similar Documents

Publication Publication Date Title
US10268564B2 (en) Dynamic tracing using ranking and rating
US9032254B2 (en) Real time monitoring of computer for determining speed and energy consumption of various processes
US11874755B2 (en) Systems, methods, and computer-readable media for analyzing intercepted telemetry events
EP3425524A1 (en) Cloud platform-based client application data calculation method and device
US20150032884A1 (en) Method and system for combining trace data describing multiple individual transaction executions with transaction processing infrastructure monitoring data
CN113760652B (en) Method, system, device and storage medium for full link monitoring based on application
US20230168986A1 (en) Systems, methods, and computer-readable media for analyzing intercepted telemetry events to generate vulnerability reports
CN112231130B (en) Method, system, equipment and medium for positioning fault according to log
CN112764990B (en) Target process monitoring method and device and computer equipment
US8554908B2 (en) Device, method, and storage medium for detecting multiplexed relation of applications
CN109740386B (en) Method and device for detecting static resource file
EP4160421A1 (en) Method and apparatus for obtaining browser running data, and storage medium
CN114116128B (en) Container instance fault diagnosis method, device, equipment and storage medium
CN114385457A (en) Application program data acquisition method, device, equipment and storage medium
CN114356764A (en) Software debugging method, device, equipment, system and medium
CN112256404B (en) Virtual machine introspection method, device, equipment and medium
CN111488230A (en) Method and device for modifying log output level, electronic equipment and storage medium
CN115002186B (en) Network information acquisition method and device, electronic equipment and readable storage medium
CN116737514B (en) Automatic operation and maintenance method based on log and probe analysis
CN112242027B (en) Express delivery cabinet fault processing method and device, fault processing equipment and storage medium
CN110244991B (en) Micro-service dependency analysis method and device
Carlyle et al. Practical support solutions for a workflow-oriented Cray environment
CN115002186A (en) Network information acquisition method and device, electronic equipment and readable storage medium
CN116318946A (en) Method and device for detecting memory type webpage backdoor attack and electronic equipment
CN116028300A (en) Index data collection method, device, server and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant