Delay information acquisition method and device, computing device and readable storage medium

Monitoring message queue delay through Java annotation solves the problems of insufficient permission control and complex configuration of existing tools, real-time monitoring and historical data traceability are realized, development costs are reduced, and real-time monitoring and analysis of message queue delay information is suitable for real-time monitoring and analysis.

CN114816907BActive Publication Date: 2024-11-08HAINAN CHEZHIYITONG INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210370086.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-08
Publication Date
2024-11-08
Estimated Expiration
2042-04-08

AI Technical Summary

Technical Problem

Existing message queue delay monitoring tools such as Kafkamanager and Burrow have problems such as insufficient permission control, complex configuration, and poor historical data traceability, making it difficult to effectively monitor and analyze message queue delay.

Method used

Construct the basic information of the message queue through Java annotation, add annotation configuration information, serialize and store it in the automatic deduplication data set, register and remove configuration information regularly, obtain message queue delay information, and persist statistical results, support Permission control and custom data formats.

Benefits of technology

It realizes message queue delay monitoring with simple configuration, permission control, and traceable historical data, reducing development costs without additional plug-ins installation, low learning threshold, and can monitor and count message queue delay information in real time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114816907B_ABST
    Figure CN114816907B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for obtaining message queue delay information, a computing device, and a readable storage medium. The method includes: constructing a method whose return value is basic information of a message queue; adding a first-level annotation to the method, the first-level annotation includes a second-level annotation, and the second-level annotation includes a third-level annotation for indicating monitoring configuration items; obtaining annotation configuration information at a first predetermined time interval and registering it to a registration center; removing previous annotation configuration information from the registration center at a first predetermined time interval; obtaining configuration information of the registration center at a second predetermined time interval; obtaining message queue delay information at a third predetermined time interval; obtaining monitoring configuration items from the third-level annotation and counting data related to the monitoring configuration items based on the message queue delay information; and persisting the statistical results. According to the technical solution of the present invention, the configuration is simple, and no plug-in installation is required, and the monitoring purpose can be achieved by application deployment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of message queue delay information monitoring, and in particular to a delay information acquisition method and device, a computing device and a readable storage medium. Background Art

[0002] Message queue message delays, such as Kafka message delays, can cause message blockages, resulting in unreal-time messages. Improving real-time monitoring is very necessary for analyzing and solving problems.

[0003] One of the traditional technologies used to solve message delay is Kafkamanager, which was first open sourced by Yahoo. Users can perform some simple cluster management operations on the web interface, such as deleting topics, reallocating partitions, and updating topic configurations. However, it is more troublesome to use it for delay monitoring, and it monitors all topics without authority control. In addition, Kafkamanager does not provide an interface for delay data, but only provides a simple display, without authority control, and cannot provide historical data.

[0004] Another solution is Burrow, a framework for monitoring consumer lag that LinkedIn has open-sourced. There is no need to set the lag threshold in advance, and it is completely based on the dynamic evaluation of the consumption process. Burrow is written in Go, so you need to install and set up Go before you start. In addition, the configuration based on the TOML format file is not easy to write and requires additional environment deployment. Summary of the invention

[0005] To this end, the present invention provides a method and apparatus for obtaining message queue delay information, a method and apparatus for performing data statistics on message queue delay information, and a computing device and a readable storage medium, in an effort to solve or at least alleviate the above problems.

[0006] According to a first aspect of the present invention, a method for obtaining message queue delay information is provided, comprising: constructing a method whose return value is basic information of a message queue, wherein the basic information of the message queue includes: a service node, information for authority control, and information for counting message delay information; adding annotation configuration information to the method, wherein the annotation configuration information includes a first-level annotation, wherein the first-level annotation includes a second-level annotation, wherein the second-level annotation includes a monitoring name and a monitoring mode, wherein the second-level annotation includes a third-level annotation, wherein the third-level annotation includes a custom tag name and a value of the tag, wherein the custom tag is used to indicate a monitoring configuration item; obtaining the annotation configuration information, and storing it in an automatically deduplicated data set after json serialization; obtaining the annotation configuration information at a first predetermined time interval and registering it with a registration center; removing the previous annotation configuration information from the registration center at a first predetermined time interval; obtaining the configuration information of the registration center at a second predetermined time interval, wherein the configuration information includes basic information of the message queue and the third-level annotation; obtaining message queue delay information at a third predetermined time interval; obtaining monitoring configuration items from the third-level annotation and counting data related to the monitoring configuration items according to the message queue delay information; and making the statistical results persistent.

