Prometheus remote write optimization method and device

By analyzing Prometheus configuration files and real-time monitoring of data changes, collecting and writing to remote storage, and adjusting computing resources, the resource limitation and backup storage coupling problems of Prometheus monitoring solution when the data scale is large, achieving high availability and independent maintenance monitoring data storage.

CN118981408APending Publication Date: 2024-11-19CHINA UNICOM ONLINE INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411076825.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-11-19

AI Technical Summary

Technical Problem

When the data scale of the Prometheus monitoring solution is huge, the single instance and single node resource limitation becomes a bottleneck, and the backup storage logic is coupled with the main monitoring program, resulting in affecting normal services in the event of abnormal crash.

Method used

By analyzing the Prometheus configuration file, obtain data storage location information, monitor data changes in real time, collect and update data and write it to remote storage, adjust the configuration computing resources according to the data processing pressure, and use distributed locks to ensure high availability of data processing.

Benefits of technology

It realizes the decoupling of Prometheus monitoring data and the main monitoring program, independently maintains and upgrades, supports high-availability storage logic, does not affect the other party's normal services, and also expands support different simultaneous databases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118981408A_ABST
    Figure CN118981408A_ABST
Patent Text Reader

Abstract

The invention relates to a Prometheus remote write optimization method and a Prometheus remote write optimization device, and the Prometheus remote write optimization method comprises the following steps: analyzing a Prometheus configuration file to obtain data storage position information; according to the data storage position information, Prometheus monitoring data changes are monitored in real time, and updated data are collected; the updated data is written into remote storage after being processed; and according to a preset period, calculating data processing pressure so as to adjust and configure computing power resources according to the data processing pressure. According to the method, the method for backing up and storing the Prometheus monitoring data to the far-end database is optimized, the method is not coupled with a Prometheus main body monitoring program, the Prometheus main body monitoring program and the Prometheus main body monitoring program can be independently maintained and upgraded, normal service of the opposite side is not affected, and meanwhile different time sequence databases can be expanded and supported.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of monitoring technology, and in particular to a Prometheus remote write optimization method and device. Background Art

[0002] The Prometheus monitoring solution has been widely adopted in the industry. It has a rich data model and adopts a pull model strategy design, which can better describe data in various scenarios. The monitored object exposes monitoring data through the local http service, and Prometheus collects the monitoring data and stores it in a local or remote time series database. The default method of Prometheus is to store data locally, which is more suitable for short-term data storage. When the data scale gradually becomes large, the single-instance single-node resource limitation becomes its bottleneck. Although Prometheus provides a solution to store collected data in a remote database, its own backup storage logic is bound to the logic of the Prometheus main monitoring program. When either of them crashes abnormally, the normal service of the other will also be affected. Therefore, how to overcome the above problems, realize the decoupling of the main monitoring program and the monitoring data backup to the remote end, and support the high availability of the storage logic at the same time, is a technical problem that needs to be solved. Summary of the invention

[0003] The present application intends to provide a Prometheus remote write optimization method and device, an electronic device, and a storage medium. The technical problem to be solved is achieved through the following technical solutions.

[0004] In a first aspect of this embodiment, a Prometheus remote write optimization method is proposed, including:

[0005] Parse the Prometheus configuration file to obtain data storage location information;

[0006] Based on the data storage location information, monitor Prometheus data changes in real time and collect updated data;

[0007] After data processing, the updated data is written to the remote storage;

[0008] The data processing pressure is calculated according to a preset period so as to adjust the configuration of computing power resources according to the data processing pressure.

[0009] Furthermore, based on the data storage location information, Prometheus monitors data changes in real time and collects updated data, including:

[0010] Check the log files of Prometheus monitoring data according to the preset monitoring cycle;

[0011] When the content of the log file is updated, the log file is parsed to obtain the most recently updated data of the monitoring data.

[0012] Furthermore, based on the data storage location information, Prometheus data storage events are monitored in real time to collect and update data, which also includes:

[0013] Get the number and update time of the most recently updated monitoring indicators;

[0014] Send the monitoring indicator quantity and the update time to the Prometheus monitoring system.

