CN115934242A - Container monitoring method, device, equipment, system and storage medium - Google Patents

Container monitoring method, device, equipment, system and storage medium Download PDF

Info

Publication number
CN115934242A
CN115934242A CN202110914970.2A CN202110914970A CN115934242A CN 115934242 A CN115934242 A CN 115934242A CN 202110914970 A CN202110914970 A CN 202110914970A CN 115934242 A CN115934242 A CN 115934242A
Authority
CN
China
Prior art keywords
monitoring data
container
monitoring
index
processed
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
Application number
CN202110914970.2A
Other languages
Chinese (zh)
Inventor
王鑫
孙涛
张晓倩
丁延超
徐媛媛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202110914970.2A priority Critical patent/CN115934242A/en
Publication of CN115934242A publication Critical patent/CN115934242A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Alarm Systems (AREA)

Abstract

The embodiment of the disclosure provides a container monitoring method, a device, equipment, a system and a storage medium, which are applied to a server. The method comprises the following steps: receiving an external request aiming at monitoring data, wherein the external request carries an identifier of an index to be monitored; determining an index value of an index to be monitored according to the processed monitoring data, wherein the processed monitoring data is obtained by adding a tenant name and a task identification code to basic monitoring data; and sending the index value to the external requester so as to enable the external requester to display the index value. According to the technical scheme of the embodiment of the disclosure, data monitoring based on tenants is realized, and the availability and reliability of the monitored data are effectively ensured.

Description

