Index monitoring method, device, computer equipment and storage medium

By link tracking and packaging enhancement of the request messages of the target service on the local server, performance data is obtained and processed in real time, the problem of indicator monitoring lag in traditional technology is solved, and real-time performance analysis is achieved.

CN118227447BActive Publication Date: 2025-08-29BEIJING APAKOLAN TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410635549.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-22
Publication Date
2025-08-29
Estimated Expiration
2044-05-22

AI Technical Summary

Technical Problem

In traditional technology, the target server generates a full log and sends it to the monitoring server for performance analysis, resulting in lag in metric monitoring and cannot achieve immediacy.

Method used

The local server's modular monitoring component link tracking and packaging enhancement of the request messages of the target service, obtain performance data in real time, and process data according to preset evaluation rules to generate target indicator information.

Benefits of technology

Realize instant performance monitoring of target services, avoiding the delay in the generation and sending of full logs, and ensuring the immediacy and accuracy of metric monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118227447B_ABST
    Figure CN118227447B_ABST
Patent Text Reader

Abstract

The present application relates to an indicator monitoring method, apparatus, computer equipment, storage medium, and computer program product. The method comprises: performing link tracking on a request message of a target service through a modular monitoring component in a local server; during the link tracking process of the request message, packaging and enhancing the target object executing the request message based on the modular monitoring component; obtaining real-time performance data generated by each target object executing the target service in the request message transmission link; processing the real-time performance data according to preset evaluation rules to obtain target indicator information, and performing performance analysis on the target service based on the target indicator information. The use of this method can improve the immediacy of indicator monitoring of the target service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of server operation and maintenance technology, and in particular to an indicator monitoring method, apparatus, computer equipment, storage medium, and computer program product. Background Art

[0002] With the development of the distributed systems field, a series of technologies for monitoring and tracing distributed systems have emerged, such as Perf-Component (Performance Component), which can help development teams detect problems in a timely manner and take appropriate measures.

[0003] In traditional technology, the target server needs to generate full logs for all components and then send the full log data generated during the operation of the target service to the monitoring server. The monitoring server transmits the collected log data to the storage system on the monitoring server side. In the monitoring server, according to the log analysis tool, the log analysis of the target server is performed regularly at preset time intervals to obtain various indicators of the target service and issue alarms based on the indicators.

[0004] However, in current traditional technologies, the target server needs to send log data to the monitoring server after generating full logs of all components, and perform performance analysis on the target service at preset time intervals in the monitoring server. Since log generation takes a certain amount of time and sending full logs also takes a certain amount of time, there is a lag in the indicator monitoring of the target service. Summary of the Invention

[0005] Based on this, it is necessary to provide an indicator monitoring method, device, computer equipment, computer-readable storage medium and computer program product to address the above technical problems.

[0006] In a first aspect, the present application provides an indicator monitoring method, comprising:

[0007] Track the request message of the target service through the modular monitoring component in the local server;

[0008] In the link tracing process of the request message, packaging and enhancing the target object executing the request message based on the modular monitoring component;

[0009] Acquire real-time performance data generated by each target object executing the target service in the request message transmission link;

[0010] The real-time performance data is processed according to preset evaluation rules to obtain target indicator information, and performance analysis of the target service is performed based on the target indicator information.

[0011] In one embodiment, the real-time performance data includes system performance data and component performance data, and the component performance data includes thread pool performance data and / or Feign performance data and / or SQL execution performance data and / or Redis command execution performance data and / or RocketMq performance data.

[0012] In one embodiment, the link tracking of the request message of the target service by the modular monitoring component in the local server includes:

[0013] Obtaining a request message for the target service;

[0014] The request message is marked, and a link is tracked on the marked request message through a modular monitoring component.

[0015] In one embodiment, during the link tracing process of the request message, packaging and enhancing the target object executing the request message based on the modular monitoring component includes:

[0016] During the link tracing process of the request message, based on the target components transmitted by the request message in the modular monitoring component, the request message is respectively component-tagged and the performance monitoring task is injected into the target object created by each target component.

[0017] In one embodiment, the real-time performance data includes component real-time performance data and system real-time performance data; and obtaining the real-time performance data generated by each target object executing the target service in the request message transmission link includes:

[0018] Determining a target component in the modular monitoring component according to the performance indicator to be monitored;

[0019] Based on the component tag corresponding to the request message and the performance monitoring task included in the target component, obtaining the current real-time performance data of the component;

[0020] The current real-time performance data of the system is obtained based on the modular monitoring components and hardware performance counters.

[0021] In one embodiment, when the performance indicator to be monitored includes a thread pool performance indicator, in the link tracing process of the request message, packaging and enhancing the target object that executes the request message based on the modular monitoring component includes:

[0022] Intercepting the creation of each target object corresponding to the request message, and determining whether each target object includes a thread pool object;

[0023] In the case where the thread pool object is included in each target object, the target object is replaced with a packaged and enhanced target object according to the modular monitoring component; the packaged and enhanced target object includes a thread pool tag and a thread pool monitoring task in a thread pool monitoring tool;

[0024] The acquiring of real-time performance data generated by each target object executing the target service in the request message transmission link includes:

[0025] According to the thread pool monitoring task, obtaining the thread pool real-time performance data carried by the request message when it is transmitted in the thread pool component;

[0026] The real-time performance data of the thread pool is associated with the thread pool performance index according to the thread pool tag to obtain real-time performance data for implementing the target service.