[0015] Furthermore, according to a preset period, the data processing pressure is calculated, including:

[0016] Obtaining the number of items and processing time for data processing of the update data;

[0017] Get the data processing speed within the processing time;

[0018] According to a preset cycle, a ratio of data processing speed to processing time is used as the data processing pressure.

[0019] Furthermore, according to the data processing pressure, the computing resources are adjusted and configured, including:

[0020] When the data processing pressure is greater than a preset pressure threshold, increasing the number of processing threads until the maximum number of processing threads is reached;

[0021] When the data processing pressure is less than or equal to a preset pressure threshold, the processing thread is destroyed.

[0022] Furthermore, the number of processing threads and processing thread time are obtained and sent to the Prometheus monitoring system.

[0023] Furthermore, it also includes:

[0024] When the update data fails to be written to the remote storage after data processing, rewrite it and record the alarm information; and / or,

[0025] Use distributed locks to synchronize the running status of deployed Prometheus instances. When an abnormal downtime occurs, the normally running Prometheus instances continue to process data.

[0026] In a second aspect of this embodiment, a Prometheus remote write optimization device is proposed, including:

[0027] Configuration parsing module, used to parse the Prometheus configuration file and obtain data storage location information;

[0028] The data monitoring module is used to monitor Prometheus monitoring data changes in real time and collect update data based on data storage location information;

[0029] A data processing module is used to process the updated data and write it into remote storage;

[0030] The computing power adjustment module is used to calculate the data processing pressure according to a preset period so as to adjust the configuration of computing power resources according to the data processing pressure.

[0031] In a third aspect of the present embodiment, an electronic device is proposed, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the first aspect when executing the computer program.

[0032] In a fourth aspect of the present embodiment, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0033] The embodiments of the present application include the following advantages:

[0034] The Prometheus remote write optimization method provided in the embodiment of the present application first parses the Prometheus configuration file to obtain data storage location information; then, based on the data storage location information, monitors the Prometheus monitoring data changes in real time and collects update data; writes the update data to remote storage after data processing; calculates the data processing pressure based on a preset period, so as to adjust the configuration of computing resources based on the data processing pressure. The present application optimizes the method of backing up and storing Prometheus monitoring data in a remote database, which is not coupled with the Prometheus main monitoring program. The two can be maintained and upgraded independently without affecting each other's normal services, and can be expanded to support different time series databases. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Attached Figure 1 This is one of the flow charts of the Prometheus remote write optimization method according to an embodiment of the present application;

[0036] Attached Figure 2 This is the second flowchart of the Prometheus remote write optimization method in the embodiment of the present application;

[0037] Attached Figure 3 This is the third flowchart of the Prometheus remote write optimization method of the embodiment of the present application;

[0038] Attached Figure 4This is the fourth flowchart of the Prometheus remote write optimization method of the embodiment of the present application;

[0039] Attached Figure 5 This is the fifth flowchart of the Prometheus remote write optimization method of the embodiment of the present application;

[0040] Attached Figure 6 This is the sixth flowchart of the Prometheus remote write optimization method of the embodiment of the present application;

[0041] Attached Figure 7 This is a schematic diagram of the structure of the Prometheus remote write optimization device in an embodiment of the present application;

[0042] Attached Figure 8 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0044] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0045] As described in the background technology, the Prometheus monitoring solution has been widely adopted in the industry. It has a rich data model and adopts a pull model strategy design, which can better describe various scenario data. The monitored object exposes monitoring data through the local http service, and Prometheus collects the monitoring data and stores it in a local or remote time series database. The default method of Prometheus is to store data locally, which is more suitable for short-term data storage. When the data scale gradually becomes large, the single-instance single-node resource limitation becomes its bottleneck. Although Prometheus provides a solution for storing collected data in a remote database, its own backup storage logic is bound to the Prometheus main monitoring program logic. When either of them crashes abnormally, it will also affect the normal service of the other party. Therefore, it is necessary to optimize the main monitoring program and monitor data backup to the remote end to achieve decoupling, while supporting high availability of storage logic.