[0007] Optionally, the method is used to obtain Kafka delay information, the return value is Kafka basic information, and the service node is a Kafka node.

[0008] Optionally, the information used to collect statistical information on message delays includes message classification information of the message queue and unique identification information used to obtain basic information on the message queue.

[0009] Optionally, the annotation includes a third-level annotation, and the third-level annotation includes a custom tag name and a value of the tag.

[0010] Optionally, the first predetermined time is 10 seconds.

[0011] Optionally, the message queue delay information acquisition method further includes: saving the data in Prometheus; acquiring the data from Prometheus, and displaying and viewing the data.

[0012] According to the second aspect of the present invention, a message queue delay information acquisition device is provided, including: a method construction module, used to construct a method whose return value is the basic information of the message queue, and the basic information of the message queue includes: a service node, information for authority control, and information for statistical message delay information; an annotation adding module, used to add annotation configuration information to the method, the annotation configuration information includes a first-level annotation, the annotation includes a second-level annotation, the second-level annotation includes a monitoring name and a monitoring method, the second-level annotation includes a third-level annotation, the third-level annotation includes a custom tag name and the value of the tag, and the custom tag is used to indicate the monitoring configuration item; an annotation enabling module, which obtains the annotation configuration information, json After serialization, it is stored in an automatically deduplicated data set; an information acquisition module is used to obtain annotation configuration information at a first predetermined time interval and register it to a registration center; an information removal module is used to remove previous annotation configuration information from the registration center at a first predetermined time interval; a message queue basic information acquisition module is used to obtain configuration information of the registration center at a second predetermined time interval, wherein the configuration information includes message queue basic information and three-level annotations; a message queue delay information acquisition module is used to obtain message queue delay information at a third predetermined time interval; a group statistics module is used to obtain monitoring configuration items from the three-level annotations, and to count data related to the monitoring configuration items based on the message queue delay information; a persistence module is used to persist the statistical results.

[0013] Optionally, the message queue delay information acquisition device is used to obtain Kafka delay information, the return value is Kafka basic information, and the service node is a Kafka node.

[0014] According to a third aspect of the present invention, there is provided a computing device, comprising: at least one processor and a memory storing program instructions; when the program instructions are read and executed by the processor, the computing device executes the above method.

[0015] According to a fourth aspect of the present invention, there is provided a readable storage medium storing program instructions, and when the program instructions are read and executed by a computing device, the computing device executes the above method.

[0016] According to the technical solution of the present invention, the message queue message delay is monitored by Java annotation, the configuration is simple, no plug-in installation is required, the application deployment can achieve the monitoring purpose, and the authority can be controlled, the data format can be customized, and the historical data can be traced.

[0017] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] To achieve the above and related purposes, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings, which indicate various ways in which the principles disclosed herein can be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The above and other purposes, features and advantages of the present disclosure will become more apparent by reading the following detailed description in conjunction with the accompanying drawings. Throughout the present disclosure, the same reference numerals generally refer to the same parts or elements.

[0019] Figure 1 A schematic flow chart of a method for acquiring message queue delay information according to an embodiment of the present invention is shown.

[0020] Figure 2 A schematic flow chart of the entire process including annotation configuration, registration, data statistics, persistence and UI display is shown.

[0021] Figure 3 A schematic block diagram of a device for acquiring message queue delay information according to an embodiment of the present invention is shown.

[0022] Figure 4 A simplified structural diagram of a general computer system that can be used as an information processing device for implementing the method according to the embodiment of the present invention is shown. DETAILED DESCRIPTION

[0023] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0024] How to obtain message queue delay information

[0025] According to an embodiment of the present invention, a method for obtaining message queue delay information is provided. To facilitate understanding by those skilled in the art, the following description is given by taking the application in the Kafka environment as an example. However, it should be understood that the present invention is not limited to the Kafka delay information acquisition method. As long as monitoring and statistics can be performed in an annotation manner, the scheme of the embodiment of the present invention can be applied to delay information monitoring and statistics in any environment.