[0027] In one embodiment, the processing of the real-time performance data according to preset evaluation rules to obtain target indicator information includes:

[0028] Performing data conversion on the real-time performance data to obtain initial indicator information in a target format;

[0029] According to the preset evaluation rules, the initial indicator information is filtered and aggregated to obtain the target indicator information.

[0030] In one embodiment, after filtering and aggregating the initial indicator information according to the preset evaluation rules to obtain the target indicator information, the method further includes:

[0031] Get historical indicator information;

[0032] A visual performance report and a trend analysis report are constructed based on the data display and analysis platform, the historical indicator information, the initial indicator information and the target indicator information.

[0033] In a second aspect, the present application also provides an indicator monitoring device, comprising:

[0034] A link tracking module is used to track the request message of the target service through the modular monitoring component in the local server;

[0035] A packaging enhancement module, configured to perform packaging enhancement on a target object executing the request message based on the modular monitoring component during the link tracing process of the request message;

[0036] A first acquisition module is configured to acquire real-time performance data generated by each target object in the request message transmission link executing the target service;

[0037] The data processing module is used to process the real-time performance data according to preset evaluation rules to obtain target indicator information, and perform performance analysis on the target service based on the target indicator information.

[0038] In one embodiment, the real-time performance data includes system performance data and component performance data, and the component performance data includes thread pool performance data and / or Feign performance data and / or SQL execution performance data and / or Redis command execution performance data and / or RocketMq performance data.

[0039] In one embodiment, the link tracking module is specifically used to obtain a request message for the target service;

[0040] The request message is marked, and a link is tracked on the marked request message through a modular monitoring component.

[0041] In one of the embodiments, the packaging enhancement module is specifically used to, during the link tracing process of the request message, mark the request message as a component based on the target components transmitted by the request message in the modular monitoring component, and inject the performance monitoring task into the target object created by each target component.

[0042] In one embodiment, the real-time performance data includes component real-time performance data and system real-time performance data; the first acquisition module is specifically used to determine the target component in the modular monitoring component according to the performance indicator to be monitored;

[0043] Based on the component tag corresponding to the request message and the performance monitoring task included in the target component, obtaining the current real-time performance data of the component;

[0044] The current real-time performance data of the system is obtained based on the modular monitoring components and hardware performance counters.

[0045] In one embodiment, the packaging enhancement module is specifically used to intercept the creation of each target object corresponding to the request message, and determine whether the target objects include a thread pool object;

[0046] In the case where the thread pool object is included in each target object, the target object is replaced with a packaged and enhanced target object according to the modular monitoring component; the packaged and enhanced target object includes a thread pool tag and a thread pool monitoring task in a thread pool monitoring tool;

[0047] The first acquisition module is specifically configured to acquire, according to the thread pool monitoring task, the real-time performance data of the thread pool carried by the request message when it is transmitted in the thread pool component;

[0048] The real-time performance data of the thread pool is associated with the thread pool performance index according to the thread pool tag to obtain real-time performance data for implementing the target service.

[0049] In one embodiment, the data processing module is specifically used to perform data conversion on the real-time performance data to obtain initial indicator information in a target format;

[0050] According to the preset evaluation rules, the initial indicator information is filtered and aggregated to obtain the target indicator information.

[0051] In one embodiment, the apparatus further comprises:

[0052] The second acquisition module is specifically used to obtain historical indicator information;

[0053] The construction module is specifically used to construct a visual performance report and a trend analysis report based on the data display and analysis platform, the historical indicator information, the initial indicator information and the target indicator information.

[0054] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0055] Track the request message of the target service through the modular monitoring component in the local server;

[0056] In the link tracing process of the request message, packaging and enhancing the target object executing the request message based on the modular monitoring component;

[0057] Acquire real-time performance data generated by each target object executing the target service in the request message transmission link;

[0058] The real-time performance data is processed according to preset evaluation rules to obtain target indicator information, and performance analysis of the target service is performed based on the target indicator information.

[0059] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0060] Track the request message of the target service through the modular monitoring component in the local server;

[0061] In the link tracing process of the request message, packaging and enhancing the target object executing the request message based on the modular monitoring component;

[0062] Acquire real-time performance data generated by each target object executing the target service in the request message transmission link;

[0063] The real-time performance data is processed according to preset evaluation rules to obtain target indicator information, and performance analysis of the target service is performed based on the target indicator information.

[0064] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the following steps:

[0065] Track the request message of the target service through the modular monitoring component in the local server;

[0066] In the link tracing process of the request message, packaging and enhancing the target object executing the request message based on the modular monitoring component;

[0067] Acquire real-time performance data generated by each target object executing the target service in the request message transmission link;

[0068] The real-time performance data is processed according to preset evaluation rules to obtain target indicator information, and performance analysis of the target service is performed based on the target indicator information.

[0069] The above-mentioned indicator monitoring method, apparatus, computer equipment, storage medium, and computer program product, through modular monitoring components, track the link of the request message of the target service, so that the request message can be packaged and enhanced during the transmission of different components, so that the packaged and enhanced request message carries the current performance data during the transmission process. The modular monitoring component can obtain the current performance of the target service in real time, avoiding the performance analysis of the target service after generating the full log and sending it to the monitoring server. Instead, the target service is monitored in real time locally on the server of the target service. Finally, the current performance data is processed according to preset evaluation rules to generate target indicator information for real-time alarms, and alarms are issued based on the target indicator information, which can ensure the immediacy of indicator monitoring for the target service. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0071] Figure 1Schematic diagram of a flow chart of an indicator monitoring method in one embodiment;