[0046] As attached Figure 1FIG. 1 is a flow chart of a handwriting recognition model training method according to an embodiment of the present application. The method comprises:

[0047] S101: Parse the Prometheus configuration file to obtain data storage location information.

[0048] S102: Based on the data storage location information, monitor Prometheus monitoring data changes in real time and collect update data.

[0049] S103: After data processing, the updated data is written into the remote storage.

[0050] S104: Calculate data processing pressure according to a preset period, so as to adjust the configuration of computing resources according to the data processing pressure.

[0051] In some embodiments, based on the data storage location information, Prometheus monitors data changes in real time and collects updated data, such as Figure 2 As shown, including:

[0052] S211: Check the log file of Prometheus monitoring data according to the preset monitoring cycle.

[0053] S212: When the content of the log file is updated, the log file is parsed to obtain the most recently updated data of the monitoring data.

[0054] In some embodiments, based on the data storage location information, Prometheus data storage events are monitored in real time to collect update data, such as Figure 3 As shown, it also includes:

[0055] S213: Obtain the number and update time of the most recently updated monitoring indicators.

[0056] S214: Send the monitoring indicator quantity and the update time to the Prometheus monitoring system.

[0057] Specifically, in order to ensure the timeliness of monitoring data collection and storage, first read the Prometheus configuration information, parse it to obtain the monitoring data storage location information; check the log file where Prometheus stores monitoring data at regular intervals, such as 30 milliseconds, and parse the log file when a file change is found. The Prometheus log file code can be reused for parsing, and the updated monitoring data is written to the remote storage. On this basis, monitoring items can also be added to monitor the module itself. For example, when a log update occurs, the number of updated indicators and the time of the update are calculated as monitoring indicators, and then sent to the monitoring system through the standard collection method of Prometheus, that is, the http protocol implemented in the protocol format specified by Prometheus, to monitor the real-time monitoring collection status.

[0058] In some embodiments, the data processing pressure is calculated according to a preset period, such as Figure 4 As shown, including:

[0059] S411: Obtain the number of items and processing time for data processing the update data.

[0060] S412: Obtain the data processing speed within the processing time.

[0061] S413: According to a preset cycle, a ratio of data processing speed to processing time is used as the data processing pressure.

[0062] In some embodiments, according to the data processing pressure, the computing resources are adjusted and configured, such as Figure 5 As shown, including:

[0063] S511: When the data processing pressure is greater than a preset pressure threshold, increase the number of processing threads until the maximum number of processing threads is reached.

[0064] S512: When the data processing pressure is less than or equal to a preset pressure threshold, destroy the processing thread.

[0065] In some embodiments, the number of processing threads and the processing thread time are obtained and sent to a Prometheus monitoring system.

[0066] Specifically, when an update is found and data processing is performed, the number of data processing entries and the processing time can be calculated to obtain a certain period of time in the past, such as the data processing speed a in the past 200 milliseconds and the number of processed data entries b in the past 200 milliseconds. The ratio of the number of processed data entries to the data processing speed during this period, that is, b / a, is used as the data processing pressure value. The above data processing pressure value can be calculated every second. When the data processing pressure value is higher than the set pressure value, a processing thread is added. When the maximum number of processing threads is exceeded, no adjustment is made. When the data processing pressure value is equal to or lower than the set pressure value, the processing thread is automatically destroyed. At the same time, the expansion time and the number of processing threads in the above processing process are recorded and sent to the monitoring system through the standard collection method of Prometheus standard method, that is, the http protocol implemented in the protocol format specified by Prometheus, so as to realize the tracking and monitoring of the computing power adjustment status.

[0067] In some embodiments, the above method is as follows Figure 6 As shown, it also includes:

[0068] S105: When the update data fails to be written into the remote storage after data processing, re-write the data and record an alarm message.

[0069] S106: Use distributed locks to synchronize the running status of deployed Prometheus instances. When an abnormal downtime occurs, the normally running Prometheus instance continues to process data.

