CN-115934242-B - Container monitoring method, device, equipment, system and storage medium
Abstract
The embodiment of the disclosure provides a container monitoring method, device, equipment, system and storage medium, which are applied to a server. The method comprises the steps of receiving an external request aiming at monitoring data, wherein the external request carries an identification of an index to be monitored, determining the 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 an external requester so that the external requester can display the index value. According to the technical scheme, tenant-based data monitoring is achieved, and the availability and reliability of monitored data are effectively guaranteed.
Inventors
- WANG XIN
- SUN TAO
- ZHANG XIAOQIAN
- DING YANCHAO
- XU YUANYUAN
Assignees
- 中国联合网络通信集团有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20210810
Claims (16)
- 1. A container monitoring method, applied to a server, comprising: Receiving an external request for monitoring data, wherein the external request carries an identifier of an index to be monitored and a key of a tenant; determining that a key contained in the external request is consistent with a key corresponding to the tenant; Collecting tenant names and task identification codes corresponding to nodes, and collecting basic monitoring data taking containers as units, wherein the nodes correspond to at least one container; Responding to the collection action of a collection component corresponding to the node, sending the basic monitoring data, the tenant name and the task identification code to the collection component, wherein the collection component is used for adding the tenant name and the task identification code to the basic monitoring data to obtain processed monitoring data; Obtaining processed monitoring data from the acquisition assembly; according to the processed monitoring data, determining an index value of the index to be monitored; And sending the index value to the external requesting party so that the external requesting party can display the index value.
- 2. The container monitoring method according to claim 1, wherein the tenant name and the task identifier corresponding to the collection node include: And 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.
- 3. The method of claim 1, wherein the obtaining processed monitoring data from the collection assembly comprises: And acquiring the processed monitoring data from the interface of the acquisition component in an active grabbing mode.
- 4. The method for monitoring a container according to claim 1, wherein determining the index value of the index to be monitored based on 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.
- 5. The container monitoring method according to claim 4, wherein the determining an index value of the index to be monitored based on the processed monitoring data and the processing method includes: determining the processing sequence of filtering, association 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.
- 6. The method of claim 5, wherein sequentially processing the processed monitoring data according to the processing sequence comprises: According to the processing sequence, when the processed monitoring data are required to be subjected to association processing, determining the corresponding label of the index to be monitored; Determining first data with the corresponding label and second data for calculating the index to be monitored in the processed monitoring data; and adding the first data into the tag group of the second data to obtain the data after the association processing.
- 7. The method of claim 5, wherein sequentially processing the processed monitoring data according to the processing sequence comprises: according to the processing sequence, when the processed monitoring data is required to be subjected to aggregation processing, determining an aggregation function corresponding to the index to be monitored; substituting the processed monitoring data subjected to filtering treatment and association treatment into the aggregation function to obtain an index after the aggregation treatment.
- 8. The container monitoring method according to any one of claims 1 to 7, further comprising: When the index value meets a preset alarm rule, generating alarm information and sending the alarm information to a corresponding contact party.
- 9. A container monitoring method for use with 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 takes a container as a unit; Based on the task identification code, matching the corresponding relation between the tenant name and the container in the node; based on the corresponding relation, adding tenant names and task identification codes into the basic monitoring data corresponding to the container to obtain processed monitoring data; and outputting the processed monitoring data to a server.
- 10. The container monitoring method according to claim 9, wherein the matching the correspondence between tenant names and containers in the node based on the task identification code includes: Determining the identification of a 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 identification 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.
- 11. A capacity monitoring device, characterized in that it is applied to a server, and comprises: The system comprises a receiving module, a monitoring module and a processing module, wherein the receiving module is used for receiving an external request aiming at monitoring data, wherein the external request carries an identification of an index to be monitored and a key of a tenant; The processing module is used for 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 into basic monitoring data; The processing module is further configured to determine that a key contained in the external request is consistent with a key corresponding to the tenant; The processing module is also used for collecting basic monitoring data taking a container as a unit by using a tenant name and a task identification code corresponding to the collection node, and the node corresponds to at least one container; Responding to the collection action of a collection component corresponding to the node, sending the basic monitoring data, the tenant name and the task identification code to the collection component, wherein the collection 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 processed monitoring data from the acquisition component.
- 12. A container monitoring device, characterized by being applied to 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 name and the container in the node based on the task identification code, adding the tenant and task identification code label to 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.
- 13. 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 container monitoring method of any one of claims 1-10.
- 14. A container monitoring system, comprising: the system comprises an acquisition layer, an acquisition warning layer and a management layer which are sequentially connected with each other in a communication way; 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 as claimed in any one of claims 9 to 10; 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-8.
- 15. A computer readable storage medium having stored therein computer executable instructions which when executed by a processor are adapted to carry out the container monitoring method according to any of claims 1-10.
- 16. A computer program product comprising computer-executable instructions for implementing the container monitoring method according to any one of claims 1-10 when executed by a processor.
Description
Container monitoring method, device, equipment, system and storage medium Technical Field The disclosure relates to the field of computer technology, and in particular, to a container monitoring method, device, equipment, system and storage medium. Background With the advancement of network technology, cloud computing and service monitoring systems based on cloud computing are increasingly used. The Prometheus system is an open-source service monitoring system based on a time sequence database, has the advantages of high-dimensional data model, visual data display, high-efficiency storage, easy operation and maintenance and the like, and is widely applied. However, the native platform of the promethaus system is not friendly to monitoring support, and has a great limitation in terms of usability and even usability methods, and cannot provide high-reliability and usability services. Disclosure of Invention The embodiment of the disclosure provides a container monitoring method, device, equipment, system and 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, 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 processed monitoring data, wherein the processed monitoring data is obtained by adding a tenant name and a task identification code into basic monitoring data; The index value is transmitted to the external requester so that the external requester displays the index value. Optionally, before determining the index value of the index to be monitored according to the processed monitoring data, the method further comprises the steps of collecting tenant names and task identification codes corresponding to the nodes and collecting basic monitoring data taking the containers as units, wherein the nodes correspond to at least one container, responding to the collecting actions of the collecting components corresponding to the nodes, sending the basic monitoring data, the tenant names and the task identification codes to the collecting components, wherein the collecting components are 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 collecting components. Optionally, collecting the tenant name and the task identification code corresponding to the node comprises 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. Optionally, obtaining the processed monitoring data from the acquisition assembly includes obtaining the processed monitoring data from an interface of the acquisition assembly by active grasping. Optionally, 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. Optionally, determining the index value of the index to be monitored based on the processed monitoring data and the processing method comprises determining the processing sequence of filtering, associating and aggregating the processed monitoring data according to the processing method, and sequentially processing the processed monitoring data according to the processing sequence. Optionally, processing the processed monitoring data sequentially according to the processing sequence, wherein the processing comprises determining corresponding labels of the indexes to be monitored when the processed monitoring data are required to be subjected to association processing according to the processing sequence, determining first data with the corresponding labels in the processed monitoring data and second data for calculating the indexes to be monitored, and adding the first data into a label group of the second data to obtain the associated processed data. Optionally, processing the processed monitoring data sequentially according to the processing sequence, wherein the processing comprises determining an aggregation function corresponding to the index to be monitored when the processed monitoring data is required to be aggregated according to the processing sequence, and substituting the processed monitoring data subjected to filtering processing and associated processing into the aggregation function to obtain th