[0072] Figure 2 1 is a flowchart of an indicator monitoring method using Feign monitoring as an example in one embodiment;

[0073] Figure 3 1 is a flow chart of an indicator monitoring method using SQL execution monitoring as an example in another embodiment;

[0074] Figure 4 1 is a flowchart of an indicator monitoring method using the monitoring of Redis command execution as an example in another embodiment;

[0075] Figure 5 1 is a flow chart of an indicator monitoring method using RocketMq monitoring as an example in another embodiment;

[0076] Figure 6 A flowchart of a link tracing step in one embodiment;

[0077] Figure 7 A flowchart illustrating steps for obtaining real-time performance data during link tracing in one embodiment;

[0078] Figure 8 1 is a flow chart of an indicator monitoring method using thread pool monitoring as an example in one embodiment;

[0079] Figure 9 A schematic diagram of a flow chart in one embodiment;

[0080] Figure 10 A schematic diagram of a process for processing real-time performance data in one embodiment;

[0081] Figure 11 is a structural block diagram of an indicator monitoring device in one embodiment;

[0082] Figure 12 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0083] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0084] In one embodiment, Figure 1As shown, a method for monitoring indicators is provided. This embodiment uses the method applied to a server as an example for illustration. It is understandable that the method can also be applied to a system including a terminal and a server and implemented through the interaction between the terminal and the server. The modular monitoring component is deployed on the server to be monitored, which can be an application server or a database server. In this embodiment, the method includes the following steps:

[0085] Step 102: perform link tracking on the request message of the target service through the modular monitoring component in the local server.

[0086] In an embodiment of the present application, when the system or application starts, the server initializes a modular monitoring component to ensure that it can effectively track the link of the request message. The modular monitoring component can be Perf-micrometer (a performance monitoring plug-in based on Micrometer that uses the Perf tool to collect performance indicator data and uses the Micrometer library for measurement and monitoring). The initialization includes configuring the required performance monitoring indicators and events. Based on the configuration information of the modular monitoring component, the server monitors multiple components in the server through the server's local modular monitoring component, for example, the server's thread pool, Feign (a declarative web service client), etc.

[0087] When a client sends a request message, the server captures and records it through a modular monitoring component and begins tracing the message's delivery path, recording the request message's path from the client to the target service, including all intermediate components or services it passes through along the way. This traceability can be achieved through unique identifiers or contextual information to ensure message consistency and traceability throughout the entire chain.

[0088] Step 104: During the link tracing process of the request message, the target object that executes the request message is packaged and enhanced based on the modular monitoring component.

[0089] In this embodiment, the server uses a monitoring component to package and enhance the target object of the execution request message. By modifying the target object's behavior, monitoring code can be inserted during the target object's execution to record performance data and status information during the execution process, as well as additional monitoring information such as execution time, exception capture, and method call count. By packaging and enhancing the target object, the monitoring component can obtain information about the target service's behavior and performance.

[0090] Step 106: Acquire real-time performance data generated by each target object executing the target service in the request message transmission link.

[0091] In this embodiment of the present application, after the target object of a request message is packaged and enhanced, the monitoring component in the server can collect and aggregate the real-time performance data generated by each target object in the request message transmission link when executing the target service. This real-time performance data includes, but is not limited to, response time, processing time, resource utilization, and so on. By collecting this real-time performance data, a better understanding of the operating status and performance of the target service can be achieved.

[0092] Step 108: Process the real-time performance data according to preset evaluation rules to obtain target indicator information, and perform performance analysis on the target service based on the target indicator information.

[0093] In an embodiment of the present application, the server submits the collected real-time performance data to the evaluation rule engine for processing. The evaluation rule engine analyzes and calculates the real-time performance data according to the preset evaluation rules to obtain target indicator information. Specifically, the server pre-processes the collected data according to the preset evaluation rules, for example, filtering, aggregation or conversion, so as to better reflect the performance indicators. According to the configured rules and thresholds, the data is analyzed to identify performance bottlenecks or abnormal patterns. These target indicator information can be metrics about service performance, availability, stability, etc. Finally, based on these target indicator information, the performance of the target service can be analyzed and evaluated for optimization and improvement.

[0094] In the above-mentioned indicator monitoring method, the link tracking of the request message of the target service is performed through the modular monitoring component, so that the request message can be packaged and enhanced during the transmission of different components, so that the packaged and enhanced request message carries the current performance data during the transmission process. The modular monitoring component can obtain the current performance of the target service in real time, avoiding the performance analysis of the target service only after the full log is generated and sent to the monitoring server. Instead, the target service is monitored in real time locally on the server of the target service. Finally, the current performance data is processed according to preset evaluation rules to generate target indicator information for real-time alarms, and alarms are issued based on the target indicator information, which can ensure the immediacy of indicator monitoring for the target service.

[0095] In one exemplary embodiment, real-time performance data includes system performance data and component performance data, including thread pool performance data, Feign performance data, SQL (Structured Query Language) execution performance data, Redis command execution performance data, and RocketMq (a distributed messaging middleware) performance data. Furthermore, "Perf-micrometer" uses the Micrometer (a server performance analysis and measurement library) API to collect application-level metrics, such as HTTP (Hypertext Transfer Protocol) request counts and database query latency.