[0070] The Prometheus remote write optimization method provided in the embodiment of the present application first parses the Prometheus configuration file to obtain data storage location information; then, based on the data storage location information, monitors the Prometheus monitoring data changes in real time and collects update data; writes the update data to remote storage after data processing; calculates the data processing pressure based on a preset period, so as to adjust the configuration of computing resources based on the data processing pressure. The present application optimizes the method of backing up and storing Prometheus monitoring data in a remote database, which is not coupled with the Prometheus main monitoring program. The two can be maintained and upgraded independently without affecting each other's normal services, and can be expanded to support different time series databases.

[0071] Attached Figure 7 Schematic diagram of a Prometheus remote write optimization device provided in an embodiment of the present application. Figure 7 As shown, the Prometheus remote write optimization device includes:

[0072] The configuration parsing module 701 is used to parse the Prometheus configuration file to obtain data storage location information.

[0073] The data monitoring module 702 is used to monitor the changes of Prometheus monitoring data in real time and collect and update data according to the data storage location information.

[0074] The data processing module 703 is used to process the updated data and then write it into the remote storage.

[0075] The computing power adjustment module 704 is used to calculate the data processing pressure according to a preset period, so as to adjust the configuration of computing power resources according to the data processing pressure.

[0076] It should be understood that a Prometheus remote write optimization device in the embodiment of this specification can also execute the attached Figure 1 To Attachment Figure 6 The method for executing the Prometheus remote write optimization device in the attached Figure 1 To Attachment Figure 6 The functions of the example shown will not be described in detail here.

[0077] At the same time, the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0078] Attached Figure 8 Schematic diagram of an electronic device 8 provided in an embodiment of the present application. Figure 8 As shown, the electronic device 8 of this embodiment includes: a processor 801, a memory 802, and a computer program 803 stored in the memory 802 and executable on the processor 801. When the processor 801 executes the computer program 803, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 801 executes the computer program 803, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0079] The electronic device 8 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 8 may include, but is not limited to, a processor 801 and a memory 802. Those skilled in the art will appreciate that the attached Figure 8 The electronic device 8 is merely an example and does not limit the electronic device 8 . The electronic device 8 may include more or fewer components than those shown in the figure, or different components.

[0080] The memory 802 may be an internal storage unit of the electronic device 8, for example, a hard disk or memory of the electronic device 8. The memory 802 may also be an external storage device of the electronic device 8, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 8. The memory 802 may also include both an internal storage unit of the electronic device 8 and an external storage device. The memory 802 is used to store computer programs and other programs and data required by the electronic device.

[0081] The processor 801 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 801 reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a shared resource access control device at the logical level. The processor executes the program stored in the memory, and is specifically used to perform the following operations:

[0082] Parse the Prometheus configuration file to obtain data storage location information;

[0083] Based on the data storage location information, monitor Prometheus data changes in real time and collect updated data;

[0084] After data processing, the updated data is written to the remote storage;

[0085] The data processing pressure is calculated according to a preset period so as to adjust the configuration of computing power resources according to the data processing pressure.

[0086] The above is as attached to this manual Figure 1 To Attachment Figure 6The method disclosed in the illustrated embodiment can be applied to the processor 801, or implemented by the processor 801. The processor 801 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of this specification. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of this specification can be directly embodied as a hardware decoding processor to perform, or a combination of hardware and software modules in the decoding processor to perform. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0087] Of course, in addition to software implementation, the electronic device of the embodiments of this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0088] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0089] If the integrated module / 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 storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.

[0090] The embodiment of the present specification also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by a portable electronic device including a plurality of application programs, enable the portable electronic device to execute an attached program. Figure 1 To Attachment Figure 6 The method disclosed in the illustrated embodiment is specifically used to perform the following method:

[0091] Parse the Prometheus configuration file to obtain data storage location information;

[0092] Based on the data storage location information, monitor Prometheus data changes in real time and collect updated data;

[0093] After data processing, the updated data is written to the remote storage;

[0094] The data processing pressure is calculated according to a preset period so as to adjust the configuration of computing power resources according to the data processing pressure.

[0095] In short, the above is only a preferred embodiment of this specification, and is not intended to limit the protection scope of this specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification should be included in the protection scope of this specification.