Container monitoring method, device, equipment, system and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, a system, and a storage medium for monitoring a container.
Background
With the progress of network technology, cloud computing and cloud computing-based service monitoring systems are increasingly used. Among them, the Prometheus system is an open source service monitoring system based on a time series database, and has the advantages of high dimensional data model, visual data display, high efficiency storage, easy operation and maintenance, and the like, thereby being widely applied.
However, the native platform of the Prometheus system is not friendly to monitoring support, and has great limitations in usability and even availability methods, and cannot provide services with high reliability and availability.
Disclosure of Invention
The embodiment of the disclosure provides a container monitoring method, a container monitoring device, a container monitoring equipment, a container monitoring system and a storage medium, which realize tenant-based data monitoring and effectively ensure the availability and reliability of monitoring data.
In a first aspect, an embodiment of the present disclosure provides a container monitoring method, where the container monitoring method is applied to a server, and the container monitoring method includes:
receiving an external request aiming at monitoring data, wherein the external request carries an identifier of an index to be monitored;
determining an index value of an index to be monitored according to the processed monitoring data, wherein the processed monitoring data is obtained by adding a tenant name and a task identification code to basic monitoring data;
and sending the index value to the external requester so as to enable the external requester to display the index value.
Optionally, before determining the index value of the index to be monitored according to the processed monitoring data, the method further includes: acquiring tenant names and task identification codes corresponding to the nodes, and acquiring basic monitoring data with containers as units, wherein the nodes correspond to at least one container; responding to the acquisition action of the acquisition component corresponding to the node, and sending basic monitoring data, tenant names and task identification codes to the acquisition component, wherein the acquisition component is used for adding the tenant names and the task identification codes to the basic monitoring data to obtain processed monitoring data; and obtaining the processed monitoring data from the acquisition assembly.
Optionally, acquiring the tenant name and the task identifier corresponding to the node includes: and polling a task interface or a monitoring index database interface of a manager of the server, and extracting a tenant name and a corresponding task identification code from the task interface or the monitoring index database interface.
Optionally, obtaining post-process monitoring data from the collection assembly comprises: and acquiring the processed monitoring data from the interface of the acquisition assembly in an active grabbing mode.
Optionally, determining an index value of the index to be monitored according to the processed monitoring data includes: determining a processing method based on a preset processing rule corresponding to the index to be monitored; and determining the index value of the index to be monitored based on the processed monitoring data and the processing method.
Optionally, determining an index value of the index to be monitored based on the processed monitoring data and the processing method includes: determining a processing sequence for performing filtering processing, association processing and aggregation processing on the processed monitoring data according to the processing method; and processing the processed monitoring data in sequence according to the processing sequence.
Optionally, sequentially processing the processed monitoring data according to the processing sequence, including: according to the processing sequence, when the processed monitoring data needs to be subjected to correlation processing, determining a corresponding label of an index to be monitored; determining first data with a corresponding label in the processed monitoring data and second data for calculating to obtain an index to be monitored; and adding the first data into the tag group of the second data to obtain the data after the association processing is finished.
Optionally, sequentially processing the processed monitoring data according to the processing sequence, including: according to the processing sequence, when the processed monitoring data needs to be subjected to aggregation processing, determining an aggregation function corresponding to the index to be monitored; and substituting the processed monitoring data subjected to the filtering treatment and the correlation treatment into the aggregation function to obtain an index of the completion of the aggregation treatment.
Optionally, the method further comprises: and when the index value meets the preset alarm rule, generating alarm information and sending the alarm information to the corresponding contact party.
Optionally, the external request further carries a secret key of the tenant, and before determining an index value of the index to be monitored according to the processed monitoring data, the method further includes: and determining that the key contained in the external request is consistent with the key corresponding to the tenant.
In a second aspect, an embodiment of the present disclosure provides a container monitoring method, where the container monitoring method is applied to a collection assembly, and the container monitoring method includes:
acquiring basic monitoring data, tenant names and corresponding task identification codes in nodes where acquisition components are located, wherein the basic monitoring data take a container as a unit;
matching the corresponding relation between the tenant names and the containers in the nodes based on the task identification codes;
adding the tenant name and the task identification code into the basic monitoring data corresponding to the container based on the corresponding relation to obtain processed monitoring data;
and outputting the processed monitoring data to a server.
Optionally, matching, based on the task identifier, a correspondence between a tenant name and a container in the node includes: determining the identifier of the container associated with the task identification code based on a preset association rule, wherein the association rule is used for expressing a preset condition for judging whether the container identifier is matched with the task identification code; and determining the corresponding relation between the tenant name and the container based on the corresponding relation between the task identification code and the tenant.
In a third aspect, the present disclosure further provides a container monitoring apparatus, where the container monitoring apparatus is applied to a server, and the container monitoring apparatus includes:
the receiving module is used for receiving an external request aiming at the monitoring data, and the external request carries an identifier of an index to be monitored;
the processing module is used for determining an index value of an index to be monitored according to the processed monitoring data, and the processed monitoring data is obtained by adding a tenant name and a task identification code to the basic monitoring data; and transmitting the index value to the external requester so that the external requester displays the index value.
Optionally, the processing module is further configured to: before determining an index value of an index to be monitored according to the processed monitoring data, acquiring a tenant name and a task identification code corresponding to a node, and acquiring basic monitoring data with a container as a unit, wherein the node corresponds to at least one container; responding to the acquisition action of the acquisition component corresponding to the node, and sending basic monitoring data, tenant names and task identification codes to the acquisition component, wherein the acquisition component is used for adding the tenant names and the task identification codes to the basic monitoring data to obtain processed monitoring data; and obtaining the processed monitoring data from the acquisition assembly.
Optionally, the processing module is specifically configured to: and polling a task interface or a monitoring index database interface of a manager of the server, and extracting a tenant name and a corresponding task identification code from the task interface or the monitoring index database interface.
Optionally, the processing module is specifically configured to: and acquiring the processed monitoring data from the interface of the acquisition assembly in an active grabbing mode.
Optionally, the processing module is specifically configured to: determining a processing method based on a preset processing rule corresponding to the index to be monitored; and determining an index value of the index to be monitored based on the processed monitoring data and the processing method.
Optionally, the processing module is specifically configured to: determining a processing sequence for performing filtering processing, association processing and aggregation processing on the processed monitoring data according to the processing method; and processing the processed monitoring data in sequence according to the processing sequence.
Optionally, the processing module is specifically configured to: according to the processing sequence, when the processed monitoring data needs to be subjected to correlation processing, determining a corresponding label of an index to be monitored; determining first data with a corresponding label in the processed monitoring data and second data for calculating to obtain an index to be monitored; and adding the first data into the tag group of the second data to obtain the data after the association processing is finished.
Optionally, the processing module is specifically configured to: according to the processing sequence, when the processed monitoring data needs to be subjected to aggregation processing, determining an aggregation function corresponding to the index to be monitored; and substituting the processed monitoring data subjected to the filtering treatment and the correlation treatment into the aggregation function to obtain an index of the completion of the aggregation treatment.
Optionally, the processing module is further configured to: and when the index value meets the preset alarm rule, generating alarm information and sending the alarm information to the corresponding contact party.
Optionally, the processing module is further configured to: and when the external request also carries the key of the tenant, determining that the key contained in the external request is consistent with the key corresponding to the tenant before determining the index value of the index to be monitored according to the processed monitoring data.
In a fourth aspect, the present disclosure also provides a container monitoring device applied to a collection assembly, the container monitoring device comprising:
the determining module is used for acquiring basic monitoring data, tenant names and corresponding task identification codes in the nodes where the acquisition components are located;
the processing module is used for matching the corresponding relation between the tenant names and the containers in the nodes based on the task identification codes; adding a tenant and task identification code label on the basic monitoring data corresponding to the container based on the corresponding relation to obtain processed basic monitoring data; and outputting the processed basic monitoring data.
Optionally, the determining module is further configured to: matching the corresponding relation between the tenant names and the containers in the nodes based on the task identification codes comprises the following steps: determining the identifier of the container associated with the task identification code based on a preset association rule, wherein the association rule is used for representing a preset condition for judging whether the container identifier is matched with the task identification code; and determining the corresponding relation between the tenant name and the container based on the corresponding relation between the task identification code and the tenant.
In a fifth aspect, the present disclosure also provides an electronic device, including:
at least one processor;
and a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to cause the electronic device to perform the container monitoring method of any of the embodiments corresponding to the first and second aspects.
In a sixth aspect, the present disclosure also provides a container monitoring system comprising:
the collection layer, the collection warning layer and the management layer are sequentially in communication connection with one another;
the acquisition layer comprises at least one node, an acquisition assembly and at least one container are arranged in the node, and the acquisition assembly is used for executing the container monitoring method of any embodiment corresponding to the second aspect;
the acquisition warning layer comprises an alarm management module and a control module, and the control module is respectively in communication connection with the acquisition layer and the management layer;
the management layer comprises a service monitoring system for performing the container monitoring method of any embodiment corresponding to the first aspect.
Optionally, the collection warning layer includes an alarm management module and a control module based on the prometies system.
In a seventh aspect, the present disclosure also provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the method for monitoring a container according to any embodiment corresponding to the first aspect and the second aspect of the present disclosure is implemented.
In an eighth aspect, the present disclosure also provides a computer program product comprising computer executable instructions for implementing the container monitoring method according to any embodiment corresponding to the first and second aspects of the present disclosure when the computer executable instructions are executed by a processor.
According to the container monitoring method, the device, the equipment, the system and the storage medium provided by the embodiment of the disclosure, the index value corresponding to the external request is determined by receiving the external request for the monitoring data, the corresponding index value is obtained by adding the processed monitoring data with the tenant name and the task identification code and is sent to the requester, so that the response to the external request is completed, the index value is generated by the monitoring data with the tenant name and the task identification code, the index value can be refined to different tenants and tasks, the effective monitoring and management of the service conditions of the servers of different tenants are effectively ensured, and the availability and the reliability of the monitoring data are further ensured.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is an application scenario diagram of a container monitoring method according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of a container monitoring method provided by an embodiment of the present disclosure;
FIG. 3 is a flow chart of a container monitoring method provided in accordance with yet another embodiment of the present disclosure;
FIG. 4 is a flow chart of a method of container monitoring provided by yet another embodiment of the present disclosure;
FIG. 5 is a flow chart of a method of container monitoring provided by yet another embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of a container monitoring device according to yet another embodiment of the present disclosure;
FIG. 7 is a schematic structural diagram of a container monitoring device according to yet another embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device according to yet another embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a container monitoring system according to yet another embodiment of the present disclosure.
With the foregoing drawings in mind, certain embodiments of the disclosure have been shown and described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The following describes the technical solutions of the present disclosure and how to solve the above technical problems in specific embodiments. These several specific embodiments may be combined with each other below, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present disclosure will be described below with reference to the accompanying drawings.
The following is an explanation of the nouns appearing in the scheme:
the service monitoring system: the monitoring system is mainly a distributed monitoring system and is used for monitoring virtual machines such as a database based on the server or a cloud computing host on the server; the distributed Operating System is typically a Data Center Operating System (DC/OS for short), and is a distributed Operating System using the cluster manager Apache tasks as the kernel of the distributed System.
Propamilies system: an open-source distributed monitoring system based on a time sequence database is also a DC/OS, and can monitor a Server, a database and a Virtual Private Server (VPS for short).
Native platform: refers to the existing open source base version of the Prometheus system.
A container: facilities for housing applications and providing the infrastructure and services required by the applications. The container exists on the server and is the smallest software unit that serves the underlying data that the monitoring system can monitor.
And (3) node: the minimum hardware unit in the server generally represents a single physical device, and may also include a plurality of physical machine devices; a node typically contains multiple containers.
Clustering: a plurality of containers in a server, and a collection of a plurality of nodes. From the perspective of external access, the software cells corresponding to a cluster are collectively referred to as a usable area.
A tenant: each tenant may rent a plurality of containers or only one container.
The collection assembly: a virtual data collection tool running on a server.
The existing Promiex system is based on a data sequence database, and has the advantages of high-dimensional data model, visual data display, high-efficiency storage, easiness in operation and maintenance and the like, so that the system is widely applied to cloud computing and cloud virtual machines. However, since the monitoring of the promiscuous system on the server is based on the container, only the monitoring data based on the container or the monitoring data of the whole node and cluster can be obtained, at this time, all the monitoring data corresponding to different tenants are mixed together, and for the administrator who provides cloud computing or renting the cloud virtual machine, when the use condition indexes for different tenants need to be obtained, the indexes obtained based on the monitoring data cannot directly reflect the conditions of different tenants, so that the monitoring performance of the service monitoring system is limited, and the availability and the reliability are both insufficient.
In order to solve the problem, an embodiment of the present disclosure provides a container monitoring method, where in generating an index, the processed monitoring data added with a tenant name and a task identifier is used, so that the processed monitoring data can be distinguished according to different tenants and tasks, and it is further ensured that the generated index can also correspond to a specific tenant and task, thereby significantly improving an index monitoring effect.
The following explains an application scenario of the embodiment of the present disclosure:
fig. 1 is an application scenario diagram of a container monitoring method according to an embodiment of the present disclosure. As shown in fig. 1, in the process of performing container monitoring, the service monitoring system 100 determines an index that needs to be generated according to an input operation of the user 110 at the front end 111, and then generates a corresponding index based on monitoring data of the server 130 obtained from the collection component 120, and pushes the index to the corresponding user 110, thereby completing container monitoring.
It should be noted that, in the scenario shown in fig. 1, the user and the capturing component are illustrated as an example, but the disclosure is not limited thereto, that is, the number of the user and the capturing component may be any.
The container monitoring method provided by the present disclosure is explained in detail below by specific examples.
Fig. 2 is a flowchart of a container monitoring method according to an embodiment of the present disclosure. The container monitoring method is applied to a server. As shown in fig. 2, the container monitoring method provided in this embodiment includes the following steps:
step S201, an external request for monitoring data is received.
Wherein, the external request carries the identifier of the index to be monitored.
The external requests are mainly from users of the server, such as tenants and administrators. Among them, there are generally a plurality of tenants. Based on the operation of the user at the client, the service monitoring system on the server receives a request, namely an external request, for sending the index to be monitored specified by the operation.
The external request provides the corresponding identification of the index to be monitored so that the service monitoring system can determine the index to be generated. If the information of the external request contains an abbreviated label of the index of the container use time, the service monitoring system can determine the index needing to be generated as the container use time through the abbreviated label.
Further, the index to be monitored is a corresponding index generated by the service monitoring system based on the obtained monitoring data. The index to be monitored is an index type contained in a monitoring index database which is pre-built in the service monitoring system, so that when the service monitoring system confirms the index to be monitored corresponding to the external request, the generation mode of the index can be determined through a record corresponding to the index to be monitored in the monitoring index database, and the corresponding index is generated based on the record.
And S202, determining an index value of the index to be monitored according to the processed monitoring data.
And adding the tenant name and the task identification code into the basic monitoring data to obtain the processed monitoring data.
The basic monitoring data is data which can be collected by the service monitoring system through a self-contained basic control, such as the use duration and the data communication volume which take a container as a unit. After the tenant names and the task identification codes are added to the monitoring data, corresponding indexes can be calculated respectively based on different tenants. Therefore, the basic monitoring data added with the tenant name and the task identification code is processed data.
Further, determining an index value of the index to be monitored, namely determining a calculation mode of the index to be monitored based on records in a monitoring index database, and then calculating to obtain a corresponding index value through the processed monitoring data based on the determined calculation mode.
For example, the index to be monitored is the daily traffic usage of the tenant a in the last 30 days, and therefore, the index value of the index to be monitored can be obtained by querying the calculation manner of the daily traffic usage recorded in the monitoring index database and then based on the daily traffic usage (i.e., the basic monitoring data with the tenant name) corresponding to the tenant a.
Step S203, sending the index value to the external requester so that the external requester displays the index value.
The display may include display on a display device of the external requester based on a format specified in the external request, or may be display based on a set format by a device of the external requester by directly transmitting the index value to the external requester. Such as creating a new page to display the indicator value.
In some embodiments, the sending of the index value to the external requester is actively pushed to the external requester by the service monitoring system after the calculation is completed, or the index value can be obtained by the external requester through an active grabbing manner.
According to the container monitoring method provided by the embodiment of the disclosure, the index value corresponding to the external request is determined by receiving the external request for the monitoring data, the corresponding index value is obtained by adding the processed monitoring data with the tenant name and the task identification code, and is sent to the requester, so that the response to the external request is completed, the index value is generated based on the monitoring data with the tenant name and the task identification code, the index value can be refined to be specific to different tenants and tasks, the effective monitoring and management of the service conditions of the servers of different tenants can be effectively guaranteed, and the availability and reliability of the monitoring data can be further guaranteed.
Fig. 3 is a flowchart of a container monitoring method according to another embodiment of the disclosure. The container monitoring method provided by the embodiment of the disclosure is a refinement on the basis of the embodiment shown in fig. 2. As shown in fig. 3, the container monitoring method provided in this embodiment includes the following steps:
and S301, acquiring tenant names and task identification codes corresponding to the nodes, and acquiring basic monitoring data taking the container as a unit.
Wherein the node corresponds to at least one container.
The server is provided with a basic acquisition tool, such as a cAdvisor, and can acquire information of the container running on the server, so that acquisition of basic monitoring data based on the container is realized.
The basic acquisition tool takes the nodes as a range, and each node of the server is provided with one basic acquisition tool for acquiring basic monitoring data in the node range.
Optionally, polling a task interface or a monitoring index database interface of a manager of the server, and extracting a tenant name and a corresponding task identification code from the task interface or the monitoring index database interface.
The manager here, i.e. the aforementioned cluster manager Apache messes, is capable of capturing and recording tenant information, such as tenant names and task identifiers, running in the cluster. The task interface of the manager is an interface capable of acquiring the collected information in the cluster manager.
The monitoring index database is a database built in the service monitoring system and is used for recording relevant information of indexes which can be calculated and generated by the service monitoring system and simultaneously recording information collected in the cluster, such as collected and stored tenant information, such as tenant names and task identification codes.
Therefore, the tenant name and the corresponding task identification code can be obtained by accessing the task interface of the cluster manager or the interface of the monitoring index database.
And storing the acquired data in a database corresponding to the service monitoring system. Specifically, the service monitoring system is based on a Promiers system, and the Promiers system is a time sequence database, so that data acquired by the service monitoring system and data acquired by a basic acquisition tool can be directly stored in the database corresponding to the service monitoring system, and are convenient to read and call by setting a label.
And S302, responding to the collection action of the collection component corresponding to the node, and sending basic monitoring data, the tenant name and the task identification code to the collection component.
The collection assembly is used for adding the tenant name and the task identification code into the basic monitoring data to obtain the processed monitoring data.
The deployment range of the acquisition component is the same as that of the basic acquisition tool, and the acquisition component acquires data by taking the node as the range. The acquisition component acquires data acquired by the basic acquisition tool, tenant names and task identification codes acquired by the service monitoring system from a database of the service monitoring system, and acquires processed monitoring data by adding key value pairs to the basic monitoring data.
Illustratively, the acquisition component acquires that the tenant of the node has a tenant a from the database, the task identifier of the tenant a is m, the container rented by the tenant a is a container 1 and a container 2 in the node, basic monitoring data corresponding to the container 1 and the container 2 is read, if the used traffic is available, and then the tenant name and the task identifier are added to the basic monitoring data, that is, the used traffic of the container 1 and the container 2 is corresponding to the tenant a and the task m. Therefore, indexes such as the used flow of the tenant A or the used flow of the task m can be conveniently calculated subsequently.
And step S303, obtaining the processed monitoring data from the acquisition assembly.
In some embodiments, the service monitoring system obtains the processed monitoring data from the acquisition component at regular time, such as once per minute, so as to facilitate calculation of the corresponding index according to an external request at any time.
Optionally, the processed monitoring data is acquired from the interface of the acquisition component by an active capture mode.
The service monitoring system directly and actively captures the processed monitoring data from the acquisition component of each node, and on one hand, the monitoring data are processed into corresponding indexes according to an external request.
Step S304, receiving an external request aiming at the monitoring data.
Wherein, the external request carries the identifier of the index to be monitored.
And aiming at the external request of the monitoring data, the external request requires to feed back the relevant indexes based on the monitoring data, namely the indexes to be monitored.
And S305, determining an index value of the index to be monitored according to the processed monitoring data.
And adding the tenant name and the task identification code into the basic monitoring data to obtain the processed monitoring data.
Through the processed monitoring data with the tenant name and the task identification code, index values corresponding to the tenant and the task can be obtained.
For example, the processed monitoring data such as the aforementioned used flows of the container 1 and the container 2 corresponding to the tenant a and the task m, if the externally requested index to be monitored is a flow usage value of the task m, the flow usage value only needs to be obtained by adding the used flows of the task m corresponding to the container 1 and the container 2.
Step S306, sending the index value to the external requester so that the external requester displays the index value.
As in the foregoing example, if a request for an index of the traffic usage value is issued by tenant a, the calculated traffic usage value of task m is sent to tenant a, and the request is completed.
In the embodiment, the basic monitoring data, the tenant name and the task identification code are collected in advance, and the basic monitoring data is processed into the processed monitoring data with the tenant name and the task identification code through the collection component, so that when an external request is received, an index value corresponding to the external request is obtained based on the processed monitoring data, the monitoring index can be specific to a specific tenant and a specific task, the monitoring capability and the usability of the service monitoring system are remarkably improved, and the condition that the monitoring index is difficult to use when only the container-based index can be obtained is avoided.
Fig. 4 is a flowchart of a container monitoring method according to another embodiment of the disclosure. As shown in fig. 4, the container monitoring method may include:
step S401, receiving an external request for monitoring data.
Wherein, the external request carries the identifier of the index to be monitored.
In some embodiments, the index to be monitored is an index pre-embedded in a monitoring index database, and the monitoring data is data that has been captured and stored in the database of the service monitoring system.
Optionally, the external request further carries a key of the tenant, and it is determined that the key included in the external request is consistent with the key corresponding to the tenant.
In some embodiments, when a new tenant is created in the server, a corresponding key is assigned to the new tenant, so that the service monitoring system identifies the corresponding tenant identity according to the key carried in the external request.
Thus, the key corresponds one-to-one to the tenant name. Here, the tenant name is a non-repetitive tenant identity, not a tenant name that can occur repeatedly.
And S402, determining a processing method based on a preset processing rule corresponding to the index to be monitored.
The processing rule is used for representing the required processed monitoring data of the index to be monitored and a specific calculation method, and the processing method refers to the specific calculation method.
For example, the processing rule of the index to be monitored, which is the average memory occupancy rate of the specific tenant, is to average the memory occupancy rates of the specific tenants within a set time period, where the required processed monitoring data is the memory occupancy rate of the specific tenant at a specific time point, and the processing method is to average the processed monitoring data within the set time period.
And S403, determining an index value of the index to be monitored based on the processed monitoring data and the processing method.
And determining an index value of the index to be monitored, namely calculating to obtain a corresponding index value based on the processed monitoring data and the processing method.
Further, the processing sequence of filtering processing, association processing and aggregation processing of the processed monitoring data is determined according to the processing method.
And processing the processed monitoring data in sequence according to the processing sequence.
In the process of processing the processed monitoring data, three processing processes of filtering, associating and aggregating are used, and the conditions and the sequence based on the filtering, associating and aggregating are different according to different indexes corresponding to external requests.
Illustratively, for an index of the maximum memory usage rate of the tenant a, the required processed monitoring data is the real-time memory usage rate of each container corresponding to the tenant a, and the maximum memory usage rate of each container is obtained through filtering processing, and then based on a corresponding algorithm, the maximum memory usage rates are associated, and through an aggregation function, the maximum memory usage rate corresponding to the tenant a is obtained through calculation.
Optionally, the step of associating includes: according to the processing sequence, when the processed monitoring data needs to be subjected to correlation processing, determining a corresponding label of an index to be monitored;
determining first data with a corresponding label in the processed monitoring data and second data for calculating to obtain an index to be monitored;
and adding the first data into the tag group of the second data to obtain the data after the association processing is finished.
Wherein, the corresponding label of the index to be monitored is the kind label of the index to be monitored, such as the average flow at peak time; the first data is data corresponding to the type tag in the processed monitoring data, such as real-time flow, and when the processed monitoring data cannot directly obtain an index value of the index to be monitored, the association between the processed monitoring data and the index to be monitored needs to be established through other monitoring data. The peak hour average traffic is obviously not directly available through the first data; there is therefore a need to be able to establish second data relating peak hours to real-time traffic, such as the time of occurrence of peak hours recorded in a database of monitoring metrics, and therefore to correlate the second data with the first data in order to obtain the metrics to be monitored.
Further, the association process includes determining the association relationship by reading the association tag of the preset index in the monitoring index database.
Optionally, the step of polymerizing comprises: according to the processing sequence, when the processed monitoring data needs to be subjected to aggregation processing, determining an aggregation function corresponding to the index to be monitored;
and substituting the processed monitoring data subjected to the filtering treatment and the correlation treatment into the aggregation function to obtain an index of the completion of the aggregation treatment.
The processed monitoring data is basic monitoring data with tenant names and task identification codes, so when the indexes to be monitored are for tenants or tasks, the processed monitoring data needs to be aggregated, for example, the tenants correspond to 32 containers, and the indexes to be monitored are for the tenants, the corresponding processed monitoring data of the 32 containers needs to be aggregated, such as summing or averaging.
Step S404, sending the index value to the external requester so that the external requester displays the index value.
Optionally, when the index value meets a preset alarm rule, alarm information is generated and sent to the corresponding contact party.
An alarm rule is also preset in the service monitoring system, so that when the processed monitoring data monitored in real time or the index value obtained in response to an external request meets the alarm rule, the corresponding processed monitoring data or the index value and the corresponding alarm information are pushed to the outside, and a tenant or a manager can respond and process in time.
The alarm rule comprises conditions for generating alarm information, corresponding alarm information content and a pushed contact party. The contact party is generally the administrator of the server and the tenant corresponding to the processed monitoring data, or all tenants of the nodes corresponding to the eligible monitoring data.
In this embodiment, a processing method corresponding to the index to be monitored is determined according to the index to be monitored corresponding to the external request, the processed monitoring data is processed correspondingly to obtain an index value, and whether the processed monitoring data or the index value of the index to be monitored meets the alarm rule is monitored in real time, so that effective monitoring of the operating state in the server is ensured, the corresponding index value is generated quickly, and the monitoring effect is ensured.
Fig. 5 is a flowchart of a container monitoring method according to an embodiment of the disclosure. The container monitoring method is applied to the acquisition assembly. As shown in fig. 5, the container monitoring method provided in this embodiment includes the following steps:
step S501, acquiring basic monitoring data, tenant names and corresponding task identification codes in nodes where the acquisition components are located.
Wherein, the basic monitoring data takes a container as a unit.
The acquisition component actively acquires basic monitoring data, tenant names and task identification codes of nodes corresponding to the nodes in a database of the service monitoring system. Generally, the collection process is a timed collection, for example, for different basic monitoring data, different time durations are adopted, and for tenant names and task identifiers, the collection is performed once every 6 hours or every 24 hours.
And step S502, matching the corresponding relation between the tenant names and the containers in the nodes based on the task identification codes.
Specifically, the method comprises the following steps:
step one (not shown), based on the preset association rule, the identification of the container associated with the task identification code is determined.
The association rule is used for representing a preset condition for judging whether the container identifier is matched with the task identification code.
Generally, the basic monitoring data based on the container includes an identification code or related label information of the task being executed, and the object of the specific corresponding task cannot be directly determined by directly using the identification code or related label information. Therefore, the basic monitoring data and tasks based on the container can be determined by comparing the identification code or label information in the container with the corresponding task identification code in the node in the database of the service monitoring system.
And step two (not shown), determining the corresponding relation between the tenant name and the container based on the corresponding relation between the task identification code and the tenant.
Because the tenant name and the task identification code stored in the cluster manager or the monitoring index database have a corresponding relationship, the corresponding relationship between the tenant name and the container-based basic monitoring data is obtained according to the association relationship between the task identification code and the container-based basic monitoring data.
And S503, adding the tenant name and the task identification code in the basic monitoring data corresponding to the container based on the corresponding relation to obtain the processed monitoring data.
And adding key value pairs corresponding to the tenant names and the task identification codes to the container-based basic monitoring data according to the corresponding relation obtained in the step S5022, so as to obtain the processed monitoring data.
And step S504, outputting the processed monitoring data to a server.
In some embodiments, the process of outputting the processed monitoring data to the server or the service monitoring system is output based on an active grab action of the service monitoring system.
In this embodiment, the acquisition component acquires basic monitoring data, tenant names and corresponding task identifiers in the nodes where the acquisition component is located, matches the corresponding relationship between tenant names and containers in the nodes if and based on the task identifiers, and then adds the tenant names and the task identifiers on the basis of the basic monitoring data based on the corresponding relationship, so that the processed monitoring data is obtained and output to a server or a service monitoring system, thereby completing data acquisition and processing, effectively facilitating the service monitoring system to identify and monitor data, and improving monitoring availability and reliability.
Fig. 6 is a schematic structural diagram of a container monitoring device according to an embodiment of the present disclosure. The container monitoring apparatus is applied to a server, and as shown in fig. 6, the container monitoring apparatus 600 includes: a receiving module 610 and a processing module 620. Wherein:
a receiving module 610, configured to receive an external request for monitoring data, where the external request carries an identifier of an index to be monitored;
a processing module 620, configured to determine an index value of the to-be-monitored index according to processed monitoring data, where the processed monitoring data is obtained by adding a tenant name and a task identifier to basic monitoring data; and sending the index value to the external requester so that the external requester displays the index value.
Optionally, the processing module 620 is further configured to: before determining an index value of an index to be monitored according to the processed monitoring data, acquiring a tenant name and a task identification code corresponding to a node, and acquiring basic monitoring data with a container as a unit, wherein the node corresponds to at least one container; responding to the acquisition action of the acquisition component corresponding to the node, and sending basic monitoring data, tenant names and task identification codes to the acquisition component, wherein the acquisition component is used for adding the tenant names and the task identification codes to the basic monitoring data to obtain processed monitoring data; and obtaining the processed monitoring data from the acquisition assembly.
Optionally, the processing module 620 is specifically configured to: and polling a task interface or a monitoring index database interface of a manager of the server, and extracting a tenant name and a corresponding task identification code from the task interface or the monitoring index database interface.
Optionally, the processing module 620 is specifically configured to: and acquiring the processed monitoring data from the interface of the acquisition assembly in an active grabbing mode.
Optionally, the processing module 620 is specifically configured to: determining a processing method based on a preset processing rule corresponding to the index to be monitored; and determining an index value of the index to be monitored based on the processed monitoring data and the processing method.
Optionally, the processing module 620 is specifically configured to: determining a processing sequence for performing filtering processing, association processing and aggregation processing on the processed monitoring data according to the processing method; and processing the processed monitoring data in sequence according to the processing sequence.
Optionally, the processing module 620 is specifically configured to: according to the processing sequence, when the processed monitoring data needs to be subjected to correlation processing, determining a corresponding label of an index to be monitored; determining first data with a corresponding label in the processed monitoring data and second data for calculating to obtain an index to be monitored; and adding the first data into the tag group of the second data to obtain the data after the association processing is finished.
Optionally, the processing module 620 is specifically configured to: according to the processing sequence, when the processed monitoring data needs to be subjected to aggregation processing, determining an aggregation function corresponding to the index to be monitored; and substituting the processed monitoring data subjected to the filtering treatment and the correlation treatment into the aggregation function to obtain an index of the completion of the aggregation treatment.
Optionally, the processing module 620 is further configured to: and when the index value meets the preset alarm rule, generating alarm information and sending the alarm information to the corresponding contact party.
Optionally, the processing module 620 is further configured to: and when the external request also carries the key of the tenant, determining that the key contained in the external request is consistent with the key corresponding to the tenant before determining the index value of the index to be monitored according to the processed monitoring data.
In this embodiment, the container monitoring device can realize container monitoring and system data monitoring based on tenants and tasks by combining the modules, and effectively ensure monitoring accuracy and availability.
Fig. 7 is a schematic structural diagram of a container monitoring device according to an embodiment of the present disclosure. The container monitoring apparatus is applied to the collection assembly, as shown in fig. 7, and the container monitoring apparatus 700 includes: a determination module 710 and a processing module 720. Wherein:
the determining module 710 is configured to obtain basic monitoring data, a tenant name, and a corresponding task identifier in a node where the collection component is located.
A processing module 720, configured to match a corresponding relationship between a tenant name and a container in a node based on the task identifier; on the basis of the corresponding relation, adding a tenant and task identification code label on the basic monitoring data corresponding to the container to obtain processed basic monitoring data; and outputting the processed basic monitoring data.
Optionally, the determining module 710 is further configured to: matching the corresponding relation between the tenant names and the containers in the nodes based on the task identification codes comprises the following steps: determining the identifier of the container associated with the task identification code based on a preset association rule, wherein the association rule is used for representing a preset condition for judging whether the container identifier is matched with the task identification code; and determining the corresponding relation between the tenant name and the container based on the corresponding relation between the task identification code and the tenant.
In this embodiment, the container monitoring device can realize the function of adding labels such as tenant names and task identification codes to basic monitoring data by combining the modules, so as to obtain and output processed monitoring data, and because the processed monitoring data contains tenant and task information, the data isolation of the monitoring data based on tenants and tasks is realized.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure, and as shown in fig. 8, the electronic device 800 includes: a memory 810 and a processor 820.
The memory 810 stores, among other things, computer programs that may be executed by the at least one processor 820. The computer program is executed by the at least one processor 820 to cause the electronic device to implement the container monitoring method as provided in any of the embodiments above.
Wherein the memory 810 and the processor 820 may be connected by a bus 830.
The related descriptions may be understood by referring to the related descriptions and effects corresponding to the method embodiments, which are not repeated herein.
Fig. 9 is a schematic structural diagram of a container monitoring system according to an embodiment of the present disclosure, where the container monitoring system 900 includes: the acquisition layer 910, the acquisition warning layer 920 and the management layer 930 are sequentially connected with one another in a communication manner;
the collection layer 910 comprises at least one node, wherein a collection component and at least one container are arranged in the node, and the collection component is used for executing the container monitoring method according to any embodiment corresponding to the second aspect. In the foregoing embodiment of the present solution, both the node and the node are disposed in the server.
The acquisition warning layer 920 comprises an alarm management module and a control module, and the control module is in communication connection with the acquisition layer and the management layer respectively.
In the foregoing embodiment of the present disclosure, the basic collection tool is a tool in the control module.
Optionally, the collection warning layer 920 includes an alarm management module and a control module based on the prometix system.
The management layer 930 comprises a service monitoring system for performing the container monitoring method of any embodiment corresponding to the first aspect.
Optionally, the management layer is in communication connection with an external terminal, and a tenant of the server can check existing monitoring information through the external terminal, for example, check a monitoring view through an imaging interface, and at this time, the service monitoring system can obtain corresponding monitoring data through a control module, an acquisition component and the like; and requests for creating a new monitoring view, modifying the monitoring view, inquiring and modifying alarm rule information and the like can also be initiated through an external terminal, and the requests can be completed through the cooperation of the service monitoring system, the acquisition warning layer and the acquisition layer.
In this embodiment, the container monitoring system is divided into an acquisition layer, an acquisition alarm layer and a management layer, so that container monitoring based on the promiscuous system is realized, and an acquisition component is arranged at each node of the acquisition layer, so that data isolation based on tenant names and task identification codes is realized, and accuracy, usability and reliability of data monitoring are remarkably improved.
One embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, the computer program being executable by a processor to implement a container monitoring method as provided by any of the above method embodiments.
The computer readable storage medium may be, among others, ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
One embodiment of the present disclosure provides a computer program product comprising computer executable instructions for implementing a container monitoring method as in the above-described method embodiment when executed by a processor.
In the several embodiments provided in the present disclosure, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of modules is merely a division of logical functions, and an actual implementation may have another division, for example, a plurality of modules or components may be combined or 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, devices or modules, and may be in an electrical, mechanical or other form.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (18)