[0026] Figure 1 FIG. 2 shows a schematic flow chart of a method for obtaining message queue delay information according to an embodiment of the present invention. Figure 1 As shown, the method for obtaining message queue delay information according to an embodiment of the present invention includes the following steps:

[0027] S110, construct a method whose return value is basic information of the message queue.

[0028] In the Kafka application example, the method refers to the created Kafka object, which is used to store the basic information of Kafka.

[0029] Kafka basic information, namely kafkacontext, can include: service nodes (servers), information used to count specific message delay information (Topic, GroupId), and information used for permission control (ClientId).

[0030] The purpose of the method to obtain service nodes is to determine which nodes need to be monitored. In practice, only the specified nodes can be monitored, that is, the nodes that need to be monitored, and useless or other irrelevant services can be ignored.

[0031] ClientId is used for authorization identification, that is, only authorized topics (Kafka queues) can be obtained. Topics may be authorized to different people. If there is no ClientId, there is no permission, no login, and no further operations, such as extracting data, statistical data, etc. In practice, ClientId can be the password input link for Kafka basic information. According to the implementation mode of the present invention, if the authority is insufficient, choose not to monitor.

[0032] The topic used to count specific message delay information is the message classification of Kafka, and GroupId is the unique identifier for obtaining Kafka messages and cannot be repeated. The so-called specific message delay information includes the number of unprocessed messages. This is because Kafka is a message queue. If there are too many messages and the consumer cannot process them, there will be unprocessed data sets left.

[0033] S120, adding annotation configuration information to the method, wherein the annotation configuration information includes a first-level annotation (which may be named MonitorPoint), the first-level annotation includes a second-level annotation (which may be named MonitorMetric), and the second-level annotation includes a monitoring name name and a monitoring mode mode.

[0034] The first-level annotation can be understood as the name or title of the annotation. The first-level annotation is used to add annotations to the constructed method, otherwise the monitoring will not take effect. The first-level annotation and the second-level annotation are hierarchical, and the content contained in the first-level annotation is the second-level annotation.

[0035] The above-mentioned second-level annotations can also include the third-level annotation MonitorTag, which contains custom tags (used to indicate monitoring configuration items), that is, custom tag names, where multi-dimensional statistics are performed based on the tags. Adding a tag adds a custom indicator item and the dimension of statistics. The third-level annotation includes the custom tag name (key) and the tag value (value) attributes. Key and value are used to add the indicator items you want to monitor. For example, there are project names, environmental indicators and other indicator items by default. If you also need to classify statistics according to the project, you can use Key and value to add them.

[0036] The monitoring name is the monitoring indicator name, which is fixed as kafka_lag. The monitoring mode mode includes in-process and out-of-process. In the in-process mode, the program is automatically reported after startup, while in the out-of-process mode, a separate task is used to execute statistical delay information according to the indicator monitoring item. In the embodiment of the present invention, out-of-process is used as an example for explanation.

[0037] S130, obtain annotation configuration information, serialize it into json and store it in an automatically deduplicated data set (i.e., local Set). This step is the annotation enabling operation. Json serialization refers to serializing the object to be transmitted into a binary data stream through Jackson for easy transmission.

[0038] The annotation configuration information includes the above-mentioned first-level annotations, second-level annotations, and third-level annotations. In the local Set, data is automatically deduplicated. In the local Set, data duplication detection and merging operations are automatically performed.

[0039] In this way, according to an embodiment of the present invention, the Java annotation method is used to obtain the indicator items that need to be monitored (in the Kafka application example, the indicator items can include the following five items by default: groupId, Topic, project name, environment name, machine IP, and the indicator items can also be set according to custom tags) and the basic information of Kafka.

[0040] S140: Obtain annotation configuration information at a first predetermined time interval and register it with a registration center.

[0041] The first predetermined time may be 10 seconds or other time, and may be set by those skilled in the art according to actual needs.