[0096] In this embodiment of the present application, system performance data includes CPU usage, memory allocation, I / O operations, etc. Component data may also include virtual machine performance data and MongoDB performance data. For system performance data, the server can utilize the underlying perf_events subsystem of Perf (a system performance analysis tool) to collect system-level performance data using hardware performance counters (such as CPU performance monitoring counters).

[0097] In a specific embodiment, Figure 2 As shown, steps 102 to 106 in the above embodiment are specifically described by taking the monitoring of Feign as an example. That is, steps 102 to 106 in the above embodiment can be implemented by the following specific methods, including:

[0098] In step 202, the server intercepts the creation of the FeignContext object through the BeanPostProcessor component and converts the FeignContext into a PerfFeignContext.

[0099] Step 204: intercept the creation of FeignClient in PerfFeignContext, package FeignClient as PerfFeignClient, and monitor the execution process.

[0100] In step 206, the server obtains the trace information before the request, adds the trace information to the header of the request message, implements link tracking, and obtains Feign performance data.

[0101] This process transmits tracking information throughout the entire request chain, making the entire request processing process traceable. The Feign request mock (simulated behavior object) uses the Uniform Resource Locator (URL) to determine whether a mock is required. If a mock is required, no HTTP request is initiated. Instead, the mock result is packaged and returned as a response object (an object used for replying). By determining whether a mock is required for the requested URL, the preset mock result can be directly returned without actually initiating an HTTP request, effectively reducing requests for external dependencies.

[0102] In a specific embodiment, Figure 3 As shown, steps 102 to 106 in the above embodiment are specifically described by taking the monitoring of SQL execution as an example. That is, steps 102 to 106 in the above embodiment can be implemented by the following specific methods, including:

[0103] In step 302, the server intercepts the creation of the DataSource object through the BeanPostProcessor and creates a proxy for the DataSource.

[0104] Step 304: The proxy object packages the connection generated by the DataSource to generate a proxy for the connection.

[0105] Step 306: The proxy object obtains SQL execution performance data, including SQL statements and execution time, during the process of executing the SQL statements.

[0106] By default, the modular monitoring component uses Spring AOP (a feature of the Spring Framework) to create proxies. These proxied objects are subclasses of the original objects. However, if the DataSource implementation class is final (a keyword that modifies a class), Aspect Oriented Programming (AOP) will fail. In this case, the component provides the option of creating a proxy by wrapping the DataSource. In this case, the proxy object is not a subclass of the original object.

[0107] In a specific embodiment, Figure 4 As shown, steps 102 to 106 in the above embodiment are specifically described by taking the monitoring of Redis command execution as an example. That is, steps 102 to 106 in the above embodiment can be implemented by the following specific methods, including:

[0108] In step 402, the modular monitoring component intercepts the creation of RedisConnectionFactory and RedisTemplate objects through BeanPostProcessor.

[0109] Step 404: Wrap the generated RedisConnection object with the proxy object to generate a proxy for RedisConnection.

[0110] Step 406: Monitor the process of RedisConnection executing the Redis command to obtain Redis command execution performance data.

[0111] In a specific embodiment, Figure 5 As shown, taking the monitoring of RocketMq as an example, RocketMq includes a Consumer end and a Producer end. Steps 102 to 106 in the above embodiment are specifically described. That is, steps 102 to 106 in the above embodiment can be implemented by the following specific methods, including:

[0112] For the Consumer side:

[0113] Step 502: intercept the creation of the RocketmqConsumer object when the service is started, and package and enhance the MessageListener object of the RocketmqConsumer.

[0114] Step 504: The consumeMessage method overridden by the packaged object is used to count the method execution time, and at the same time, Trace information is obtained from the userProperties of the MessageExt object.

[0115] Step 506: During the consumption process, obtain Trace information from the userProperties of the MessageExt object to obtain RocketMq performance data.

[0116] Because the consumeMessage method of MessageListener consumes messages in batches, and the trace information in different messages varies, correct retrieval requires that users of modular monitoring components package and execute each message consumption process using the tools provided by the trace component. Otherwise, the trace information for a batch of messages will only be based on the first message in the collection. However, if a consumer written using the RocketMQMessageListener annotation consumes a single message in the onMessage method, the trace information can be correctly transmitted through the component.

[0117] For the Producer side: The interception method during the link tracking process is different. Specifically, all methods of the MQProducer interface are intercepted through Spring AOP.

[0118] Among them, when executing the method in the MQProducer interface, check whether the method parameter contains a MessageExt object or a MessageExt collection. If it does, obtain or create Trace information and inject the information into the userProperties of MessageExt.

[0119] In a specific example, for monitoring MongoDB (a document-based database), the MongoDB Java client provides a CommandListener interface. By implementing this interface, the server can monitor MongoDB execution. The Perf component provides an implementation class for monitoring and registers this class with the Spring (a Java development framework) container. Users can directly obtain this implementation class from the Spring container and add it to its CommandListener list when creating the mongoClient.

[0120] In a specific embodiment, virtual machine performance monitoring includes monitoring garbage collection (GC) counts, system load, thread status, and memory information. Specifically, the server can obtain the total number of GCs and time since the Java Virtual Machine (JVM) was started using the getCollectionCount and getCollectionTime methods of the GarbageCollectorMXBean. System load-related metrics can be obtained using the OperatingSystemMXBean. The number of threads in different states can be obtained using the ThreadMXBean. Memory usage in different areas of the JVM can be obtained using the BufferPoolMXBean.