1. A container monitoring method is applied to a server, and comprises the following steps:
receiving an external request aiming at monitoring data, wherein the external request carries an identifier of an index to be monitored;
determining an index value of the index to be monitored according to the processed monitoring data, wherein the processed monitoring data is obtained by adding a tenant name and a task identification code to basic monitoring data;
and sending the index value to the external requester so as to enable the external requester to display the index value.
2. The method for monitoring a container according to claim 1, wherein before determining the index value of the index to be monitored according to the processed monitoring data, the method further comprises:
acquiring tenant names and task identification codes corresponding to nodes, and acquiring basic monitoring data with containers as units, wherein the nodes correspond to at least one container;
responding to the acquisition action of an acquisition component corresponding to the node, and sending the basic monitoring data, the tenant name and the task identification code to the acquisition component, wherein the acquisition component is used for adding the tenant name and the task identification code to the basic monitoring data to obtain processed monitoring data;
and obtaining the processed monitoring data from the acquisition assembly.
3. The container monitoring method according to claim 2, wherein the tenant name and the task identifier corresponding to the collection node include:
polling a task interface or a monitoring index database interface of a manager of the server, and extracting the tenant name and the corresponding task identification code from the task interface or the monitoring index database interface.
4. The method of claim 2, wherein said obtaining processed monitoring data from said collection assembly comprises:
and acquiring the processed monitoring data from the interface of the acquisition assembly in an active grabbing mode.
5. The method for monitoring a container according to claim 1, wherein the determining the index value of the index to be monitored according to the processed monitoring data comprises:
determining a processing method based on a preset processing rule corresponding to the index to be monitored;
and determining the index value of the index to be monitored based on the processed monitoring data and the processing method.
6. The method for monitoring a container according to claim 5, wherein the determining the index value of the index to be monitored based on the processed monitoring data and the processing method comprises:
determining a processing sequence for performing filtering processing, association processing and aggregation processing on the processed monitoring data according to the processing method;
and processing the processed monitoring data in sequence according to the processing sequence.
7. The container monitoring method of claim 6, wherein said sequentially processing the processed monitoring data according to the processing order comprises:
according to the processing sequence, when the processed monitoring data needs to be subjected to correlation processing, determining a corresponding label of the index to be monitored;
determining first data with the corresponding label in the processed monitoring data and second data for calculating the index to be monitored;
and adding the first data into the tag group of the second data to obtain the data after the association processing is finished.
8. The container monitoring method of claim 6, wherein said sequentially processing the processed monitoring data according to the processing order comprises:
according to the processing sequence, when the processed monitoring data needs to be subjected to aggregation processing, determining an aggregation function corresponding to the index to be monitored;
and substituting the processed monitoring data which is subjected to filtering treatment and correlation treatment into the aggregation function to obtain an index after the aggregation treatment.
9. The container monitoring method according to any one of claims 1 to 8, further comprising:
and when the index value meets a preset alarm rule, generating alarm information and sending the alarm information to a corresponding contact party.
10. The method according to any one of claims 1 to 8, wherein the external request further carries a key of a tenant, and before determining the index value of the index to be monitored according to the processed monitoring data, the method further comprises:
and determining that the key contained in the external request is consistent with the key corresponding to the tenant.
11. A container monitoring method, applied to a collection assembly, the container monitoring method comprising:
acquiring basic monitoring data, tenant names and corresponding task identification codes in nodes where the acquisition components are located, wherein the basic monitoring data take containers as units;
matching the corresponding relation between the tenant names and the containers in the nodes based on the task identification codes;
adding tenant names and task identification codes to basic monitoring data corresponding to the containers based on the corresponding relation to obtain processed monitoring data;
and outputting the processed monitoring data to a server.
12. The container monitoring method according to claim 11, wherein the matching a tenant name and a container in the node based on the task identifier comprises:
determining the identifier of the container associated with the task identification code based on a preset association rule, wherein the association rule is used for representing a preset condition for judging whether the container identifier is matched with the task identification code;
and determining the corresponding relation between the tenant name and the container based on the corresponding relation between the task identification code and the tenant.
13. A container monitoring device, applied to a server, comprises:
the system comprises a receiving module, a monitoring module and a sending module, wherein the receiving module is used for receiving an external request aiming at monitoring data, and the external request carries an identifier of an index to be monitored;
the processing module is used for determining an index value of the index to be monitored according to processed monitoring data, wherein the processed monitoring data is obtained by adding a tenant name and a task identification code to basic monitoring data; and sending the index value to the external requester so that the external requester displays the index value.
14. A container monitoring device, for use with a collection assembly, comprising:
the determining module is used for acquiring basic monitoring data, tenant names and corresponding task identification codes in the nodes where the acquisition components are located;
the processing module is used for matching the corresponding relation between the tenant names and the containers in the nodes based on the task identification codes; on the basis of the corresponding relation, adding a tenant and task identification code label on the basic monitoring data corresponding to the container to obtain processed basic monitoring data; and outputting the processed basic monitoring data.
15. An electronic device, comprising:
at least one processor;
and a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor to cause the electronic device to perform the method of container monitoring of any one of claims 1-12.
16. A container monitoring system, comprising:
the acquisition layer, the acquisition warning layer and the management layer are sequentially in communication connection with each other;
the acquisition layer comprises at least one node, wherein an acquisition component and at least one container are arranged in the node, and the acquisition component is used for executing the container monitoring method according to any one of claims 11-12;
the acquisition warning layer comprises an alarm management module and a control module, and the control module is respectively in communication connection with the acquisition layer and the management layer;
the management layer comprises a service monitoring system for performing the container monitoring method according to any of claims 1-10.
17. A computer-readable storage medium having computer-executable instructions stored thereon, which when executed by a processor, implement the container monitoring method of any one of claims 1-12.
18. A computer program product comprising computer executable instructions for implementing a container monitoring method according to any one of claims 1 to 12 when executed by a processor.
CN202110914970.2A 2021-08-10 2021-08-10 Container monitoring method, device, equipment, system and storage medium Pending CN115934242A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110914970.2A CN115934242A (en) 2021-08-10 2021-08-10 Container monitoring method, device, equipment, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110914970.2A CN115934242A (en) 2021-08-10 2021-08-10 Container monitoring method, device, equipment, system and storage medium