[0042] One example of using ScheduledExecutorService to obtain all configuration information in the local Set and report it to the registration center is the data set redis Zset (Redis registration). The purpose of reporting is: the current machine IP needs to be reported when reporting, and the configuration information under the current machine needs to be obtained based on the machine IP when statistically delaying information is subsequently generated. The score at the time of reporting is the current time of the system. Because the latest IP needs to be obtained, it is sorted by time, and the score is the size of the sort. The registration time is marked because: the configuration information will be reported repeatedly, and the historical configuration information will be removed based on time after reporting, such as removing configuration information from 30 seconds ago or 10 seconds ago.

[0043] S150: Remove previous annotation configuration information from the registration center every first predetermined time.

[0044] When using ScheduledExecutorService to obtain configuration information, use ScheduledExecutorService to remove previous configuration information. The removal interval can be 10 seconds or other time. The previous configuration information can be one minute ago or longer. The purpose of removing information is to obtain the latest annotation configuration information.

[0045] S160 , obtain the configuration information of the registration center every second predetermined time. The registration center is a device that reports the current machine configuration information. In this step, you can use a scheduled task (a task used to perform data acquisition and sending operations at regular intervals, such as a job service) to obtain configuration information. The second predetermined time can be, for example, 1 second or other time. The configuration information of the registration center includes the basic information of the message queue (Servers, GroupId, Topic, ClientId in the kafka application example) and three-level annotations. The basic information of kafka is obtained from the local set. The third-level annotation is used to indicate the indicator items to be monitored. As mentioned above, you can customize the indicator items other than the default according to the label.

[0046] S170: Obtain message queue delay information every third predetermined time period.

[0047] Get the basic Kafka information of KafkaContext from the local set. Here, you can enable multi-threading to use the Kafka Client (the component that communicates with the Kafka server) to obtain the Kafka delay data information from the Kafka server. Enabling multi-threading can quickly read the Kafka delay information for statistics.

[0048] If Kafka enables security verification, only authorized topic information can be obtained, which ensures the security of the data.

[0049] The third predetermined time may be 3 seconds or other time.

[0050] The Kafka delay data information is the total number of data blocked in the queue. The total number of data contains multiple tags indicating monitoring configuration items to facilitate subsequent data statistics based on the tags.

[0051] S180, obtain monitoring configuration items from the third-level annotations and count the data related to the monitoring configuration items according to the message queue delay information. Monitoring configuration items are monitoring indicators, which can be GroupId, Topic, project name, environment name, and machine IP in an example. You can also customize indicator items other than the default according to custom tags. The statistics are performed according to the tags. Adding a tag will increase the statistics of one dimension.

[0052] This statistical work can be automatically completed by tools that perform classification, aggregation, and statistics. The purpose of statistics is to calculate the data related to each indicator item.

[0053] S190, persist the statistical results.

[0054] Optionally, custom persistence tools can be supported, and data can be stored in Prometheus, which is an open source monitoring, alarm, and time series database combination.

[0055] Optionally, you can also get data from Prometheus, such as binding to grafana (an open source data visualization tool developed in Go language, which can do data monitoring and data statistics, and has alarm function) or display and view data through page drawing and early warning. For example, if the delay exceeds a specified number of items - the number can be set, or exceeds a specified number within a specified time, SMS, DingTalk, or email alarms will be issued.

[0056] Obtaining delay information according to the technical solution of the embodiment of the present invention can achieve the following advantages: reduced development cost, no need for additional plug-ins or environments, low learning threshold, Java annotation configuration, no need to learn additional languages ​​and configurations. And permission control is adopted, that is, only Kafka topics that you have permission to monitor can be monitored.

[0057] Figure 2 A schematic flow chart of the entire process including annotation configuration, registration, data statistics, persistence and UI display is shown.

[0058] Message queue delay information acquisition device

[0059] According to an embodiment of the present invention, a device for acquiring message queue delay information is also provided. Figure 3 FIG. 4 shows a schematic block diagram of the message queue delay information acquisition device. Figure 3 As shown, the message queue delay information acquisition device includes:

[0060] A method construction module 310 is used to construct a method whose return value is basic information of a message queue, wherein the basic information of the message queue includes: a service node, information for authority control, and information for counting message delay information;

