Automatic cleaning method and apparatus for expired data, and electronic device
By automatically identifying and cleaning out expiration indicators in pushgateway, the accuracy problem caused by pulling out expiration data is solved, redundant data is reduced, and the overall service quality of the monitoring system is improved.
Patent Information
- Application Number
- PCT/CN2023/139632
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-29
- Filing Date
- 2023-12-18
- Publication Date
- 2024-12-05
AI Technical Summary
The existing pushgateway component cannot automatically delete the metric data pushed to it, resulting in Prometheus still pulling outdated data after the user stops pushing, affecting the accuracy of the monitoring data and increasing system pressure.
By obtaining all metrics in pushgateway, determining the metrics that have not received data after the push time interval, and marking them as expired metrics, rejecting Prometheus' pull request, realizing automatic cleaning.
Ensure the accuracy of data pulled by Prometheus, reduce redundant data, and improve the service quality of the monitoring system.
Smart Images

Figure CN2023139632_05122024_PF_FP_ABST
Abstract
Description
Automatic cleaning method, device and electronic device for expired data Technical Field
[0001] The present application relates to the field of wireless communication technology, and in particular to a method, device and electronic device for automatically clearing expired data. Background Art
[0002] Prometheus is an open source system monitoring and alerting system. Pushgateway is a component of Prometheus that pulls data and is responsible for supporting data pull operations. This component does not push data to Prometheus, but instead acts as an intermediate component to collect data metrics pushed from external sources. Prometheus will periodically pull data from Pushgateway. Currently, there is a problem with using Pushgateway: it never automatically deletes metrics pushed to it and permanently exposes the metrics to Prometheus. As a result, when a user stops pushing metrics, Prometheus still pulls the most recent data pushed to Pushgateway based on the metrics that have not been deleted. This will seriously affect the accuracy of monitoring data and generate unnecessary redundant data, which in turn puts pressure on the monitoring system and affects service quality.
[0003] Summary of the Invention
[0004] In order to solve the above problems, embodiments of the present application provide a method, device, and electronic device for automatically cleaning up expired data. In a first aspect, embodiments of the present application provide a method for automatically cleaning up expired data, the method comprising:
[0005] Get all first target indicators of the pushgateway at the current moment, where the first target indicators are the indicators pushed by the user to the pushgateway;
[0006] Determine each push time interval corresponding to each first target indicator, and determine a second target indicator based on the push time interval, where the second target indicator is the first target indicator that no push data from the user is received after the push time interval has passed;
[0007] Delete the second target indicator and reject Prometheus's pushgateway data pull request for the second target indicator.
[0008] Preferably, the determining of each push time interval corresponding to each first target indicator and determining a second target indicator based on the push time interval, wherein the second target indicator is a first target indicator for which no push data from the user is received after the push time interval has passed, includes:
[0009] Determine each push time interval corresponding to each first target indicator, and determine the last push time of each first target indicator;
[0010] The difference between each push time and the current time is calculated respectively to obtain each time difference value, and the first target indicator whose time difference value is greater than the push time interval is determined as the second target indicator.
[0011] Preferably, deleting the second target indicator and rejecting the pushgateway data pull request of Prometheus for the second target indicator includes:
[0012] Determining a third target indicator from each of the second target indicators, the third target indicator being a second target indicator in which the number of consecutive times that the user's push data is not received after the push time interval exceeds a preset number;
[0013] Delete the third target indicator and reject the pushgateway data pull request of Prometheus for the third target indicator.
[0014] Preferably, the prometheus will pull the push data in the pushgateway based on the first target indicator every time a preset pull time interval passes.
[0015] Preferably, the method further comprises:
[0016] Generate indicator deletion alarm information and send the indicator deletion alarm information to a preset terminal.
[0017] Preferably, the method further comprises:
[0018] Receive a data monitoring instruction, determine monitoring indicators of the data to be monitored based on the data monitoring instruction, and send the monitoring indicators to the pushgateway;
[0019] An expiration time of the monitoring indicator is determined based on the data monitoring instruction, and the monitoring indicator is deleted after the expiration time is reached.
[0020] Preferably, the method further comprises:
[0021] storing the second target indicator whose deletion duration does not exceed a preset duration in a preset storage space;
[0022] When the indicator recovery instruction is received, the second target indicator to be recovered is searched in the storage space, and the second target indicator to be recovered is sent to the pushgateway.
[0023] In a second aspect, an embodiment of the present application provides an automatic cleaning device for expired data, the device comprising:
[0024] An acquisition module, configured to acquire all first target indicators of the pushgateway at the current moment, where the first target indicators are indicators pushed by the user to the pushgateway;
[0025] A determination module, configured to determine each push time interval corresponding to each first target indicator, and determine a second target indicator based on the push time interval, where the second target indicator is the first target indicator in which no push data from the user has been received after the push time interval has elapsed;
[0026] A deletion module is used to delete the second target indicator and reject the pushgateway data pull request of Prometheus for the second target indicator.
[0027] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein when the processor executes the computer program, the steps of the method provided in the first aspect or any possible implementation of the first aspect are implemented.
[0028] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method provided in the first aspect or any possible implementation of the first aspect.
[0029] The beneficial effects of the present invention are: it can automatically clean up expired indicators in the pushgateway, ensure the accuracy of the data pulled by prometheus, reduce unnecessary redundant data for the system, and ensure the overall service quality of the monitoring system. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments. 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 creative work.
[0031] FIG1 is a flow chart of a method for automatically cleaning up expired data provided by an embodiment of the present application;
[0032] FIG2 is a schematic diagram of the structure of an automatic cleaning device for expired data provided by an embodiment of the present application;
[0033] FIG3 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. In the following introduction, the terms "first" and "second" are only used for descriptive purposes and should not be understood as indicating or implying relative importance. The following introduction provides multiple embodiments of the present application, and different embodiments can be replaced or combined, so the present application can also be considered to include all possible combinations of the same and / or different embodiments described. Therefore, if one embodiment includes features A, B, and C, and another embodiment includes features B and D, then the present application should also be considered to include embodiments containing one or more of all other possible combinations of A, B, C, and D, even though the embodiment may not be clearly described in the following text.
[0035] The following description provides examples and does not limit the scope, applicability, or examples set forth in the claims. Changes may be made to the function and arrangement of the elements described without departing from the scope of the present application. Various examples may appropriately omit, replace, or add various processes or components. For example, the described method may be performed in an order different from the order described, and various steps may be added, omitted, or combined. In addition, features described in some examples may be combined in other examples.
[0036] See Figure 1, which is a flow chart of an automatic cleanup method for expired data provided by an embodiment of the present application. In the embodiment of the present application, the method includes:
[0037] S101. Obtain all first target indicators of the pushgateway at the current moment, where the first target indicators are indicators pushed to the pushgateway by the user.
[0038] The execution entity of this application can be the cloud server corresponding to the prometheus system.
[0039] In one embodiment of the present application, a user pulls a remote specified branch to a local specified branch through a push operation. Specifically, the user's corresponding indicator is pulled into the pushgateway. The cloud server first obtains and determines which indicators the pushgateway has pushed at the current moment, i.e., the first target indicator.
[0040] S102: Determine each push time interval corresponding to each first target indicator, and determine a second target indicator based on the push time interval, where the second target indicator is the first target indicator that has not received any push data from the user after the push time interval.
[0041] In one embodiment of the present application, each first target indicator can be provided with a corresponding timestamp. According to the timestamp, the push time interval corresponding to each first target indicator can be determined, that is, how long the user will send push information to the pushgateway through the first target indicator. According to the push time interval, combined with the current moment, the second target indicator can be determined, that is, the first target indicator that has passed the push time interval but has not received push data, and these indicators will be considered expired indicators. The pushgateway component itself does not support the identification and deletion of indicators, so these indicators will remain in the pushgateway after the user stops pushing and expires and becomes invalid, which will cause prometheus to still pull the most recent push data to the pushgateway based on these indicators in the pushgateway, affecting the accuracy of the prometheus monitoring data.
[0042] In one embodiment, step S102 includes:
[0043] Determine each push time interval corresponding to each first target indicator, and determine the last push time of each first target indicator;
[0044] The difference between each push time and the current time is calculated respectively to obtain each time difference value, and the first target indicator whose time difference value is greater than the push time interval is determined as the second target indicator.
[0045] In one embodiment of the present application, in addition to confirming the push time interval corresponding to each first target indicator, the push time of each first target indicator when the user last pushed data is also confirmed. The time difference can be calculated by the difference between the push time and the current time. The time difference is the length of time that has passed since the last data was pushed. If the time difference is greater than the push time interval, it is considered that the target indicator has not pulled the push data after the push time interval, and the target indicator is determined as the second target indicator.
[0046] S103: Delete the second target indicator and reject the pushgateway data pull request of Prometheus for the second target indicator.
[0047] In one embodiment of the present application, after determining the second target indicator, that is, the expired indicator, these indicators will be deleted to prevent Prometheus from continuing to pull data through these indicators. In addition, Prometheus pulls the data in the pushgateway at every preset pull time interval. Therefore, it may happen that the pull time interval has just passed and Prometheus is about to pull the push data according to the second target indicator. However, under the premise that the second target indicator expires, these push data should not be pulled, so when deleting the second target indicator, the cloud server will also reject the pushgateway data pull request that exists at the current moment.
[0048] In one embodiment, step S103 includes:
[0049] Determining a third target indicator from each of the second target indicators, the third target indicator being a second target indicator in which the number of consecutive times that the user's push data is not received after the push time interval exceeds a preset number;
[0050] Delete the third target indicator and reject the pushgateway data pull request of Prometheus for the third target indicator.
[0051] In one embodiment of the present application, in order to avoid the occasional situation where the push data is not pulled in time after the push time interval due to network jitter, which affects the judgment result. A preset number of times (such as 3 times) will be set in advance. Among the second target indicators obtained, only the second target indicator that has not received the push data for the preset number of consecutive times will be identified as the third target indicator. The third target indicator is the expired indicator that is finally confirmed to need to be deleted, so the cloud server will delete each third target indicator and reject the pushgateway data pull request of prometheus for the third target indicator.
[0052] In one possible implementation, the prometheus pulls the push data in the pushgateway based on the first target indicator every time a preset pull time interval passes.
[0053] In one embodiment of the present application, a pull time interval is pre-set for Prometheus. Every time the pull time interval passes, Prometheus pulls the push data corresponding to the first target indicator in the pushgateway.
[0054] In one embodiment, the method further comprises:
[0055] Generate indicator deletion alarm information and send the indicator deletion alarm information to a preset terminal.
[0056] In one embodiment of the present application, the engineer / person in charge of managing the Prometheus system will pre-set a preset terminal in the cloud server. After deleting the corresponding expired indicator, a corresponding indicator deletion alarm message will be generated. The cloud server will send this information to the preset terminal to inform relevant personnel that the indicator has been deleted due to being determined to be an expired indicator, so that relevant personnel can promptly understand the actual situation of the PushGateway component. The preset terminal can be a mobile terminal, a computer terminal, a tablet terminal, etc.
[0057] In one embodiment, the method further comprises:
[0058] Receive a data monitoring instruction, determine monitoring indicators of the data to be monitored based on the data monitoring instruction, and send the monitoring indicators to the pushgateway;
[0059] An expiration time of the monitoring indicator is determined based on the data monitoring instruction, and the monitoring indicator is deleted after the expiration time is reached.
[0060] In one embodiment of the present application, users can also customize some data that needs to be monitored regularly and send data monitoring instructions to the cloud server. After receiving the data monitoring instructions, the cloud server will determine the data to be monitored and the monitoring indicators corresponding to the monitored data based on the received instructions, and send the monitoring indicators to the pushgateway, so that Prometheus can subsequently pull the monitoring data from the pushgateway based on the monitoring indicators. In addition, the monitoring indicators are set with an expiration time, and the monitoring indicators will be automatically deleted after the expiration time is reached.
[0061] In one embodiment, the method further comprises:
[0062] storing the second target indicator whose deletion duration does not exceed a preset duration in a preset storage space;
[0063] When the indicator recovery instruction is received, the second target indicator to be recovered is searched in the storage space, and the second target indicator to be recovered is sent to the pushgateway.
[0064] In one embodiment of the present application, in some cases, the user may need to retain certain second target indicators that are determined to be overdue due to special reasons such as debugging and testing. Therefore, after the second target indicator is deleted in the pushgateway, a storage space will be reserved in the server for temporary storage of the second target indicator whose deletion duration does not exceed the preset duration (such as 1 day). If no instruction is received within the preset duration, the second target indicator will be formally and completely deleted. If an indicator recovery instruction is received from the terminal corresponding to the corresponding person in charge or engineer, the second target indicator to be restored in the storage space will be determined according to the indicator recovery instruction, and sent to the pushgateway.
[0065] The following will be combined with Figure 2 to provide a detailed introduction to the automatic cleanup device for expired data provided by the embodiment of the present application. It should be noted that the automatic cleanup device for expired data shown in Figure 2 is used to execute the method of the embodiment shown in Figure 1 of the present application. For ease of explanation, only the parts related to the embodiment of the present application are shown. For specific technical details not disclosed, please refer to the embodiment shown in Figure 1 of the present application.
[0066] Please refer to Figure 2, which is a schematic diagram of the structure of an automatic cleaning device for expired data provided by an embodiment of the present application. As shown in Figure 2, the device includes:
[0067] The acquisition module 201 is used to obtain all first target indicators of the pushgateway at the current moment, where the first target indicators are indicators pushed to the pushgateway by the user;
[0068] A determination module 202 is configured to determine each push time interval corresponding to each first target indicator, and determine a second target indicator based on the push time interval, where the second target indicator is the first target indicator for which no push data from the user has been received after the push time interval has elapsed;
[0069] The deletion module 203 is used to delete the second target indicator and reject the pushgateway data pull request of Prometheus for the second target indicator.
[0070] In one embodiment, the determining module 202 includes:
[0071] a first determining unit, configured to determine each push time interval corresponding to each of the first target indicators, and determine the last push time of each of the first target indicators;
[0072] The calculation unit is used to calculate the difference between each push time and the current time respectively to obtain each time difference value, and determine the first target indicator whose time difference value is greater than the push time interval as the second target indicator.
[0073] In one embodiment, the deletion module 203 includes:
[0074] a second determining unit, configured to determine a third target indicator from each of the second target indicators, the third target indicator being a second target indicator in which a number of consecutive times that push data from the user is not received after the push time interval exceeds a preset number;
[0075] The rejection unit is used to delete the third target indicator and reject the pushgateway data pull request of Prometheus for the third target indicator.
[0076] In one possible implementation, the prometheus pulls the push data in the pushgateway based on the first target indicator every time a preset pull time interval passes.
[0077] In one embodiment, the device further comprises:
[0078] The generating module is used to generate indicator deletion alarm information and send the indicator deletion alarm information to a preset terminal.
[0079] In one embodiment, the device further comprises:
[0080] A first receiving module is configured to receive a data monitoring instruction, determine a monitoring indicator of the data to be monitored based on the data monitoring instruction, and send the monitoring indicator to the pushgateway;
[0081] A processing module is used to determine an expiration time of the monitoring indicator based on the data monitoring instruction, and delete the monitoring indicator after the expiration time is reached.
[0082] In one embodiment, the device further comprises:
[0083] A storage module, configured to store the second target indicator whose deletion duration does not exceed a preset duration in a preset storage space;
[0084] The second receiving module is configured to, upon receiving an indicator recovery instruction, search the storage space for a second target indicator to be recovered, and send the second target indicator to be recovered to the pushgateway.
[0085] Those skilled in the art will clearly understand that the technical solutions of the embodiments of the present application can be implemented with the help of software and / or hardware. "Unit" and "module" in this specification refer to software and / or hardware that can independently perform or cooperate with other components to perform specific functions, where the hardware can be, for example, a field programmable gate array (FPGA), an integrated circuit (IC), etc.
[0086] Each processing unit and / or module in the embodiments of the present application may be implemented by an analog circuit that implements the functions described in the embodiments of the present application, or may be implemented by software that executes the functions described in the embodiments of the present application.
[0087] Referring to Figure 3, which shows a schematic diagram of the structure of an electronic device involved in an embodiment of the present application, the electronic device can be used to implement the method in the embodiment shown in Figure 1. As shown in Figure 3, the electronic device 300 may include: at least one central processing unit 301, at least one network interface 304, a user interface 303, a memory 305, and at least one communication bus 302.
[0088] The communication bus 302 is used to implement the connection and communication between these components.
[0089] The user interface 303 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.
[0090] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0091] The central processing unit 301 may include one or more processing cores. The central processing unit 301 utilizes various interfaces and circuits to connect various components within the entire electronic device 300. It executes instructions, programs, code sets, or instruction sets stored in the memory 305, and accesses data stored in the memory 305 to perform various functions and process data for the terminal 300. Optionally, the central processing unit 301 may be implemented using at least one hardware form factor selected from the group consisting of a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The central processing unit 301 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content displayed on the display; and the modem handles wireless communications. It is understood that the modem may not be integrated into the central processing unit 301 and may be implemented as a separate chip.
[0092] Among them, the memory 305 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 305 may also be at least one storage device located away from the aforementioned central processing unit 301. As shown in Figure 3, the memory 305 as a computer storage medium may include an operating system, a network communication module, a user interface module and program instructions.
[0093] In the electronic device 300 shown in FIG3 , the user interface 303 is mainly used to provide an input interface for the user and obtain data input by the user; and the central processing unit 301 can be used to call the automatic cleaning application for expired data stored in the memory 305 and specifically perform the following operations:
[0094] Get all first target indicators of the pushgateway at the current moment, where the first target indicators are the indicators pushed by the user to the pushgateway;
[0095] Determine each push time interval corresponding to each first target indicator, and determine a second target indicator based on the push time interval, where the second target indicator is the first target indicator that no push data from the user is received after the push time interval has passed;
[0096] Delete the second target indicator and reject Prometheus's pushgateway data pull request for the second target indicator.
[0097] The present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above method. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a microdrive, a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.
[0098] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0099] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0100] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interface, and the indirect coupling or communication connection of the device or unit can be electrical or other forms.
[0101] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0102] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0103] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0104] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0105] The above is only an exemplary embodiment of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the specification and practicing the disclosure herein, those skilled in the art will easily think of the implementation scheme of the present disclosure. This application is intended to cover any variation, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the art that are not recorded in the present disclosure. The description and examples are to be regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A method for automatically cleaning up expired data, characterized in that: The method comprises: Get all first target indicators of the pushgateway at the current moment, where the first target indicator is the indicator pushed to the pushgateway by the user; Determine each push time interval corresponding to each first target indicator, and determine a second target indicator based on the push time interval, where the second target indicator is the first target indicator that has not received push data from the user after the push time interval has passed; Delete the second target indicator and reject the pushgateway data pull request of Prometheus for the second target indicator.
2. The method according to claim 1, characterized in that The determining of each push time interval corresponding to each first target indicator, and determining a second target indicator based on the push time interval, wherein the second target indicator is a first target indicator that does not receive push data from the user after the push time interval has passed, includes: Determine each push time interval corresponding to each of the first target indicators, and determine the last push time of each of the first target indicators; The difference between each push time and the current time is calculated respectively to obtain each time difference value, and the first target indicator whose time difference value is greater than the push time interval is determined as the second target indicator.
3. The method according to claim 1, characterized in that The deleting the second target indicator and rejecting the pushgateway data pull request of prometheus for the second target indicator includes: Determine a third target indicator among the second target indicators, the third target indicator being the second target indicator that the number of consecutive times that the push data of the user is not received after the push time interval exceeds a preset number; Delete the third target indicator, and reject the pushgateway data pull request of Prometheus for the third target indicator.
4. The method according to claim 1, characterized in that: The prometheus will pull the push data in the pushgateway based on the first target indicator every preset pull time interval.
5. The method according to claim 1, characterized in that The method further comprises: Generate indicator deletion alarm information, and send the indicator deletion alarm information to a preset terminal.
6. The method according to claim 1, characterized in that The method further comprises: Receive a data monitoring instruction, determine a monitoring indicator of the data to be monitored based on the data monitoring instruction, and send the monitoring indicator to the pushgateway; An expiration time of the monitoring indicator is determined based on the data monitoring instruction, and the monitoring indicator is deleted after the expiration time is reached.
7. The method according to claim 1, characterized in that The method further comprises: storing the second target indicator whose deletion duration does not exceed a preset duration in a preset storage space; When the indicator recovery instruction is received, the second target indicator to be recovered is searched in the storage space, and the second target indicator to be recovered is sent to the pushgateway.
8. An automatic cleaning device for expired data, characterized in that: The device comprises: An acquisition module, used to acquire all first target indicators of the pushgateway at the current moment, where the first target indicator is an indicator pushed to the pushgateway by the user; A determination module, configured to determine each push time interval corresponding to each of the first target indicators, and determine a second target indicator based on the push time interval, wherein the second target indicator is the first target indicator that has not received push data from the user after the push time interval has passed; A deletion module is used to delete the second target indicator and reject the pushgateway data pull request of Prometheus for the second target indicator.
9. An electronic 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, 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.
Citation Information
Patent Citations
Method and device for processing monitoring data in client
CN110856040A
System monitoring device and method based on prometheus service
CN113986649A
Method and device for clearing expired data, storage medium and computer equipment
CN115391318A
Automatic cleaning method and device for expired data and electronic equipment
CN116340732A
Leadership support system determining a danger of isolation of a group member even under temporarily worsened communication conditions
US20080201164A1
Cited By
Electric energy meter reading method and system based on electricity utilization information acquisition terminal
CN119357564A
A method and system for reading electric energy meters based on electric energy information collection terminal
CN119357564B
