CN110688146A - Method, device and storage medium for dynamically configuring monitoring system - Google Patents
Method, device and storage medium for dynamically configuring monitoring system Download PDFInfo
- Publication number
- CN110688146A CN110688146A CN201910900495.6A CN201910900495A CN110688146A CN 110688146 A CN110688146 A CN 110688146A CN 201910900495 A CN201910900495 A CN 201910900495A CN 110688146 A CN110688146 A CN 110688146A
- Authority
- CN
- China
- Prior art keywords
- alarm
- monitoring system
- service discovery
- discovery component
- monitoring
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012544 monitoring process Methods 0.000 title claims abstract description 144
- 238000000034 method Methods 0.000 title claims abstract description 41
- 230000008859 change Effects 0.000 claims abstract description 18
- 238000012545 processing Methods 0.000 claims description 13
- 238000012546 transfer Methods 0.000 claims description 10
- 238000007726 management method Methods 0.000 description 28
- 241000412611 Consul Species 0.000 description 21
- 238000010586 diagram Methods 0.000 description 11
- 230000000694 effects Effects 0.000 description 7
- 230000005540 biological transmission Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 241000283973 Oryctolagus cuniculus Species 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 238000005034 decoration Methods 0.000 description 2
- 238000002955 isolation Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000036541 health Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application discloses a method and a device for dynamically configuring a monitoring system and a storage medium. Wherein, the method comprises the following steps: storing monitoring targets and alarm rules associated with a monitoring system in a service discovery component, wherein the service discovery component stores at least one alarm policy for the monitoring system; updating the configuration file of the monitoring system by using a configuration management tool according to the configuration change in the service discovery component; and loading the configuration file through the monitoring system.
Description
Technical Field
The present application relates to the field of computer monitoring, and in particular, to a method, an apparatus, and a storage medium for dynamically configuring a monitoring system.
Background
Prometheus is an open source monitoring system, and is used by many companies and organizations. The community of developers and users of the project is very active, with more and more developers and users participating in the project.
However, the existing Prometheus monitoring system cannot dynamically add alarm rules, and when a new alarm needs to be added, the configuration file of the alarm needs to be manually modified, and the service is suspended to load the latest configuration, so that the Prometheus monitoring system is cumbersome, inefficient and inconvenient to manage.
Aiming at the technical problem that the Prometheus monitoring system in the prior art cannot dynamically add the alarm rule, an effective solution is not provided at present.
Disclosure of Invention
The embodiment of the disclosure provides a method, a device and a storage medium for dynamically configuring a monitoring system, so as to at least solve the technical problem that a Prometheus monitoring system in the prior art cannot dynamically add an alarm rule.
According to an aspect of the embodiments of the present disclosure, there is provided a method for dynamically configuring a monitoring system, including: storing monitoring targets and alarm rules associated with a monitoring system in a service discovery component, wherein the service discovery component stores at least one alarm policy for the monitoring system; updating the configuration file of the monitoring system by using a configuration management tool according to the configuration change in the service discovery component; and loading the configuration file through the monitoring system.
According to another aspect of the embodiments of the present disclosure, there is also provided a storage medium including a stored program, wherein the method of any one of the above is performed by a processor when the program is executed.
According to another aspect of the embodiments of the present disclosure, there is also provided an apparatus for dynamically configuring a monitoring system, including: a storage module for storing monitoring targets and alarm rules associated with the monitoring system in a service discovery component, wherein the service discovery component stores at least one alarm policy for the monitoring system; the updating module is used for updating the configuration file of the monitoring system by using a configuration management tool according to the configuration change in the service discovery component; and the loading module is used for loading the configuration file through the monitoring system.
According to another aspect of the embodiments of the present disclosure, there is also provided an apparatus for dynamically configuring a monitoring system, including: a processor; and a memory coupled to the processor for providing instructions to the processor for processing the following processing steps: storing monitoring targets and alarm rules associated with a monitoring system in a service discovery component, wherein the service discovery component stores at least one alarm policy for the monitoring system; updating the configuration file of the monitoring system by using a configuration management tool according to the configuration change in the service discovery component; and loading the configuration file through the monitoring system.
In the embodiment of the disclosure, a monitoring target and an alarm rule are written into a service discovery component in a dynamic adding mode, a configuration management tool monitors data change of the alarm rule in the service discovery component in real time and converts the alarm rule into an independent rule file, and when the rule changes, the configuration management tool generates a configuration file containing the latest alarm rule according to a specified configuration file template. The configuration management tool notifies the monitoring system to load the configuration file containing the latest alarm rules. The purpose of dynamically adding the alarm rules is achieved, and therefore the technical effect that the newly added/deleted/modified alarm rules can immediately take effect in the monitoring system prometheus without adjusting any component by a user is achieved. And further, the technical problem that the Prometheus system in the prior art cannot dynamically add the alarm rule is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the disclosure and together with the description serve to explain the disclosure and not to limit the disclosure. In the drawings:
fig. 1 is a hardware configuration block diagram of a computer terminal (or mobile device) for implementing the method according to embodiment 1 of the present disclosure;
FIG. 2 is a schematic diagram of a system for dynamically configuring a monitoring system according to embodiment 1 of the present disclosure;
fig. 3 is a schematic flow chart of a method for dynamically configuring a monitoring system according to a first aspect of embodiment 1 of the present disclosure;
fig. 4 is a schematic diagram of a name format of a monitoring target according to the first aspect of embodiment 1 of the present disclosure;
fig. 5 is a schematic diagram of a name format of an alarm rule according to the first aspect of embodiment 1 of the present disclosure;
fig. 6 is a schematic diagram of an IP configuration according to a first aspect of embodiment 1 of the present disclosure;
fig. 7 is a schematic diagram of a URL configuration according to the first aspect of embodiment 1 of the present disclosure;
fig. 8 is a schematic diagram of an apparatus for dynamically configuring a monitoring system according to embodiment 2 of the present disclosure; and
fig. 9 is a schematic diagram of an apparatus for dynamically configuring a monitoring system according to embodiment 3 of the present disclosure.
Detailed Description
In order to make those skilled in the art better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure. It is to be understood that the described embodiments are merely exemplary of some, and not all, of the present disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
First, some of the nouns or terms appearing in the description of the embodiments of the present disclosure are applicable to the following explanations:
three main application scenarios for consul: service discovery, service isolation, service configuration.
In a service discovery scene, a consul serves as a registry, and after a service address is registered in the consul, dns and http interfaces provided by the consul can be used for querying, and the consul supports health check.
In a service isolation scene, the consul supports setting of an access strategy by taking a service as a unit, can simultaneously support a classical platform and an emerging platform, supports tls certificate distribution and service-to-service encryption.
In the service configuration scene, the consul provides a key-value data storage function, and can rapidly inform the change, and the configuration file can be more conveniently rendered in real time through a tool consul-template.
Example 1
There is also provided in accordance with the present embodiment, a method embodiment for dynamically configuring a monitoring system, it being noted that the steps illustrated in the flowchart of the figure may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
The method embodiments provided by the present embodiment may be executed in a mobile terminal, a computer terminal, a server or a similar computing device. Fig. 1 illustrates a hardware block diagram of a computing device for implementing a method of dynamically configuring a monitoring system. As shown in fig. 1, the computing device may include one or more processors (which may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory for storing data, and a transmission device for communication functions. Besides, the method can also comprise the following steps: a display, an input/output interface (I/O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of the I/O interface), a network interface, a power source, and/or a camera. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the electronic device. For example, the computing device may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
It should be noted that the one or more processors and/or other data processing circuitry described above may be referred to generally herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part in software, hardware, firmware, or any combination thereof. Further, the data processing circuitry may be a single, stand-alone processing module, or incorporated in whole or in part into any of the other elements in the computing device. As referred to in the disclosed embodiments, the data processing circuit acts as a processor control (e.g., selection of a variable resistance termination path connected to the interface).
The memory may be used to store software programs and modules of application software, such as program instructions/data storage devices corresponding to the method for dynamically configuring the monitoring system in the embodiments of the present disclosure, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implementing the above-mentioned method for dynamically configuring the monitoring system by using the application programs. The memory may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory located remotely from the processor, which may be connected to the computing device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device is used for receiving or transmitting data via a network. Specific examples of such networks may include wireless networks provided by communication providers of the computing devices. In one example, the transmission device includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
The display may be, for example, a touch screen type Liquid Crystal Display (LCD) that may enable a user to interact with a user interface of the computing device.
It should be noted here that in some alternative embodiments, the computing device shown in fig. 1 described above may include hardware elements (including circuitry), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. It should be noted that FIG. 1 is only one example of a particular specific example and is intended to illustrate the types of components that may be present in a computing device as described above.
Fig. 2 is a schematic diagram of a system for dynamically configuring a monitoring system according to the present embodiment. Referring to fig. 2, the system includes: a service discovery component consul, a configuration management tool confd, and a monitoring system prometheus. Firstly, a user writes a monitoring target and an alarm rule into a service discovery component consul in a dynamic adding mode. Then, the configuration management tool confd monitors the data change of the alarm rule in the service discovery component consul in real time, converts the alarm rule into an independent rule file, and when the rule changes, the configuration management tool confd generates a configuration file containing the latest alarm rule according to a specified configuration file template. And finally, the configuration management tool confd informs the monitoring system of loading the configuration file containing the latest alarm rule.
In the above operating environment, according to a first aspect of the present embodiment, a method for dynamically configuring a monitoring system is provided. Fig. 3 shows a flow diagram of the method, which, with reference to fig. 3, comprises:
s302: storing monitoring targets and alarm rules associated with a monitoring system in a service discovery component, wherein the service discovery component stores at least one alarm policy for the monitoring system;
s304: updating the configuration file of the monitoring system by using a configuration management tool according to the configuration change in the service discovery component; and
s306: the configuration file is loaded by the monitoring system.
As described in the background section above, the existing Prometheus monitoring system cannot dynamically add alarm rules, and each time a new alarm needs to be added, it needs to manually modify its configuration file, suspend service to load the latest configuration, which is cumbersome, inefficient, and inconvenient to manage.
In view of the above problems in the background art, the present embodiment provides a method for dynamically configuring a monitoring system, as shown in fig. 2. Firstly, a user writes a monitoring target and an alarm rule into a service discovery component consul in a dynamic adding mode. Then, the configuration management tool confd monitors the data change of the alarm rule in the service discovery component consul in real time, converts the alarm rule into an independent rule file, and when the rule changes, the configuration management tool confd generates a configuration file containing the latest alarm rule according to a specified configuration file template. And finally, the configuration management tool confd informs the monitoring system of loading the configuration file containing the latest alarm rule. Triggering the configuration hot loading of prometheus through a systemctl command, wherein the configuration file for the configuration hot loading is as follows:
[template]
src="hawkeye_rules.conf.tmpl"
dest="/etc/monitor-server/hawkeye_rules.yml"
keys=[
"/prometheus/rules",
"/prometheus/rules/container/cpu",
"/prometheus/rules/container/inode",
"/prometheus/rules/container/memory",
"/prometheus/rules/container/status",
"/prometheus/rules/redis/hit",
"/prometheus/rules/redis/status",
"/prometheus/rules/mysql/up",
"/prometheus/rules/mysql/innodb",
"/prometheus/rules/rabbit/queue",
"/prometheus/rules/rabbit/status",
"/prometheus/rules/url",
"/exporterzk/group_nbsp",
]
check_cmd="touch/tmp/check"
the instruction is executed after the config hot load of prometheus generates the latest alarm rule file.
Thus, in this way, the user writes the monitoring target and the alarm rule into the service discovery component consul by means of dynamic addition. Then, the configuration management tool confd monitors the data change of the alarm rule in the service discovery component consul in real time, converts the alarm rule into an independent rule file, and when the rule changes, the configuration management tool confd generates a configuration file containing the latest alarm rule according to a specified configuration file template. And finally, the configuration management tool confd informs the monitoring system of loading the configuration file containing the latest alarm rule. The user does not need to adjust any component and is automatically triggered, and the alarm rules of addition/deletion/modification can be immediately effective in the monitoring system prometheus. And further, the technical problem that the Prometheus system in the prior art cannot dynamically add the alarm rule is solved.
Optionally, the operation of storing the monitoring target and the alarm rule in the service discovery component further includes: storing the monitoring target in a service discovery component in the form of service; and storing the alarm rule in the form of a key in the service discovery component.
Specifically, the monitoring target and the alarm rule are two different types of data. The monitoring target needs to be accessed, so the monitoring target is stored in the service discovery component consul in the form of service, and the alarm rule needs to be configured in the file, so the monitoring target is stored in the service discovery component consul in the form of key-value. Thus, two different types of data types, the monitoring target and the alarm gauge, are stored in the service discovery component consul in an appropriate form.
Optionally, the name format of the monitoring target in the service discovery component includes at least one of: the system comprises an alarm strategy identifier, a target type and a target system, wherein the alarm strategy identifier is used for indicating a monitoring target as an identifier of an alarm strategy in a service discovery component; the target type is used for indicating the type of the monitoring target; and a target system for indicating a system monitoring the target.
Specifically, the monitoring target is stored in a Service form in a Service discovery component consul, and a name format of the monitoring target includes at least one of the following: the alarm policy identifies the alarm policy ID, the target type, and the target system. Referring to fig. 4, the name format is "alarm policy ID-team name-target type-target system". Wherein, the alarm strategy identification (alarm strategy ID) refers to the identification of the alarm strategy of the monitoring target serving as the service discovery component; the target type refers to the type of the monitoring target; the target system refers to a system that monitors a target.
The name format of the monitoring target is thus determined in this way. The name format contains information of alarm strategy ID, team name, target type and target system. So that such information can be efficiently queried.
Optionally, the name format of the alert rule in the service discovery component includes at least one of: the method comprises the following steps of (1) alarm level, alarm strategy identification, alarm type, application name and alarm source, wherein the alarm level is used for indicating the severity and urgency of an alarm rule; the alarm strategy identification is used for indicating an alarm rule as an identification of an alarm strategy in the service discovery component; the alarm type is used for indicating the type of the alarm rule; the application name is used for indicating the name of an application program to which the alarm rule belongs; and an alert source for indicating the source of the alert rule.
Specifically, the alarm rule is stored in the service discovery component consul in a Key-Value form, and the name format of the alarm rule includes at least one of the following: the alarm level, alarm policy identification alarm policy ID, alarm type, application name, and alarm source. Referring to fig. 5, the name format is "alarm level-alarm policy ID-alarm type-team-application name-alarm source". Wherein the alarm level refers to the severity and urgency of the alarm rule; the alarm policy identifier alarm policy ID refers to an alarm rule as an identifier of an alarm policy in a service discovery component; the alarm rule refers to the type of the alarm rule; the application name refers to the name of the application program to which the alarm rule belongs; and alert source refers to the source of the alert rule.
The name format of the alarm rule is thus determined in this way. The name format contains information of "alarm level-alarm strategy ID-alarm type-team-application name-alarm source". So that such information can be efficiently queried.
Optionally, the type of the monitoring target includes at least one of: configuring an internet protocol address; and a uniform resource locator configuration.
Specifically, the types of the monitoring target include two types: internet protocol address configuration (i.e., IP configuration); and a uniform resource locator configuration (i.e., URL configuration). Thereby satisfying different types of monitoring targets through two types of configuration, namely IP configuration and URL configuration.
Optionally, the internet protocol address configuration comprises at least one of: MySQL database, Redis, message queue, server, and Zookeeper; the uniform resource locator configuration includes at least one of: a hypertext transfer protocol based uniform resource locator and a hypertext transfer security protocol based uniform resource locator.
Specifically, referring to fig. 6 and 7, the IP configuration includes the following system types: MySQL database, Redis, Message Queue (MQ), server, and Zookeeper; the URL configuration contains the following system types: universal resource locators based on hypertext transfer protocol (url), (http), and universal resource locators based on hypertext transfer security protocol (url), (https). Therefore, the IP configuration and the URL configuration contain a plurality of different system types, and the monitoring targets of the different system types can be met.
Optionally, the type of the alarm rule includes at least one of: availability, application level, JVM, Docker, and middleware.
Specifically, the types of the alarm rules include the following: availability, application level, JVM, Docker, and middleware, etc. Therefore, various types of alarms are realized by adding various different types of alarm rules.
Therefore, according to the embodiment, the user writes the monitoring target and the alarm rule into the service discovery component consul in a dynamic addition manner. Then, the configuration management tool confd monitors the data change of the alarm rule in the service discovery component consul in real time, converts the alarm rule into an independent rule file, and when the rule changes, the configuration management tool confd generates a configuration file containing the latest alarm rule according to a specified configuration file template. And finally, the configuration management tool confd informs the monitoring system of loading the configuration file containing the latest alarm rule. The new/deleted/modified alarm rules will take effect immediately in the monitoring system prometheus without the user having to adjust any components. And further, the technical problem that the Prometheus system in the prior art cannot dynamically add the alarm rule is solved.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
Fig. 8 shows an apparatus 800 for dynamically configuring a monitoring system according to embodiment 8, the apparatus 800 corresponding to the method according to the first aspect of embodiment 1. Referring to fig. 8, the apparatus 800 includes: a storage module 810 for storing monitoring targets and alarm rules related to a monitoring system in a service discovery component, wherein the service discovery component stores at least one alarm policy for the monitoring system; an update module 820 for updating the configuration file of the monitoring system according to the configuration change in the service discovery component by using the configuration management tool; and a loading module 830 for loading the configuration file through the monitoring system.
Optionally, the storage module 810 further includes: the first storage submodule is used for storing the monitoring target in a service discovery component in a service form; and the second storage submodule is used for storing the alarm rule in the form of key value in the service discovery component.
Optionally, the name format of the monitoring target in the service discovery component includes at least one of: the system comprises an alarm strategy identifier, a target type and a target system, wherein the alarm strategy identifier is used for indicating a monitoring target as an identifier of an alarm strategy in a service discovery component; the target type is used for indicating the type of the monitoring target; and a target system for indicating a system monitoring the target.
Optionally, the name format of the alert rule in the service discovery component includes at least one of: the method comprises the following steps of (1) alarm level, alarm strategy identification, alarm type, application name and alarm source, wherein the alarm level is used for indicating the severity and urgency of an alarm rule; the alarm strategy identification is used for indicating an alarm rule as an identification of an alarm strategy in the service discovery component; the alarm type is used for indicating the type of the alarm rule; the application name is used for indicating the name of an application program to which the alarm rule belongs; and an alert source for indicating the source of the alert rule.
Optionally, the type of the monitoring target includes at least one of: configuring an internet protocol address; and a uniform resource locator configuration.
Optionally, the internet protocol address configuration comprises at least one of: MySQL database, Redis, message queue, server, and Zookeeper; the uniform resource locator configuration includes at least one of: a hypertext transfer protocol based uniform resource locator and a hypertext transfer security protocol based uniform resource locator.
Optionally, the type of the alarm rule includes at least one of: availability, application level, JVM, Docker, and middleware.
Thus, according to this embodiment, the device 800 for dynamically configuring the monitoring system writes the monitoring target and the alarm rule into the service discovery component in a dynamic adding manner, monitors the data change of the alarm rule in the service discovery component in real time by the configuration management tool, converts the alarm rule into an independent rule file, and when the rule changes, the configuration management tool generates a configuration file containing the latest alarm rule according to the specified configuration file template. The configuration management tool notifies the monitoring system to load the configuration file containing the latest alarm rules. The purpose of dynamically adding the alarm rules is achieved, and therefore the technical effect that the newly added/deleted/modified alarm rules can immediately take effect in the monitoring system prometheus without adjusting any component by a user is achieved. And further, the technical problem that the Prometheus system in the prior art cannot dynamically add the alarm rule is solved.
Example 3
Fig. 9 shows an apparatus 900 for dynamically configuring a monitoring system according to the present embodiment, the apparatus 900 corresponding to the method according to the first aspect of embodiment 1. Referring to fig. 9, the apparatus 900 includes: a processor 910; and a memory 920 coupled to the processor 910 for providing instructions to the processor 910 to process the following steps: storing monitoring targets and alarm rules associated with a monitoring system in a service discovery component, wherein the service discovery component stores at least one alarm policy for the monitoring system; updating the configuration file of the monitoring system by using a configuration management tool according to the configuration change in the service discovery component; and loading the configuration file through the monitoring system.
Optionally, the operation of storing the monitoring target and the alarm rule in the service discovery component further includes: storing the monitoring target in a service discovery component in the form of service; and storing the alarm rule in the form of a key in the service discovery component.
Optionally, the name format of the monitoring target in the service discovery component includes at least one of: the system comprises an alarm strategy identifier, a target type and a target system, wherein the alarm strategy identifier is used for indicating a monitoring target as an identifier of an alarm strategy in a service discovery component; the target type is used for indicating the type of the monitoring target; and a target system for indicating a system monitoring the target.
Optionally, the name format of the alert rule in the service discovery component includes at least one of: the method comprises the following steps of (1) alarm level, alarm strategy identification, alarm type, application name and alarm source, wherein the alarm level is used for indicating the severity and urgency of an alarm rule; the alarm strategy identification is used for indicating an alarm rule as an identification of an alarm strategy in the service discovery component; the alarm type is used for indicating the type of the alarm rule; the application name is used for indicating the name of an application program to which the alarm rule belongs; and an alert source for indicating the source of the alert rule.
Optionally, the type of the monitoring target includes at least one of: configuring an internet protocol address; and a uniform resource locator configuration.
Optionally, the internet protocol address configuration comprises at least one of: MySQL database, Redis, message queue, server, and Zookeeper; the uniform resource locator configuration includes at least one of: a hypertext transfer protocol based uniform resource locator and a hypertext transfer security protocol based uniform resource locator.
Optionally, the type of the alarm rule includes at least one of: availability, application level, JVM, Docker, and middleware.
Thus, according to this embodiment, the device 900 for dynamically configuring the monitoring system writes the monitoring target and the alarm rule into the service discovery component in a dynamic adding manner, monitors the data change of the alarm rule in the service discovery component in real time by the configuration management tool, converts the alarm rule into an independent rule file, and when the rule changes, the configuration management tool generates a configuration file containing the latest alarm rule according to the specified configuration file template. The configuration management tool notifies the monitoring system to load the configuration file containing the latest alarm rules. The purpose of dynamically adding the alarm rules is achieved, and therefore the technical effect that the newly added/deleted/modified alarm rules can immediately take effect in the monitoring system prometheus without adjusting any component by a user is achieved. And further, the technical problem that the Prometheus system in the prior art cannot dynamically add the alarm rule is solved.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.
Claims (10)
1. A method for dynamically configuring a monitoring system, comprising:
storing monitoring targets and alarm rules associated with a monitoring system in a service discovery component, wherein the service discovery component stores at least one alarm policy for the monitoring system;
updating the configuration file of the monitoring system by using a configuration management tool according to the configuration change in the service discovery component; and
and loading the configuration file through the monitoring system.
2. The method of claim 1, wherein storing the monitoring target and alarm rules in the service discovery component further comprises:
storing the monitoring target in the form of a service in the service discovery component; and
storing the alarm rule in the form of a key value in the service discovery component.
3. The method of claim 2, wherein the name format of the monitoring target in the service discovery component comprises at least one of: an alarm policy identification, a target type and a target system, wherein
The alarm policy identifier is used for indicating the monitoring target as an identifier of an alarm policy in the service discovery component;
the target type is used for indicating the type of the monitoring target; and
the target system is used for indicating the system of the monitoring target.
4. The method of claim 2, wherein the name format of the alert rule in the service discovery component comprises at least one of: alarm level, alarm policy identification, alarm type, application name, and alarm source, wherein
The alarm level is used for indicating the severity and urgency of an alarm rule;
the alarm policy identifier is used for indicating the alarm rule as an identifier of an alarm policy in the service discovery component;
the alarm type is used for indicating the type of the alarm rule;
the application name is used for indicating the name of an application program to which the alarm rule belongs; and
the alarm source is used for indicating the source of the alarm rule.
5. The method of claim 3, wherein the type of monitoring target comprises at least one of:
configuring an internet protocol address; and
and configuring a uniform resource locator.
6. The method of claim 5, wherein the Internet protocol address configuration comprises at least one of: MySQL database, Redis, message queue, server, and Zookeeper;
the uniform resource locator configuration includes at least one of: a hypertext transfer protocol based uniform resource locator and a hypertext transfer security protocol based uniform resource locator.
7. The method of claim 4, wherein the type of the alarm rule comprises at least one of: availability, application level, JVM, Docker, and middleware.
8. A storage medium comprising a stored program, wherein the method of any one of claims 1 to 7 is performed by a processor when the program is run.
9. An apparatus for dynamically configuring a monitoring system, comprising:
a storage module to store monitoring targets and alarm rules associated with a monitoring system in a service discovery component, wherein the service discovery component stores at least one alarm policy for the monitoring system;
the updating module is used for updating the configuration file of the monitoring system according to the configuration change in the service discovery component by using a configuration management tool; and
and the loading module is used for loading the configuration file through the monitoring system.
10. An apparatus for dynamically configuring a monitoring system, comprising:
a processor; and
a memory coupled to the processor for providing instructions to the processor for processing the following processing steps:
storing monitoring targets and alarm rules associated with a monitoring system in a service discovery component, wherein the service discovery component stores at least one alarm policy for the monitoring system;
updating the configuration file of the monitoring system by using a configuration management tool according to the configuration change in the service discovery component; and
and loading the configuration file through the monitoring system.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910900495.6A CN110688146A (en) | 2019-09-23 | 2019-09-23 | Method, device and storage medium for dynamically configuring monitoring system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910900495.6A CN110688146A (en) | 2019-09-23 | 2019-09-23 | Method, device and storage medium for dynamically configuring monitoring system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110688146A true CN110688146A (en) | 2020-01-14 |
Family
ID=69110050
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910900495.6A Pending CN110688146A (en) | 2019-09-23 | 2019-09-23 | Method, device and storage medium for dynamically configuring monitoring system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110688146A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111796984A (en) * | 2020-06-29 | 2020-10-20 | 平安国际智慧城市科技股份有限公司 | Data monitoring method and device, computer equipment and storage medium |
CN111930441A (en) * | 2020-08-10 | 2020-11-13 | 上海熙菱信息技术有限公司 | Consul-based configuration file management system and method |
CN112328448A (en) * | 2020-10-30 | 2021-02-05 | 中国平安财产保险股份有限公司 | Zookeeper-based monitoring method, monitoring device, equipment and storage medium |
CN112650648A (en) * | 2020-12-30 | 2021-04-13 | 杭州趣链科技有限公司 | Monitoring method, device, equipment and storage medium |
CN112650644A (en) * | 2020-12-22 | 2021-04-13 | 南方电网深圳数字电网研究院有限公司 | Monitoring method and system based on prometheus |
CN112667319A (en) * | 2021-01-12 | 2021-04-16 | 浪潮云信息技术股份公司 | Monitoring system and method based on level division and supporting dynamic expansion |
CN113704058A (en) * | 2021-08-05 | 2021-11-26 | 北京百度网讯科技有限公司 | Business model monitoring method and device and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101854277A (en) * | 2010-06-12 | 2010-10-06 | 河北全通通信有限公司 | Method for monitoring mobile communication operation analysis system |
WO2017016084A1 (en) * | 2015-07-30 | 2017-02-02 | 中兴通讯股份有限公司 | Alarm information notification method and apparatus, and alarm information filtering device |
CN107911470A (en) * | 2017-11-30 | 2018-04-13 | 掌阅科技股份有限公司 | Distributed dynamic load-balancing method, computing device and computer-readable storage medium |
CN108833137A (en) * | 2018-05-18 | 2018-11-16 | 南京南瑞信息通信科技有限公司 | A kind of flexibility micro services Monitoring framework framework |
CN110048888A (en) * | 2019-04-16 | 2019-07-23 | 深圳市致宸信息科技有限公司 | A kind of method based on zabbix monitoring alarm, server, equipment and storage medium |
-
2019
- 2019-09-23 CN CN201910900495.6A patent/CN110688146A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101854277A (en) * | 2010-06-12 | 2010-10-06 | 河北全通通信有限公司 | Method for monitoring mobile communication operation analysis system |
WO2017016084A1 (en) * | 2015-07-30 | 2017-02-02 | 中兴通讯股份有限公司 | Alarm information notification method and apparatus, and alarm information filtering device |
CN107911470A (en) * | 2017-11-30 | 2018-04-13 | 掌阅科技股份有限公司 | Distributed dynamic load-balancing method, computing device and computer-readable storage medium |
CN108833137A (en) * | 2018-05-18 | 2018-11-16 | 南京南瑞信息通信科技有限公司 | A kind of flexibility micro services Monitoring framework framework |
CN110048888A (en) * | 2019-04-16 | 2019-07-23 | 深圳市致宸信息科技有限公司 | A kind of method based on zabbix monitoring alarm, server, equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
李佶澳: "通过consul、confd,动态为prometheus添加监控目标和告警规则", 《博客》 * |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111796984A (en) * | 2020-06-29 | 2020-10-20 | 平安国际智慧城市科技股份有限公司 | Data monitoring method and device, computer equipment and storage medium |
CN111930441A (en) * | 2020-08-10 | 2020-11-13 | 上海熙菱信息技术有限公司 | Consul-based configuration file management system and method |
CN111930441B (en) * | 2020-08-10 | 2024-03-29 | 上海熙菱信息技术有限公司 | Consul-based configuration file management system and method |
CN112328448A (en) * | 2020-10-30 | 2021-02-05 | 中国平安财产保险股份有限公司 | Zookeeper-based monitoring method, monitoring device, equipment and storage medium |
CN112650644A (en) * | 2020-12-22 | 2021-04-13 | 南方电网深圳数字电网研究院有限公司 | Monitoring method and system based on prometheus |
CN112650648A (en) * | 2020-12-30 | 2021-04-13 | 杭州趣链科技有限公司 | Monitoring method, device, equipment and storage medium |
CN112667319A (en) * | 2021-01-12 | 2021-04-16 | 浪潮云信息技术股份公司 | Monitoring system and method based on level division and supporting dynamic expansion |
CN113704058A (en) * | 2021-08-05 | 2021-11-26 | 北京百度网讯科技有限公司 | Business model monitoring method and device and electronic equipment |
CN113704058B (en) * | 2021-08-05 | 2024-04-09 | 北京百度网讯科技有限公司 | Service model monitoring method and device and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110688146A (en) | Method, device and storage medium for dynamically configuring monitoring system | |
CN110688281A (en) | Alarm method and device in monitoring system and storage medium | |
US9600476B2 (en) | Acquiring information dynamically regarding a hardware component in the cloud computing system while on the floor of the data center | |
CN105376107B (en) | Terminal testing method and proxy server | |
CN102255887B (en) | Method and system for providing online services corresponding to multiple mobile devices | |
CN112867988A (en) | Implementing compliance settings by a mobile device to follow a configuration scenario | |
CN110188121B (en) | Service data monitoring method, device, computer equipment and storage medium | |
CN110704158A (en) | Method, apparatus and storage medium for forwarding access requests within a container cluster | |
CN110825772A (en) | Method and device for synchronizing memory data of multiple service instances and storage medium | |
CN114257551A (en) | Distributed current limiting method and system and storage medium | |
CN113296871A (en) | Method, equipment and system for processing container group instance | |
CN114691390A (en) | User mode program processing method and device, storage medium and processor | |
US20150121364A1 (en) | Method, User Equipment, and Application Server for Downloading Application | |
CN111353136A (en) | Method and device for processing operation request | |
CN114637549A (en) | Data processing method, system and storage medium for service grid-based application | |
CN114398397A (en) | Data processing method, device, storage medium and system | |
CN113312159A (en) | Processing method and device for load balancing of Kubernetes cluster and storage medium | |
CN109391658B (en) | Account data synchronization method and equipment, storage medium and terminal thereof | |
CN110858201A (en) | Data processing method and system, processor and storage medium | |
CN110941412B (en) | Method, system and terminal for realizing multi-terminal animation collaborative browsing based on pictures | |
CN113709188B (en) | Session control information processing method, device, system and storage medium | |
CN110688278A (en) | Alarm notification method, device and storage medium | |
CN110609781A (en) | Interface test method, device and storage medium | |
CN112581069A (en) | System, method, apparatus and storage medium for processing task | |
CN110633188A (en) | Method and device for suspending interception and monitoring of codes of application program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200114 |