[0061] The annotation adding module 320 is used to add annotation configuration information to the method, wherein the annotation configuration information includes a first-level annotation, wherein the first-level annotation includes a second-level annotation, wherein the second-level annotation includes a monitoring name and a monitoring method. The second-level annotation may also include a third-level annotation MonitorTag, which includes a custom tag (used to indicate a monitoring configuration item), i.e., a custom tag name, wherein multi-dimensional statistics are performed according to the tag, and adding a tag adds a custom indicator item and a dimension of statistics.

[0062] An annotation enabling module 330 is used to obtain annotation configuration information, which is serialized into JSON and stored in an automatically deduplicated data set;

[0063] An information acquisition module 340 is used to acquire annotation configuration information at a first predetermined time interval and register it in a registration center;

[0064] The information removal module 350 is used to remove the previous annotation configuration information from the registration center every first predetermined time.

[0065] A message queue basic information acquisition module 360, configured to obtain configuration information of a registration center at a second predetermined time interval, wherein the configuration information includes basic message queue information and third-level annotations;

[0066] A message queue delay information acquisition module 370, configured to acquire message queue delay data information every third predetermined time;

[0067] The group statistics module 380 is used to obtain monitoring configuration items from the third-level annotations and to collect statistics related to the monitoring configuration items according to the message queue delay information;

[0068] The persistence module 390 is used to persist the statistical results.

[0069] For the parts of the above modules that are not described in detail, please refer to the above method implementation method, which will not be repeated here.

[0070] According to the technical solution of the embodiment of the present invention, Java annotation is used to collect real-time statistics of delay information based on the consumption process and report data regularly. In this way, the configuration is simple and there is no code intrusion, and no additional plug-ins need to be installed; historical data can be traced, information is collected and persisted, and historical data can be queried and analyzed; and permission control is used, and only Kafka topics that you have permission to monitor can be monitored; and the UI display can be customized. After obtaining the monitoring data according to the interface, a custom UI display can be performed, or directly connected to Grafana.

[0071] Computing equipment

[0072] The embodiments of the present invention have been described in detail above through block diagrams and flow charts. It is understood by those skilled in the art that some aspects of the embodiments described in this specification can be implemented equivalently in whole or in part in the form of one or more computer programs running on one or more computers, in the form of one or more programs running on one or more processors, in the form of firmware, or in the form of any combination thereof, and, based on the contents disclosed in this specification, it is entirely within the capabilities of those skilled in the art to design circuits for the present disclosure and / or write software and / or firmware codes for the present disclosure.

[0073] For example, each step in the processing flow chart of the above method can be performed by software, firmware, hardware or any combination thereof. In the case of software or firmware implementation, the data can be transferred from a storage medium or a network to a computer (e.g., a computer) having a dedicated hardware structure. Figure 4 The general-purpose computer shown in FIG. 1 is installed with programs constituting the software, and the computer can execute various functions when various programs are installed.

[0074] Therefore, the present invention also proposes a program product storing machine-readable instruction codes. When the instruction codes are read and executed by a machine, the method according to the embodiment of the present invention can be executed.

[0075] Figure 4 4 is a simplified structural diagram of a general computer system that can be used as an information processing device for implementing the method according to an embodiment of the present invention. The device may include: a processor 410, a memory 420, an input / output interface 430, a communication interface 440, and a bus 450. The processor 410, the memory 420, the input / output interface 430, and the communication interface 440 are connected to each other in communication within the device through the bus 450.

[0076] The processor 410 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the implementation methods of this specification.

[0077] The memory 420 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 420 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 420 and are called and executed by the processor 410.

[0078] The input / output interface 430 is used to connect the input / output module to realize information input and output. The input / output module can be configured as a component in the device (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0079] The communication interface 440 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0080] The bus 450 comprises a pathway for transmitting information between the various components of the device (eg, the processor 410, the memory 420, the input / output interface 430, and the communication interface 440).

[0081] It should be noted that, although the above device only shows the processor 410, the memory 420, the input / output interface 430, the communication interface 440 and the bus 450, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the implementation scheme of this specification, and does not necessarily include all the components shown in the figure.

[0082] Readable storage medium

[0083] According to an embodiment of the present invention, a computer-readable storage medium is further provided, which stores computer instructions, and the computer instructions are used to enable the computer to execute the above method.