[0121] In an exemplary embodiment, the modular monitoring component obtains performance indicators during the transmission of the request message of the target server. Therefore, the server can use link tracking to monitor the performance indicators of the transmission of the request message, such as Figure 6 As shown, step 102 includes steps 602 to 604. Among them:

[0122] Step 602: Obtain a request message for the target service.

[0123] In an embodiment of the present application, when the request message of the target service arrives at the local server, the server intercepts the request message through a modular monitoring component to obtain the request message of the target service, which may be an HTTP request from the client, a message in a message queue, etc.

[0124] Step 604: Mark the request message, and perform link tracing on the marked request message through the modular monitoring component.

[0125] In an embodiment of the present application, the server adds a unique identifier, such as a TraceID, to the obtained request message in order to track the execution status of the request during the entire link tracing process. The server then passes the marked request message to the modular monitoring component, which is responsible for taking over the marked request message and is responsible for subsequent link tracing work. Specifically, when the request is initiated, the server generates a unique TraceID to identify the entire link tracing process. The TraceID can be a globally unique identifier, usually generated using a UUID or a similar method. During the request transmission process, the TraceID and user-defined Trace information are passed along with the request. After receiving the request, the server extracts the TraceID and Trace information therein to implement link tracing of the request message.

[0126] In asynchronous processing scenarios, a request may be split into multiple independent tasks and executed asynchronously. To ensure the delivery of the trace ID, the trace object must be correctly passed between tasks so that all related asynchronous tasks can ultimately be associated with the same request, forming a complete request trace record. For HTTP-based requests, we can ensure the delivery of the trace object by passing the trace ID in the HTTP request header. After receiving the request, the server extracts the trace ID from the HTTP request header and passes it to the downstream service or component during processing. When using a message queue for task scheduling or message delivery, the trace ID is sent to the queue as part of the message. The receiving end extracts the trace ID when receiving the message and passes it during processing.

[0127] In addition, in link tracking, Perf collects indicators through Micrometer. In Micrometer, different indicators are distinguished by name and tag. Usually, the name and tag key of a certain type of indicator are fixed, but the tag value is variable. To avoid an explosion in the number of indicators when using Micrometer, the tag value must be countable.

[0128] In this embodiment, by marking the request message, the target service request message is marked and the link is tracked, ensuring that the execution status and performance indicators of each request can be accurately tracked during the request processing process, and ensuring the immediacy of indicator monitoring.

[0129] In an exemplary embodiment, a specific implementation of the packaging enhancement of the present application is explained, and step 104 includes:

[0130] In the link tracing process of the request message, based on the target components transmitted by the request message in the modular monitoring component, the request message is marked as a component and the performance monitoring task is injected into the target object created by each target component.

[0131] In an embodiment of the present application, during the transmission of the request message, the server first obtains the request message transmitted by the modular monitoring component, identifies the various target components involved therein, and creates a unique component identifier for each target component to mark the role of the component in the link tracing process. For each target object created by the target component, a performance monitoring task is injected, for example, by obtaining Trace information and adding it to the header of the request or injecting the monitoring information directly into the execution process. In the injected performance monitoring task, the start time and end time of the execution of the target object are recorded by the modular monitoring component, and performance data during the execution process is collected, such as method execution time, resource consumption, etc.

[0132] In this embodiment, by marking each target component and injecting a performance monitoring task, the target service performance is monitored and analyzed locally on the server.

[0133] In an exemplary embodiment, the real-time performance data includes component real-time performance data and system real-time performance data, such as Figure 7 As shown, step 106 includes steps 702 to 706. Among them:

[0134] Step 702: Determine a target component in the modular monitoring component according to the performance indicator to be monitored.

[0135] In the embodiment of the present application, performance indicators that need to be monitored are pre-configured according to business needs and the purpose of system performance monitoring, such as response time, throughput, error rate, etc. The server determines the target components that need to be monitored based on the determined performance indicators, such as Feign, thread pool, and RocketMq.

[0136] Step 704: Acquire the real-time performance data of the current component based on the component tag corresponding to the request message and the performance monitoring task included in the target component.

[0137] In an embodiment of the present application, the modular monitoring component obtains the real-time performance data generated by the performance monitoring task it contains according to the component tag of the request message, such as method execution time, resource consumption, etc.

[0138] Step 706: Acquire current system real-time performance data based on the modular monitoring components and hardware performance counters.

[0139] In an embodiment of the present application, the server obtains the performance data of each component of the system through a modular monitoring component. At the same time, it obtains the usage of the underlying hardware resources of the system through hardware performance counters, such as CPU utilization, memory usage, disk IO (Input / Output), etc. Finally, the real-time performance data obtained from the modular monitoring component and the hardware performance counters are integrated to obtain the real-time performance of the entire system.

[0140] In this embodiment, the target service is monitored locally on the server of the target service in real time through the component tag and the performance monitoring task included in the target component.

[0141] In an exemplary embodiment, steps 104 to 106 are described using a specific embodiment of thread pool monitoring. Figure 8 As shown, in the case where the performance indicator to be monitored includes the thread pool performance indicator, step 104 includes steps 802 to 804. Among them:

