Link tracking sampling rate adjusting method and device
By acquiring Java Virtual Machine and system resource metrics data, combined with hostname and service name information, the link tracing sampling rate is automatically adjusted. This solves the problems of data redundancy and missing observations caused by manual intervention in existing technologies, and realizes real-time dynamic adjustment of the link tracing sampling rate and improved system stability.
Patent Information
- Application Number
- CN202511932652.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-04-14
AI Technical Summary
Existing link tracing systems require manual intervention to adjust the sampling rate, resulting in data redundancy or missing observations, and are unable to achieve real-time dynamic adjustment.
By acquiring Java Virtual Machine and system resource metrics data, combined with hostname and service name information, the link tracing sampling rate is automatically adjusted, and the sampling rate is optimized using comprehensive resource pressure scoring and predictive models.
It enables automated real-time adjustment of the link tracing sampling rate, reduces labor costs, avoids data redundancy, adapts to various complex application scenarios, and improves system stability and monitoring accuracy.
Smart Images

Figure CN121858401A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cloud computing technology, and can also be used in the financial field, particularly to a method and apparatus for adjusting the sampling rate of link tracing. Background Technology
[0002] Distributed tracing technology is an important tool for monitoring and analyzing request flows in distributed systems. It is mainly used in microservice architectures to help developers and operations personnel understand system behavior, identify performance bottlenecks, and debug problems by tracing the flow of requests between various services.
[0003] The core concepts of distributed tracing technology include Trace and Span. A Trace represents a complete request processing flow, which may traverse multiple service nodes from request initiation to completion. A Span represents the processing flow of the request within a specific service node. A Trace consists of multiple Spans. By passing contextual information such as Trace ID and Span ID between services, the start and end timestamps of the request, as well as various possible events or error messages, are recorded. This information is then stored for subsequent querying and analysis.
[0004] Distributed tracing technology has a wide range of applications. It plays a crucial role in various sectors, including finance, e-commerce, and internet services. In these fields, distributed tracing helps companies monitor system status in real time, optimize performance, and improve user experience. For example, in the financial industry, distributed tracing can be used to monitor transaction processes, ensuring accuracy and timeliness; in the e-commerce industry, it helps companies understand the full picture of user purchasing behavior, thereby optimizing recommendation algorithms and improving user experience.
[0005] This section is intended to provide background or context for the embodiments of the invention set forth in the claims. The description herein is not an admission that it is prior art simply because it is included in this section. Summary of the Invention
[0006] This invention provides a link tracing sampling rate adjustment method to achieve dynamic real-time adjustment of the link tracing sampling rate. The method includes:
[0007] Acquire tracking metric data including a first tracking sampling rate, JAVA virtual machine metric data, and system resource metric data; wherein the JAVA virtual machine metric data includes at least one of CPU utilization and garbage collection rate, and the system resource metric data includes at least one of memory utilization, bandwidth utilization, and packet loss rate;
[0008] Based on the JAVA virtual machine's indicator data, hostname and service name information are extracted; and
[0009] Based on the JAVA virtual machine metric data, the system resource metric data, the first tracking sampling rate, the host name, and the service name information, adjust the first tracking sampling rate corresponding to the corresponding service of the corresponding host.
[0010] In some embodiments, the method further includes: determining the adjustment frequency of the first tracking sampling rate based on the acquisition frequency of the Java Virtual Machine.
[0011] In some embodiments, the corresponding service is determined based on the program ID corresponding to the service name information.
[0012] In some embodiments, the method further includes: calculating a comprehensive resource stress score based on the JAVA virtual machine's indicator data and system resource indicator data; and
[0013] Based on the comprehensive resource pressure score, the first tracking sampling rate, the host name, and the service name information, the first tracking sampling rate corresponding to the corresponding service of the corresponding host is adjusted.
[0014] In some embodiments, the comprehensive resource stress score is calculated according to the following formula:
[0015]
[0016] Among them, w n The weight corresponding to the nth data in the system resource index data;
[0017] R n This refers to the nth data point in the system resource index data.
[0018] N is the total number of data in the system resource index data;
[0019] w m The weight is the value corresponding to the m-th data point in the JAVA virtual machine's metric data.
[0020] J m This refers to the m-th data point in the JAVA virtual machine's metric data.
[0021] M represents the total number of data points in the JAVA virtual machine's metric data.
[0022] In some embodiments, the method further includes: presetting multiple consecutive comprehensive resource pressure scoring intervals and multiple consecutive tracking sampling rate intervals;
[0023] Based on the comprehensive resource pressure score interval in which the comprehensive resource pressure score is located and the tracking sampling rate interval in which the first tracking sampling rate is located, an adjustment strategy for the first tracking sampling rate is determined.
[0024] In some embodiments, the method further includes:
[0025] When the comprehensive resource pressure score is within the first comprehensive resource pressure score range and the first tracking sampling rate is within the first tracking sampling rate range, the first tracking sampling rate corresponding to the corresponding service of the corresponding host is reduced.
[0026] When the comprehensive resource pressure score is within the second comprehensive resource pressure score range and the first tracking sampling rate is within the third tracking sampling rate range, the first tracking sampling rate corresponding to the corresponding service of the corresponding host is increased.
[0027] In some embodiments, the adjusted first tracking sampling rate is a second tracking sampling rate, and the method further includes:
[0028] The JAVA virtual machine metric data, the system resource metric data, the first tracking sampling rate, the host name, and the service name information are input into the tracking sampling rate prediction model to predict the third tracking sampling rate.
[0029] The second tracking sampling rate is updated based on the third tracking sampling rate.
[0030] This invention also provides a link tracing sampling rate adjustment device for dynamically and in real-time adjusting the sampling rate of link tracing. The device includes:
[0031] The acquisition unit acquires tracking indicator data including a first tracking sampling rate, JAVA virtual machine indicator data, and system resource indicator data; wherein the JAVA virtual machine indicator data includes at least one of CPU utilization and garbage collection rate, and the system resource indicator data includes at least one of memory utilization, bandwidth utilization, and packet loss rate.
[0032] The processing unit extracts hostname and service name information based on the JAVA virtual machine's indicator data; and
[0033] Based on the Java Virtual Machine metrics data, the system resource metrics data, the first tracking sampling rate, the hostname, and the service name information, adjust the first tracking sampling rate corresponding to the corresponding service on the corresponding host.
[0034] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described link tracing sampling rate adjustment method.
[0035] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described link tracing sampling rate adjustment method.
[0036] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described link tracing sampling rate adjustment method.
[0037] The link tracing sampling rate adjustment method and apparatus provided in this invention, by considering JAVA virtual machine indicator data, system resource indicator data, tracing sampling rate, host name, and service name information, achieves automated real-time adjustment of the link tracing sampling rate for a specific service on a specific host, without manual intervention, reducing labor costs and avoiding data redundancy caused by improper sampling rate settings. Furthermore, this invention does not require the development of an additional management platform, reducing development workload. In addition, this invention has broad scenario adaptability and can effectively support complex application scenarios such as multiple hosts deploying the same service or one host deploying different services. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0039] Figure 1 This is a schematic diagram of a link tracing sampling rate adjustment method according to an embodiment of this application;
[0040] Figure 2 This is a schematic diagram of a link tracing sampling rate adjustment process according to an embodiment of this application;
[0041] Figure 3 This is a schematic diagram of a link tracing sampling rate adjustment device according to an embodiment of this application.
[0042] Figure 4 This is a schematic diagram of the physical structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0044] Existing link tracing systems dynamically adjust the sampling rate through link probe configuration files, environment variables, and server-side management. For example, modifying the sampling rate configuration parameter in the link probe configuration file determines the sampling frequency, and the changes take effect after a restart. Specifically, setting the sampling rate configuration parameter to -1 indicates that the link tracing system is not sampling. Another example is dynamically adjusting the sampling rate by setting environment variables while the service or application is running, thus taking effect immediately without requiring a service restart. Yet another example is that existing link tracing systems provide a graphical user interface (GUI) for configuring and adjusting the sampling rate, which in turn allows the link tracing server to adjust the sampling rate and distribute the adjusted rate to the link probes for activation.
[0045] However, existing link tracing systems adjust the link tracing sampling rate with manual intervention, which can easily lead to data redundancy or missing observations due to improper sampling rate settings. Furthermore, manual intervention cannot achieve real-time dynamic adjustment of the tracking sampling rate.
[0046] Based on this, this application provides a link tracing sampling rate adjustment method. By considering the JVM (Java Virtual Machine) metrics, system resource metrics, tracing sampling rate, host name, and service name information, it achieves automated real-time adjustment of the link tracing sampling rate for a specific service on a specific host without manual intervention. Figure 1 This is a schematic diagram of a link tracing sampling rate adjustment method according to an embodiment of this application. Figure 1 As shown, the method includes:
[0047] 101. Acquire tracking metric data including the first tracking sampling rate, JAVA virtual machine metric data, and system resource metric data; wherein, the JAVA virtual machine metric data includes at least one of CPU utilization and garbage collection rate, and the system resource metric data includes at least one of memory utilization, bandwidth utilization, and packet loss rate.
[0048] 102. Extract hostname and service name information from metric data based on the Java Virtual Machine;
[0049] 103. Based on the JAVA virtual machine indicator data, system resource indicator data, first tracing sampling rate, host name and service name information, adjust the first tracing sampling rate corresponding to the corresponding service of the corresponding host.
[0050] It is worth noting that the above appendix Figure 1 The embodiments of this application have only been illustrated schematically, and the application is not limited thereto. For example, some of the above steps can be performed simultaneously or in a specific order, and the execution order between the various operations can be appropriately adjusted. Furthermore, other operations can be added or some operations can be removed. Those skilled in the art can make appropriate modifications based on the above description, and are not limited to the above-described embodiments. Figure 1 The records.
[0051] In this embodiment, by considering JAVA virtual machine metrics, system resource metrics, tracing sampling rate, host name, and service name information, the automatic real-time adjustment of the link tracing sampling rate for a specific service on a specific host is achieved without manual intervention, reducing labor costs and avoiding data redundancy caused by improper sampling rate settings. Furthermore, this invention does not require the development of an additional management platform, reducing development workload. In addition, this invention has broad scenario adaptability and can effectively support complex application scenarios such as multiple hosts deploying the same service or one host deploying different services.
[0052] In some embodiments, the corresponding host is the host corresponding to the hostname, and the corresponding service is the service corresponding to the service name information.
[0053] For example, in a scenario where multiple services are deployed on a single host, the hostname and multiple service names (user-service, order-service, and payment-service) are extracted from JVM metrics data. Here, user-service corresponds to the user service, order-service corresponds to the order service, and payment-service corresponds to the payment service. Based on the hostname and service name information user-service, it can be determined that the sampling rate adjustment is being performed on the user service of that host.
[0054] For example, in a scenario where multiple services are deployed on multiple hosts, taking two hosts as an example, the hostnames host-01 and host-02, along with their corresponding service names, are extracted from JVM metrics data. The service names for host-01 include user-service and order-service, while those for host-02 include user-service and payment-service. Based on the hostname host-01 and the service name user-service, it can be determined that the sampling rate adjustment is applied to the user service on host-01, and similarly, based on the hostname host-02 and the service name user-service, it can be determined that the sampling rate adjustment is applied to the user service on host-02.
[0055] In some embodiments, hostname and service name information is extracted based on JVM metric data. For example, the hostname of the operating system where the Java Virtual Machine resides is obtained by calling the Java Runtime Environment interface (e.g., System.getenv()) or querying the Java Management Extensions interface. Service name information associated with the Java Virtual Machine instance is then extracted by parsing the runtime information of the Java Virtual Machine (e.g., JVM startup parameters obtained through RuntimeMXBean) or process information (e.g., the PID of the current JVM process and its corresponding command-line arguments).
[0056] In some embodiments, the initial trace sampling rate (trace_rate) may be a system-predefined setting or a setting made by the user according to actual conditions; however, this application is not limited to this.
[0057] In some embodiments, the JVM metric sampling rate may be a system-predefined setting or a user-defined setting based on actual conditions; however, this application is not limited to this.
[0058] In some embodiments, the adjustment frequency of the first tracing sampling rate is determined based on the JVM's acquisition frequency; wherein the JVM's acquisition frequency and the adjustment frequency of the first tracing sampling rate are the same or different.
[0059] For example, when the JVM acquisition frequency and the adjustment frequency of the first tracing sampling rate are different, the JVM acquisition frequency is once every 10 seconds, and the adjustment frequency of the first tracing sampling rate is once every 60 seconds. Initially, the JVM data indicators are stable at a high level. When the JVM data indicators are monitored to be stable at a low level within 60 seconds, the tracing sampling rate is adjusted. In this way, the current system resource usage can be monitored in real time, and decisions can be made based on the changes in system resources over multiple periods. This makes the sampling rate change smooth, effectively filters short-term interference, and truly reflects the long-term load status of the system.
[0060] In some embodiments, the corresponding service is determined based on the program ID corresponding to the service name information. For example, in a scenario where multiple services are deployed on a single host, the hostname (host) and multiple service name information are extracted based on JVM metric data. When all service name information is "user-service," the service corresponding to each service name information is determined based on the program ID corresponding to each service name information, such as "process 01" and "process 02." Based on the hostname (host) and the program ID "process 01" corresponding to the service name information "user-service," it can be determined that the sampling rate adjustment is performed on the user service with program ID "process 01" on that host. Thus, based on the hostname, service name information, and program ID, a specific service instance can be accurately located, thereby enabling fine-grained operations on specific instances.
[0061] The following is a further illustration of how to adjust the tracking sampling rate.
[0062] In some embodiments, a comprehensive resource stress score is calculated based on JVM metric data and system resource metric data. The tracing sampling rate corresponding to the corresponding service on the corresponding host is then adjusted based on the comprehensive resource stress score, the tracing sampling rate, and hostname and service name information. Specifically, for example, the corresponding service on the corresponding host is determined based on the hostname and service name information. JVM metric data and system resource metric data are obtained based on the corresponding service on the corresponding host, and a comprehensive resource stress score is calculated. The tracing sampling rate is then adjusted based on the comprehensive resource stress score and the obtained current tracing sampling rate of the corresponding service on the corresponding host.
[0063] For example, the overall resource stress score can be calculated using the following formula:
[0064]
[0065] Among them, w n R represents the weight corresponding to the nth data point in the system resource indicator data. n This represents the nth data point in the system resource indicator data; N is the total number of data points in the system resource indicator data; w m The weight corresponding to the m-th data point in the Java Virtual Machine's metric data; J m is the m-th data point in the Java Virtual Machine's metrics data; M is the total number of data points in the Java Virtual Machine's metrics data.
[0066] Therefore, by considering the impact of JVM metrics and system resource metrics on system load, multi-dimensional evaluation metrics are unified into a quantifiable calculation framework, making the assessment of system load more comprehensive and accurate, and adaptable to a wider range of scenarios.
[0067] In some embodiments, weight w n w m The system default settings or user-defined settings are used, and the sum of the weights of the JVM metrics and system resource metrics used as evaluation indicators is 1. For example, if JVM metrics include CPU utilization and garbage collection rate, and system resource metrics include memory utilization, bandwidth utilization, and packet loss rate, then the weight of CPU utilization is set to 0.3, memory utilization to 0.25, garbage collection rate to 0.2, bandwidth utilization to 0.15, and packet loss rate to 0.1.
[0068] In some embodiments, multiple consecutive comprehensive resource stress score intervals and multiple consecutive tracking sampling rate intervals are preset; based on the comprehensive resource stress score interval in which the comprehensive resource stress score is located and the tracking sampling rate interval in which the first tracking sampling rate is located, an adjustment strategy for the first tracking sampling rate is determined.
[0069] For example, three comprehensive resource stress score intervals are preset: a first comprehensive resource stress score interval, a second comprehensive resource stress score interval, and a third comprehensive resource stress score interval (e.g., divided into three intervals: [0, 20], [20, 80], and [80, 100]). Three tracking sampling rate intervals are preset: a first tracking sampling rate interval, a third tracking sampling rate interval, and a fourth tracking sampling rate interval (e.g., three intervals: [-∞, 0], [0, 100], and [100, +∞]). When the comprehensive resource stress score is within the first comprehensive resource stress score interval and the first tracking sampling rate is within the first tracking sampling rate interval, the first tracking sampling rate corresponding to the corresponding service on the corresponding host is reduced based on a fixed value or other related technologies. When the comprehensive resource stress score is within the second comprehensive resource stress score interval and the first tracking sampling rate is within the third tracking sampling rate interval, the first tracking sampling rate corresponding to the corresponding service on the corresponding host is increased based on a fixed value or other related technologies.
[0070] Therefore, based on the precise state of the current system, the most suitable adjustment strategy can be selected from predefined and differentiated strategies, thereby further improving the stability and reliability of the system.
[0071] In some embodiments, JVM metric data, system resource metric data, a first tracing sampling rate, hostname and service name information are input into a tracing sampling rate prediction model to predict a third tracing sampling rate; and based on the third tracing sampling rate, a second tracing sampling rate is updated, wherein the second tracing sampling rate is the first tracing sampling rate adjusted based on JVM metric data, system resource metric data, the first tracing sampling rate, hostname and service name information.
[0072] For example, historical data (i.e., JVM metric data, system resource metric data, first tracing sampling rate, hostname and service name information and the relationship with the second tracing sampling rate) is input into the tracing sampling rate prediction model to train the tracing sampling rate prediction model. Based on the currently acquired JVM metric data, system resource metric data, first tracing sampling rate, hostname and service name information, the tracing sampling rate prediction model predicts the third tracing sampling rate. This third tracing sampling rate is the second tracing sampling rate predicted by the tracing sampling rate prediction model. Based on this third tracing sampling rate, the second tracing sampling rate is updated.
[0073] For example, the third tracking sampling rate is compared with the second tracking sampling rate. When the difference between the two exceeds a preset threshold (e.g., the absolute difference exceeds 2%), or when the current system resource pressure is in an abnormal state, the third tracking sampling rate is set to the second tracking sampling rate. Alternatively, within the sampling period of each tracking sampling rate, the second tracking sampling rate is moved closer to the third tracking sampling rate by a certain proportion (e.g., each adjustment does not exceed 50% of the original value).
[0074] Therefore, by utilizing the correlation between historical data and the second tracking sampling rate, the tracking sampling rate prediction model can dynamically map the current resource status to the tracking sampling rate adjustment, thereby optimizing the second tracking sampling rate and improving the accuracy and efficiency of system monitoring.
[0075] The above provides an illustrative description of the link tracing sampling rate adjustment method of this application, but this application is not limited thereto. The following will further explain the processes or operations involved in this application.
[0076] Figure 2 This is a schematic diagram illustrating a process for adjusting the link tracing sampling rate according to an embodiment of this application. Figure 2 As shown, the link tracing sampling rate adjustment process includes:
[0077] 201. Obtain tracking metric data including the first tracking sampling rate, JAVA virtual machine metric data, and system resource metric data;
[0078] 202. Extract hostname and service name information from metric data based on the Java Virtual Machine;
[0079] 203. Calculate the comprehensive resource pressure score based on JAVA virtual machine indicator data and system resource indicator data;
[0080] 204. Determine whether the comprehensive resource pressure score is within the first comprehensive resource pressure score interval. If the result is yes, proceed to 205; if the result is no, proceed to 207.
[0081] 205. Determine whether the first tracking sampling rate is within the first tracking sampling rate range. If the result is yes, proceed to 206.
[0082] 206. After reducing the tracing sampling rate corresponding to the corresponding service on the corresponding host, execute 210;
[0083] 207. Determine whether the comprehensive resource pressure score is within the second comprehensive resource pressure score range. If the result is yes, proceed to 208.
[0084] 208. Determine whether the first tracking sampling rate is within the range of the second tracking sampling rate. If the result is yes, proceed to 209.
[0085] 209. After increasing the first tracking sampling rate corresponding to the corresponding service of the corresponding host, execute 210;
[0086] 210. Input the Java Virtual Machine metrics data, system resource metrics data, first tracing sampling rate, hostname, and service name information into the tracing sampling rate prediction model to predict the third tracing sampling rate.
[0087] 211. Based on the third tracking sampling rate, update the second tracking sampling rate (i.e., the adjusted first tracking sampling rate), and then execute 201.
[0088] It is worth noting that the above appendix Figure 2 The embodiments of this application have only been illustrated schematically, and the application is not limited thereto. For example, some of the above steps can be performed simultaneously or in a specific order, and the execution order between the various operations can be appropriately adjusted. Furthermore, other operations can be added or some operations can be removed. Those skilled in the art can make appropriate modifications based on the above description, and are not limited to the above-described embodiments. Figure 2 The records.
[0089] This invention also provides a link tracing sampling rate adjustment device, as described in the following embodiments. Since the principle by which this device solves the problem is similar to that of the link tracing sampling rate adjustment method, the implementation of this device can refer to the implementation of the link tracing sampling rate adjustment method; repeated details will not be elaborated further.
[0090] Figure 3This is a schematic diagram of a link tracing sampling rate adjustment device according to an embodiment of this application. Figure 3 As shown, the link tracing sampling rate adjustment device 300 includes:
[0091] The acquisition unit 301 acquires tracking indicator data including the first tracking sampling rate, JAVA virtual machine indicator data, and system resource indicator data; wherein the JAVA virtual machine indicator data includes at least one of CPU utilization and garbage collection rate, and the system resource indicator data includes at least one of memory utilization, bandwidth utilization, and packet loss rate.
[0092] Processing unit 302 extracts hostname and service name information based on JAVA virtual machine metric data; and
[0093] Based on JAVA virtual machine metrics data, system resource metrics data, first trace sampling rate, host name and service name information, adjust the first trace sampling rate corresponding to the corresponding service of the corresponding host.
[0094] In this embodiment, by considering JAVA virtual machine metrics, system resource metrics, tracing sampling rate, host name, and service name information, the automatic real-time adjustment of the link tracing sampling rate for a specific service on a specific host is achieved without manual intervention, reducing labor costs and avoiding data redundancy caused by improper sampling rate settings. Furthermore, this invention does not require the development of an additional management platform, reducing development workload. In addition, this invention has broad scenario adaptability and can effectively support complex application scenarios such as multiple hosts deploying the same service or one host deploying different services.
[0095] In some embodiments, the processing unit 302 determines the adjustment frequency of the first tracking sampling rate based on the JVM's acquisition frequency; wherein the JVM's acquisition frequency and the adjustment frequency of the first tracking sampling rate are the same or different.
[0096] In some embodiments, the processing unit 302 determines the corresponding service based on the program ID corresponding to the service name information. For example, in a scenario where multiple services are deployed on a host, based on JVM metric data, the processing unit 302 extracts the hostname (host) and multiple service name information of the host. When all the service name information is user-service, the processing unit 302 determines the service corresponding to each service name information according to the program ID corresponding to each service name information, such as process 01 and process 02. Based on the program ID process01 corresponding to the hostname (host) and the service name information user-service, the processing unit 302 can determine that the sampling rate adjustment is performed on the user service with program ID process 01 on the host.
[0097] The following is a further illustration of how to adjust the tracking sampling rate.
[0098] In some embodiments, based on JVM metric data and system resource metric data, the processing unit 302 calculates a comprehensive resource pressure score, and adjusts the tracking sampling rate corresponding to the corresponding service of the corresponding host based on the comprehensive resource pressure score, tracking sampling rate, host name and service name information.
[0099] For example, processing unit 302 can calculate the comprehensive resource pressure score according to the following formula:
[0100]
[0101] Among them, w n R represents the weight corresponding to the nth data point in the system resource indicator data. n This represents the nth data point in the system resource indicator data; N is the total number of data points in the system resource indicator data; w m The weight corresponding to the m-th data point in the Java Virtual Machine's metric data; J m is the m-th data point in the Java Virtual Machine's metrics data; M is the total number of data points in the Java Virtual Machine's metrics data.
[0102] Therefore, by considering the impact of JVM metrics and system resource metrics on system load, multi-dimensional evaluation metrics are unified into a quantifiable calculation framework, making the assessment of system load more comprehensive and accurate, and adaptable to a wider range of scenarios.
[0103] In some embodiments, the processing unit 302 presets multiple consecutive comprehensive resource pressure score intervals and multiple consecutive tracking sampling rate intervals; based on the comprehensive resource pressure score interval in which the comprehensive resource pressure score is located and the tracking sampling rate interval in which the first tracking sampling rate is located, the processing unit 302 determines the adjustment strategy of the first tracking sampling rate.
[0104] For example, the processing unit 302 presets three comprehensive resource pressure score intervals, namely the first comprehensive resource pressure score interval, the second comprehensive resource pressure score interval, and the third comprehensive resource pressure score interval (e.g., divided into three intervals: [0, 20], [20, 80], and [80, 100]). The processing unit 302 also presets three tracking sampling rate intervals, namely the first tracking sampling rate interval, the third tracking sampling rate interval, and the third tracking sampling rate interval (e.g., three intervals: [-∞, 0], [0, 100], and [100, +∞]). When the comprehensive resource pressure score is in the first comprehensive resource pressure score interval and the first tracking sampling rate is in the first tracking sampling rate interval, the processing unit 302 reduces the first tracking sampling rate corresponding to the corresponding service of the corresponding host by a fixed value. When the comprehensive resource pressure score is in the second comprehensive resource pressure score interval and the first tracking sampling rate is in the third tracking sampling rate interval, the processing unit 302 increases the first tracking sampling rate corresponding to the corresponding service of the corresponding host by a fixed value.
[0105] Therefore, based on the precise state of the current system, the most suitable adjustment strategy can be selected from predefined and differentiated strategies, thereby further improving the stability and reliability of the system.
[0106] In some embodiments, the link tracing sampling rate adjustment device further includes a link tracing sampling rate prediction unit 303, which inputs JVM metric data, system resource metric data, a first tracing sampling rate, host name and service name information into the tracing sampling rate prediction model of the link tracing sampling rate prediction unit 303, and the link tracing sampling rate prediction unit 303 predicts a third tracing sampling rate; the processing unit 302 updates the second tracing sampling rate (i.e., the adjusted first tracing sampling rate) based on the third tracing sampling rate.
[0107] For example, when comparing the third tracking sampling rate with the second tracking sampling rate, if the processing unit 302 determines that the difference between the two exceeds a preset threshold (e.g., the absolute difference exceeds 2%), or the current system resource pressure continues to be in an abnormal state, the processing unit 302 sets the third tracking sampling rate to the second tracking sampling rate. Alternatively, within the sampling period of each tracking sampling rate, the processing unit 302 moves the second tracking sampling rate closer to the third tracking sampling rate by a certain proportion (e.g., each adjustment does not exceed 50% of the original value).
[0108] Therefore, by utilizing the correlation between historical data and the second tracking sampling rate, the tracking sampling rate prediction model can dynamically map the current resource status to the tracking sampling rate adjustment, thereby optimizing the second tracking sampling rate and improving the accuracy and efficiency of system monitoring.
[0109] Figure 4This is a schematic diagram of the physical structure of an electronic device according to an embodiment of this application, as shown below. Figure 4 As shown, the electronic device includes a processor 410, a memory 420, and a bus 430.
[0110] The processor 410 and the memory 420 communicate with each other via the bus 430.
[0111] The processor 410 is used to call program instructions in the memory 420 to execute the methods provided in the above-described method embodiments.
[0112] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described link tracing sampling rate adjustment method.
[0113] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described link tracing sampling rate adjustment method.
[0114] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0115] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0116] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0117] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0118] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A link tracing sampling rate adjustment method, characterized in that, The method includes: Acquire tracking metric data including a first tracking sampling rate, JAVA virtual machine metric data, and system resource metric data; wherein the JAVA virtual machine metric data includes at least one of CPU utilization and garbage collection rate, and the system resource metric data includes at least one of memory utilization, bandwidth utilization, and packet loss rate; Based on the JAVA virtual machine's indicator data, hostname and service name information are extracted; and Based on the JAVA virtual machine metrics data, the system resource metrics data, the first tracking sampling rate, the host name, and the service name information, adjust the first tracking sampling rate corresponding to the corresponding service of the corresponding host.
2. The method according to claim 1, characterized in that, The method further includes: The adjustment frequency of the first tracking sampling rate is determined based on the acquisition frequency of the Java Virtual Machine.
3. The method according to claim 1, characterized in that, The corresponding service is determined based on the program ID corresponding to the service name information.
4. The method according to claim 1, characterized in that, The method further includes: A comprehensive resource pressure score is calculated based on the Java Virtual Machine indicator data and system resource indicator data; and Based on the comprehensive resource pressure score, the first tracking sampling rate, the host name, and the service name information, the first tracking sampling rate corresponding to the corresponding service of the corresponding host is adjusted.
5. The method according to claim 4, characterized in that, The comprehensive resource stress score is calculated using the following formula: Among them, w n The weight corresponding to the nth data point in the system resource index data; R n This refers to the nth data point in the system resource index data. N is the total number of data in the system resource index data; w m The weight is the value corresponding to the m-th data point in the JAVA virtual machine's metric data. J m This refers to the m-th data point in the JAVA virtual machine's metric data. M represents the total number of data points in the JAVA virtual machine's metric data.
6. The method according to claim 4, characterized in that, The method further includes: Multiple consecutive comprehensive resource pressure scoring intervals and multiple consecutive tracking sampling rate intervals are preset; Based on the comprehensive resource pressure score interval in which the comprehensive resource pressure score is located and the tracking sampling rate interval in which the first tracking sampling rate is located, an adjustment strategy for the first tracking sampling rate is determined.
7. The method according to claim 6, characterized in that, The method further includes: When the comprehensive resource pressure score is within the first comprehensive resource pressure score range and the first tracking sampling rate is within the first tracking sampling rate range, the first tracking sampling rate corresponding to the corresponding service of the corresponding host is reduced. When the comprehensive resource pressure score is within the second comprehensive resource pressure score range and the first tracking sampling rate is within the third tracking sampling rate range, the first tracking sampling rate corresponding to the corresponding service of the corresponding host is increased.
8. The method according to claim 1, characterized in that, The adjusted first tracking sampling rate is the second tracking sampling rate, and the method further includes: The JAVA virtual machine metric data, the system resource metric data, the first tracking sampling rate, the host name, and the service name information are input into the tracking sampling rate prediction model to predict the third tracking sampling rate. The second tracking sampling rate is updated based on the third tracking sampling rate.
9. A link tracing sampling rate adjustment device, characterized in that, The device includes: The acquisition unit acquires tracking indicator data including a first tracking sampling rate, JAVA virtual machine indicator data, and system resource indicator data; wherein the JAVA virtual machine indicator data includes at least one of CPU utilization and garbage collection rate, and the system resource indicator data includes at least one of memory utilization, bandwidth utilization, and packet loss rate. The processing unit extracts hostname and service name information based on the JAVA virtual machine's indicator data; and Based on the JAVA virtual machine metrics data, the system resource metrics data, the first tracking sampling rate, the host name, and the service name information, adjust the first tracking sampling rate corresponding to the corresponding service of the corresponding host.
10. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 1 to 8.
12. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method of any one of claims 1 to 8.