[0084] The computer-readable medium of the present embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be a computer-readable instruction, a data structure, a module of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassette or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device.

[0085] It should be noted that the method of one or more embodiments of this specification can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps of the method of one or more embodiments of this specification, and the multiple devices will interact with each other to complete the described method.

[0086] The above is a description of a specific embodiment of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0087] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. In line with the present disclosure, the above embodiments or technical features in different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of different aspects of one or more embodiments of the present specification as described above, which are not provided in detail for the sake of simplicity.

[0088] While the disclosure has been described in conjunction with specific embodiments thereof, many alternatives, modifications and variations of these embodiments will be apparent to those skilled in the art in light of the foregoing description.

[0089] One or more embodiments of this specification are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of this specification should be included in the scope of protection of this disclosure.

Claims

1. A method for obtaining message queue delay information, comprising: Construct a method whose return value is basic information of a message queue, wherein the basic information of the message queue includes: a service node, information for authority control, and information for counting message delay information; Adding annotation configuration information to the method, wherein the annotation configuration information includes a first-level annotation, the first-level annotation includes a second-level annotation, the second-level annotation includes a monitoring name and a monitoring method, the second-level annotation includes a third-level annotation, the third-level annotation includes a custom tag name and a value of the tag, and the custom tag is used to indicate a monitoring configuration item; Get annotation configuration information, serialize it into JSON and store it in an automatically deduplicated data set; Obtaining annotation configuration information at a first predetermined time interval and registering it in a registration center; Removing previous annotation configuration information from the registration center at first predetermined intervals; Obtaining configuration information of the registration center every second predetermined time, wherein the configuration information includes basic information of the message queue and three-level annotations; Obtaining message queue delay information every third predetermined time; Obtain monitoring configuration items from the third-level annotations and count data related to the monitoring configuration items based on message queue delay information; Make the statistical results persistent.

2. The method for obtaining message queue delay information according to claim 1, wherein: The method is used to obtain Kafka delay information, the return value is Kafka basic information, and the service node is a Kafka node.

3. The method for obtaining message queue delay information according to claim 1, wherein: The information used to count message delay information includes message classification information of the message queue and unique identification information used to obtain basic information of the message queue.

4. The method for obtaining message queue delay information according to claim 1, wherein: The annotations include three levels of annotations.

5. The method for obtaining message queue delay information according to claim 1, wherein: The first predetermined time is 10 seconds.

6. The method for obtaining message queue delay information according to claim 1, further comprising: Save the data in Prometheus; Get data from Prometheus and display it.

7. A message queue delay information acquisition device, comprising: A method construction module, used to construct a method whose return value is basic information of a message queue, wherein the basic information of the message queue includes: a service node, information for authority control, and information for statistical message delay information; An annotation adding module, used to add annotation configuration information to the method, wherein the annotation configuration information includes a first-level annotation, the annotation includes a second-level annotation, the second-level annotation includes a monitoring name and a monitoring method, the second-level annotation includes a third-level annotation, the third-level annotation includes a custom tag name and a value of the tag, and the custom tag is used to indicate a monitoring configuration item; The annotation enabling module obtains annotation configuration information, which is serialized into JSON and stored in an automatically deduplicated data set; An information acquisition module, used to acquire annotation configuration information at a first predetermined time interval and register it in a registration center; An information removal module, used to remove previous annotation configuration information from the registration center at a first predetermined time interval; A message queue basic information acquisition module, used to obtain configuration information of the registration center every second predetermined time, wherein the configuration information includes basic information of the message queue and three-level annotations; A message queue delay information acquisition module, used to acquire message queue delay information every third predetermined time; The group statistics module obtains monitoring configuration items from the third-level annotations and collects statistics related to the monitoring configuration items based on the message queue delay information; The persistence module is used to persist the statistical results.

8. The message queue delay information acquisition device according to claim 7 is used to obtain Kafka delay information, the return value is Kafka basic information, and the service node is a Kafka node.

9. A computing device comprising: at least one processor and a memory storing program instructions; When the program instructions are read and executed by the processor, the computing device is caused to perform the method according to any one of claims 1 to 6.

10. A readable storage medium storing program instructions, when the program instructions are read and executed by a computing device, the computing device executes the method according to any one of claims 1 to 6.