[0142] Step 802: intercept the creation of each target object corresponding to the request message, and determine whether each target object contains a thread pool object.

[0143] In the embodiment of the present application, for the thread pool monitoring service, the thread pool request message is a bean (a message type). When the service starts, the modular monitoring component intercepts the creation of all beans through BeanPostProcessor and determines whether there is a thread pool object in the bean by searching.

[0144] Step 804: When each target object includes a thread pool object, the target object is replaced with a packaged and enhanced target object according to the modular monitoring component.

[0145] The enhanced target object includes a thread pool tag and a thread pool monitoring task in a thread pool monitoring tool.

[0146] In an embodiment of the present application, if the created bean object contains a thread pool object, the server monitors the thread pool through the ExecutorServiceMetrics tool provided by Micrometer. Specifically, for the target object containing the thread pool object, the function provided by the modular monitoring component is used to replace the target object with the packaged and enhanced target object, and the thread pool is packaged and then replaced with the original thread pool object in the bean. Among them, when submitting a runnable task to the enhanced thread pool object, the enhanced thread pool object will package the runnable, and the packaged runnable object will contain the Trace information in the main thread. When the thread pool subsequently executes asynchronous tasks, the Trace information will be taken out and placed in the asynchronous thread, thereby realizing the transfer of Trace information from the main thread to the asynchronous thread.

[0147] Step 106 includes steps 806 to 808, wherein:

[0148] Step 806: According to the thread pool monitoring task, obtain the thread pool real-time performance data carried by the request message when it is transmitted in the thread pool component.

[0149] In an embodiment of the present application, for the thread pool object, the modular monitoring component provides corresponding monitoring tasks for collecting real-time performance data of the thread pool. The thread pool monitoring tasks contained in the target object after packaging and enhancing the thread pool object obtain the real-time performance data of the thread pool carried by the request message when it is passed in the thread pool component, such as the number of active threads in the thread pool, the length of the task queue, etc.

[0150] Step 808: Correlate the thread pool real-time performance data with the thread pool performance index according to the thread pool tag to obtain real-time performance data for implementing the target service.

[0151] In an embodiment of the present application, the server identifies the transmission status of the request message in the thread pool component based on the thread pool tag in the request message, and obtains comprehensive system performance data by integrating the performance data of the thread pool with the performance data of other components, thereby realizing the association of the real-time performance data of the thread pool with the thread pool performance indicators, and obtaining real-time performance data for implementing the target service.

[0152] In this embodiment, it is possible to monitor the target object including the thread pool object and associate the real-time performance data of the thread pool with the real-time performance data of the target service.

[0153] In an exemplary embodiment, Figure 9 As shown, step 108 includes steps 902 to 904. Among them:

[0154] Step 902: Perform data conversion on the real-time performance data to obtain initial indicator information in a target format.

[0155] In embodiments of the present application, the server preprocesses the collected data, such as filtering, aggregating, or converting it, to better reflect performance indicators. Specifically, the server converts the collected real-time performance data (such as thread pool data and component performance data) from its original format into a unified target format, including data formatting, unit conversion, and data structure adjustment. The converted data is then rearranged and organized to generate initial performance indicator information.

[0156] Step 904: Filter and aggregate the initial indicator information according to preset evaluation rules to obtain target indicator information.

[0157] In an embodiment of the present application, the server applies preset evaluation rules to filter the initial indicator information and eliminate data that does not meet specific conditions. For example, performance data below the performance baseline or outliers may be ignored to focus on key factors affecting system performance. The filtered data is aggregated to form more general and representative target indicator information. The aggregated data is compiled into target indicator information, which will be used for the final performance report, monitoring dashboard display or further performance analysis.

[0158] After obtaining the target indicator information, the target indicator information can be further analyzed. For example, according to the configured rules and thresholds, the data can be analyzed to identify performance bottlenecks or abnormal patterns.

[0159] In this embodiment, by performing data conversion, data filtering and data aggregation on real-time performance data, the collected real-time performance data can be effectively converted into target indicator information that intuitively reflects performance, thereby improving the effectiveness of server performance monitoring and evaluation.

[0160] In an exemplary embodiment, after the server obtains the indicator information, it can also visualize the indicator information, such as Figure 10 As shown, after step 904, the method further includes steps 1002 to 1004. In which:

[0161] Step 1002: Obtain historical indicator information.

[0162] In the embodiments of the present application, historical indicator information may be historical records of previously collected real-time performance data that have been stored and archived, and is used for performance trend analysis and comparison. The server retrieves the historical indicator information from the historical performance data storage and integrates the retrieved historical indicator information into the current performance analysis environment for comparison and analysis with the current initial indicator information and target indicator information.

[0163] Step 1004 : constructing a visual performance report and a trend analysis report based on the data display and analysis platform, historical indicator information, initial indicator information, and target indicator information.

[0164] In this embodiment of the application, the server uses the data display and analysis platform to analyze historical, initial, and target performance information, exploring correlations and trends between performance data. Based on the analysis results, the server can construct visual performance reports and trend analysis reports. These reports can include various charts, trend graphs, statistical indicators, etc., to intuitively display changes and trends in system performance.

[0165] Finally, the performance reports and trend analysis reports are constructed and displayed, for example, on an online performance monitoring dashboard or by sending reports to users or server administrators on a regular basis.