Publications (1)

Publication Number Publication Date
CN115934242A true CN115934242A (en) 2023-04-07

Family

ID=86552718

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110914970.2A Pending CN115934242A (en) 2021-08-10 2021-08-10 Container monitoring method, device, equipment, system and storage medium

Country Status (1)

Country Link
CN (1) CN115934242A (en)

Similar Documents

Publication Publication Date Title
CN112367246B (en) Message pushing method and device, electronic equipment and storage medium
CN113176978A (en) Monitoring method, system and device based on log file and readable storage medium
CN111464589A (en) Intelligent contract processing method, computer equipment and storage medium
CN110784377A (en) Method for uniformly managing cloud monitoring data in multi-cloud environment
CN111984601A (en) Log file deleting method and device, electronic equipment and storage medium
CN109560951B (en) Configuration method, alarm real-time statistical method, server and system
CN112349428A (en) Family health code query method and equipment
CN112052227A (en) Data change log processing method and device and electronic equipment
CN110851334A (en) Flow statistical method, electronic device, system and medium
CN112306871A (en) Data processing method, device, equipment and storage medium
CN116846980A (en) Integral issuing and using method, system and equipment
CN112288226A (en) Service processing method, device and system
CN115934242A (en) Container monitoring method, device, equipment, system and storage medium
CN111444074A (en) Data monitoring method and device, electronic equipment and readable storage medium
CN113254335B (en) Test data processing method and device, server and storage medium
CN108829563B (en) Alarm method and alarm device
CN112308660A (en) Data processing method, device and system
CN110837454A (en) Interface monitoring processing method and server
CN115168489B (en) Data certification method and device based on blockchain
CN112633325B (en) Personnel identification method and device based on tactical model
CN116070268B (en) Privacy data identification monitoring method, device and equipment
CN114625539B (en) Script tool execution method and device, electronic equipment cluster and storage medium
CN118055000A (en) Alarm information generation method and device, storage medium and electronic equipment
CN117061310A (en) Device image generation method, device, storage medium and electronic device
CN113468024A (en) Visual on-duty emergency disposal interaction method and device

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