[0096] It should be noted that the above detailed descriptions are exemplary and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the art to which the present application belongs.

[0097] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should also be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0098] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein.

[0099] In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or inherent to these processes, methods, products, or apparatuses.

[0100] For ease of description, spatially relative terms, such as "above", "above", "on the upper surface of", "above", etc., may be used herein to describe the spatial positional relationship between a device or feature and other devices or features as shown in the figure. It should be understood that spatially relative terms are intended to include different orientations of the device in use or operation in addition to the orientation described in the figure. For example, if the device in the accompanying drawings is inverted, the device described as "above other devices or structures" or "above other devices or structures" will be positioned as "below other devices or structures" or "below other devices or structures". Thus, the exemplary term "above" may include both "above" and "below". The device may also be positioned in other different ways, such as rotated 90 degrees or in other orientations, and the spatially relative descriptions used herein are interpreted accordingly.

[0101] In the above detailed description, reference is made to the accompanying drawings, which form a part of this document. In the accompanying drawings, similar symbols typically identify similar components unless the context indicates otherwise. The illustrated embodiments described in the detailed description, drawings, and claims are not meant to be limiting. Other embodiments may be used, and other changes may be made, without departing from the spirit or scope of the subject matter presented herein.

[0102] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A Prometheus remote write optimization method, characterized in that: include: Parse the Prometheus configuration file to obtain data storage location information; Based on the data storage location information, monitor Prometheus data changes in real time and collect updated data; After data processing, the updated data is written to the remote storage; The data processing pressure is calculated according to a preset period so as to adjust the configuration of computing power resources according to the data processing pressure.

2. The Prometheus remote write optimization method according to claim 1, characterized in that: Based on the data storage location information, monitor Prometheus in real time to monitor data changes and collect updated data, including: Check the log files of Prometheus monitoring data according to the preset monitoring cycle; When the content of the log file is updated, the log file is parsed to obtain the most recently updated data of the monitoring data.

3. The Prometheus remote write optimization method according to claim 2, characterized in that: Based on the data storage location information, monitor Prometheus data storage events in real time and collect update data, including: Get the number and update time of the most recently updated monitoring indicators; Send the monitoring indicator quantity and the update time to the Prometheus monitoring system.

4. The Prometheus remote write optimization method according to claim 1, characterized in that: Calculate data processing pressure based on preset cycles, including: Obtaining the number of items and processing time for data processing of the update data; Get the data processing speed within the processing time; According to a preset cycle, a ratio of data processing speed to processing time is used as the data processing pressure.

5. The Prometheus remote write optimization method according to claim 4, characterized in that: According to the data processing pressure, adjust and configure computing resources, including: When the data processing pressure is greater than a preset pressure threshold, increasing the number of processing threads until the maximum number of processing threads is reached; When the data processing pressure is less than or equal to a preset pressure threshold, the processing thread is destroyed.

6. The Prometheus remote write optimization method according to claim 5, characterized in that: Get the number of processing threads and processing thread time, and send them to the Prometheus monitoring system.

7. The Prometheus remote write optimization method according to any one of claims 1 to 6, characterized in that: Also includes: When the update data fails to be written to the remote storage after data processing, it is rewritten and the alarm information is recorded; and / or, Use distributed locks to synchronize the running status of deployed Prometheus instances. When an abnormal downtime occurs, the normally running Prometheus instances continue to process data.

8. A Prometheus remote write optimization device, characterized in that: include: Configuration parsing module, used to parse the Prometheus configuration file and obtain data storage location information; The data monitoring module is used to monitor Prometheus monitoring data changes in real time and collect update data based on data storage location information; A data processing module is used to process the updated data and write it into remote storage; The computing power adjustment module is used to calculate the data processing pressure according to a preset period so as to adjust the configuration of computing power resources according to the data processing pressure.

9. An electronic device, characterized in that: include: processor; as well as A memory arranged to store computer executable instructions which, when executed, cause the processor to perform the steps of the method of any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, which, when executed by an electronic device including a plurality of application programs, cause the electronic device to perform the steps of the method according to any one of claims 1 to 7.