[0166] In this embodiment, by constructing a visual performance report and a trend analysis report, it is possible to analyze and display the historical trend of system performance, thereby intuitively reflecting the evolution of server system performance and improving the stability of server operation.

[0167] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0168] Based on the same inventive concept, the present application also provides an indicator monitoring device for implementing the above-mentioned indicator monitoring method. The solution provided by this device is similar to the solution described in the above-mentioned method. Therefore, the specific limitations of one or more indicator monitoring device embodiments provided below can be referred to the limitations of the indicator monitoring method above and will not be repeated here.

[0169] In an exemplary embodiment, Figure 11 As shown, an indicator monitoring device 1100 is provided, comprising: a link tracking module 1101, a packaging enhancement module 1102, a first acquisition module 1103 and a data processing module 1104, wherein:

[0170] The link tracking module 1101 is used to track the request message of the target service through the modular monitoring component in the local server;

[0171] The packaging enhancement module 1102 is used to perform packaging enhancement on the target object of the execution request message based on the modular monitoring component during the link tracing process of the request message;

[0172] The first acquisition module 1103 is used to obtain real-time performance data generated by each target object executing a target service in the request message transmission link;

[0173] The data processing module 1104 is used to process the real-time performance data according to preset evaluation rules to obtain target indicator information, and perform performance analysis on the target service based on the target indicator information.

[0174] In one embodiment, the real-time performance data includes system performance data and component performance data, and the component performance data includes thread pool performance data and / or Feign performance data and / or SQL execution performance data and / or Redis command execution performance data and / or RocketMq performance data.

[0175] In one embodiment, the link tracking module 1101 is specifically used to obtain a request message for a target service;

[0176] Mark the request message and use the modular monitoring component to track the link of the marked request message.

[0177] In one embodiment, the packaging enhancement module 1102 is specifically used to, during the link tracing process of the request message, mark the request message as a component based on the target components transmitted by the request message in the modular monitoring component and inject the performance monitoring task into the target object created by each target component.

[0178] In one embodiment, the real-time performance data includes component real-time performance data and system real-time performance data; the first acquisition module 1103 is specifically configured to determine a target component in the modular monitoring component based on the performance indicator to be monitored;

[0179] Obtain the current component's real-time performance data based on the component tag corresponding to the request message and the performance monitoring tasks included in the target component;

[0180] Obtain current system real-time performance data based on modular monitoring components and hardware performance counters.

[0181] In one embodiment, the packaging enhancement module 1102 is specifically used to intercept the creation of each target object corresponding to the request message and determine whether each target object includes a thread pool object;

[0182] In the case where each target object includes a thread pool object, the target object is replaced with a packaged and enhanced target object according to the modular monitoring component; the packaged and enhanced target object includes a thread pool tag and a thread pool monitoring task in the thread pool monitoring tool;

[0183] The first acquisition module 1103 is specifically configured to acquire, according to the thread pool monitoring task, the real-time performance data of the thread pool carried by the request message when it is transmitted in the thread pool component;

[0184] The real-time performance data of the thread pool is associated with the thread pool performance index according to the thread pool tag to obtain the real-time performance data of the target service.

[0185] In one embodiment, the data processing module 1104 is specifically used to perform data conversion on the real-time performance data to obtain initial indicator information in a target format;

[0186] According to the preset evaluation rules, the initial indicator information is filtered and aggregated to obtain the target indicator information.

[0187] In one embodiment, the apparatus 1100 further includes:

[0188] The second acquisition module is specifically used to obtain historical indicator information;

[0189] The construction module is specifically used to build visual performance reports and trend analysis reports based on the data display analysis platform, historical indicator information, initial indicator information and target indicator information.

[0190] Each module in the aforementioned indicator monitoring device may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0191] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 12As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store real-time performance data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an indicator monitoring method is implemented.

[0192] Those skilled in the art will understand that Figure 12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0193] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0194] Track the request message of the target service through the modular monitoring component in the local server;

[0195] In the process of link tracing of request messages, the target object of the request message is packaged and enhanced based on the modular monitoring component;

[0196] Obtain real-time performance data generated by each target object executing the target service in the request message transmission link;

[0197] The real-time performance data is processed according to the preset evaluation rules to obtain the target indicator information, and the performance analysis of the target service is performed based on the target indicator information.

[0198] In one embodiment, when the processor executes a computer program, the real-time performance data includes system performance data and component performance data, and the component performance data includes thread pool performance data and / or Feign performance data and / or SQL execution performance data and / or Redis command execution performance data and / or RocketMq performance data.

[0199] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0200] Get the request message of the target service;

[0201] Mark the request message and use the modular monitoring component to track the link of the marked request message.

[0202] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0203] In the link tracing process of the request message, based on the target components transmitted by the request message in the modular monitoring component, the request message is marked as a component and the performance monitoring task is injected into the target object created by each target component.

[0204] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0205] Determine the target component in the modular monitoring component based on the performance indicators to be monitored;

[0206] Obtain the current component's real-time performance data based on the component tag corresponding to the request message and the performance monitoring tasks included in the target component;

[0207] Obtain current system real-time performance data based on modular monitoring components and hardware performance counters.

[0208] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0209] Intercept the creation of each target object corresponding to the request message and determine whether each target object contains a thread pool object;

[0210] In the case where each target object includes a thread pool object, the target object is replaced with a packaged and enhanced target object according to the modular monitoring component; the packaged and enhanced target object includes a thread pool tag and a thread pool monitoring task in the thread pool monitoring tool;

[0211] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0212] According to the thread pool monitoring task, obtain the real-time performance data of the thread pool carried by the request message when it is transmitted in the thread pool component;

[0213] The real-time performance data of the thread pool is associated with the thread pool performance index according to the thread pool tag to obtain the real-time performance data of the target service.

[0214] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0215] Perform data conversion on real-time performance data to obtain initial indicator information in the target format;

[0216] According to the preset evaluation rules, the initial indicator information is filtered and aggregated to obtain the target indicator information.

[0217] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0218] Get historical indicator information;

[0219] Based on the data display and analysis platform, historical indicator information, initial indicator information and target indicator information, build visual performance reports and trend analysis reports.

[0220] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0221] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0222] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0223] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.

[0224] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0225] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A method for monitoring indicators, characterized in that: The method comprises: Track the request message of the target service through the modular monitoring component in the local server; During the link tracing process of the request message, the target object executing the request message is packaged and enhanced based on the modular monitoring component; the packaged and enhanced request message carries real-time performance data of the target object during execution during transmission; Acquire the real-time performance data generated by each target object executing the target service in the request message transmission link; Processing the real-time performance data according to preset evaluation rules to obtain target indicator information, and performing performance analysis on the target service based on the target indicator information; In the link tracing process of the request message, packaging and enhancing the target object executing the request message based on the modular monitoring component includes: During the link tracing process of the request message, based on the target components transmitted by the request message in the modular monitoring component, the request message is respectively marked as a component and a performance monitoring task is injected into the target object created by each target component; the performance monitoring task is to modify the behavior of the target object, so that the modular monitoring component records the start time and end time of the execution of the target object, and collects real-time performance data during the execution process; the real-time performance data includes at least response time and processing time.

2. The method according to claim 1, characterized in that The real-time performance data includes system performance data and component performance data, and the component performance data includes thread pool performance data and / or Feign performance data and / or SQL execution performance data and / or Redis command execution performance data and / or RocketMq performance data.

3. The method according to claim 1, characterized in that The link tracking of the request message of the target service by the modular monitoring component in the local server includes: Obtaining a request message for the target service; The request message is marked, and a link is tracked on the marked request message through a modular monitoring component.

4. The method according to claim 1, wherein The real-time performance data includes component real-time performance data and system real-time performance data; the obtaining of the real-time performance data generated by each target object executing the target service in the request message transmission link includes: Determining a target component in the modular monitoring component according to the performance indicator to be monitored; Based on the component tag corresponding to the request message and the performance monitoring task included in the target component, obtaining the current real-time performance data of the component; The current real-time performance data of the system is obtained based on the modular monitoring components and hardware performance counters.

5. The method according to claim 1, wherein In a case where the performance indicator to be monitored includes a thread pool performance indicator, in the link tracing process of the request message, packaging and enhancing the target object that executes the request message based on the modular monitoring component includes: Intercepting the creation of each target object corresponding to the request message, and determining whether each target object includes a thread pool object; In the case where the thread pool object is included in each target object, the target object is replaced with a packaged and enhanced target object according to the modular monitoring component; the packaged and enhanced target object includes a thread pool tag and a thread pool monitoring task in a thread pool monitoring tool; The acquiring of real-time performance data generated by each target object executing the target service in the request message transmission link includes: According to the thread pool monitoring task, obtaining the thread pool real-time performance data carried by the request message when it is transmitted in the thread pool component; The real-time performance data of the thread pool is associated with the thread pool performance index according to the thread pool tag to obtain real-time performance data for implementing the target service.

6. The method according to claim 1, characterized in that The data processing of the real-time performance data according to the preset evaluation rules to obtain target indicator information includes: Performing data conversion on the real-time performance data to obtain initial indicator information in a target format; According to the preset evaluation rules, the initial indicator information is filtered and aggregated to obtain the target indicator information.

7. The method according to claim 6, characterized in that After filtering and aggregating the initial indicator information according to the preset evaluation rules to obtain target indicator information, the method further includes: Get historical indicator information; A visual performance report and a trend analysis report are constructed based on the data display and analysis platform, the historical indicator information, the initial indicator information and the target indicator information.

8. An indicator monitoring device, characterized in that: The device comprises: A link tracking module is used to track the request message of the target service through the modular monitoring component in the local server; a packaging enhancement module, configured to perform packaging enhancement on a target object executing the request message based on the modular monitoring component during link tracing of the request message; wherein the enhanced packaging request message carries real-time performance data of the target object during execution during transmission; A first acquisition module is configured to acquire the real-time performance data generated by each target object in the request message transmission link executing the target service; A data processing module is used to process the real-time performance data according to preset evaluation rules to obtain target indicator information, and perform performance analysis on the target service based on the target indicator information; The packaging enhancement module is specifically used to, during the link tracing process of the request message, mark the request message as a component based on the target components transmitted by the request message in the modular monitoring component, and inject the performance monitoring task into the target object created by each target component; the performance monitoring task is to modify the behavior of the target object, so that the modular monitoring component records the start time and end time of the execution of the target object, and collects real-time performance data during the execution process; the real-time performance data includes at least response time and processing time.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Monitoring method and device, computer device and storage medium

    CN109873717A

  • Link monitoring method and device, computer equipment and medium

    CN112559831A

  • Server performance monitoring method and device, computer equipment and storage medium

    CN117194165A