Container monitoring method, device, apparatus, system and storage medium

By adding monitoring data containing tenant names and task identifiers to the Prometheus system, the problem of Prometheus's inability to distinguish tenant monitoring data was solved, achieving highly reliable and available container monitoring and improving the monitoring effect of the service monitoring system.

CN115934242BActive Publication Date: 2026-05-05CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA UNITED NETWORK COMM GRP CO LTD
Filing Date
2021-08-10
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

When monitoring containers, the Prometheus system cannot provide high reliability and availability, and it cannot distinguish monitoring data from different tenants, resulting in limited performance of the service monitoring system.

Method used

By adding tenant names and task identification codes to the monitoring data, processed monitoring data is generated, which allows the indicator values ​​to be refined to specific tenants and tasks, enabling effective monitoring of server usage for different tenants.

Benefits of technology

It significantly improves the availability and reliability of monitoring data, enabling monitoring metrics to be tailored to different tenants and tasks, thereby enhancing the monitoring capabilities of the service monitoring system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115934242B_ABST
    Figure CN115934242B_ABST
Patent Text Reader

Abstract

This disclosure provides a container monitoring method, apparatus, device, system, and storage medium applied to a server. The method includes: receiving an external request for monitoring data, the external request carrying an identifier of a metric to be monitored; determining the metric value based on processed monitoring data, the processed monitoring data being obtained by adding a tenant name and task identification code to basic monitoring data; and sending the metric value to the external requester so that the external requester can display the metric value. The technical solution of this disclosure implements tenant-based data monitoring, effectively ensuring the availability and reliability of monitoring data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a container monitoring method, apparatus, device, system, and storage medium. Background Technology

[0002] With the advancement of network technology, cloud computing and cloud-based service monitoring systems are being used more and more. Among them, Prometheus is an open-source service monitoring system based on a time-series database. It has advantages such as high-dimensional data models, visualized data display, efficient storage, and ease of operation and maintenance, and is therefore widely used.

[0003] However, the native platform of the Prometheus system is not user-friendly for monitoring, and has huge limitations in terms of ease of use and even availability, making it unable to provide highly reliable and available services. Summary of the Invention

[0004] This disclosure provides a container monitoring method, apparatus, device, system, and storage medium, which realizes tenant-based data monitoring and effectively ensures the availability and reliability of monitoring data.

[0005] In a first aspect, embodiments of this disclosure provide a container monitoring method, which is applied to a server, and the container monitoring method includes:

[0006] Receive external requests for monitoring data, with the external request carrying an identifier of the metric to be monitored;

[0007] Based on the processed monitoring data, the indicator values ​​of the indicators to be monitored are determined. The processed monitoring data is obtained by adding the tenant name and task identification code to the basic monitoring data.

[0008] Send the metric value to the external requester so that the external requester can display the metric value.

[0009] Optionally, before determining the value of the monitored indicator based on the processed monitoring data, the process further includes: collecting the tenant name and task identification code corresponding to the node, and collecting basic monitoring data in units of containers, with each node corresponding to at least one container; responding to the collection action of the collection component corresponding to the node, sending the basic monitoring data, tenant name, and task identification code to the collection component, which adds the tenant name and task identification code to the basic monitoring data to obtain the processed monitoring data; and obtaining the processed monitoring data from the collection component.

[0010] Optionally, the tenant name and task identification code corresponding to the collection node are collected, including: polling the task interface or monitoring metric database interface of the server manager, and extracting the tenant name and corresponding task identification code from the task interface or monitoring metric database interface.

[0011] Optionally, the processed monitoring data from the acquisition component can be obtained, including: acquiring the processed monitoring data from the interface of the acquisition component by actively crawling.

[0012] Optionally, the indicator value of the indicator to be monitored is determined based on the processed monitoring data, including: determining the processing method based on the preset processing rules corresponding to the indicator to be monitored; and determining the indicator value of the indicator to be monitored based on the processed monitoring data and the processing method.

[0013] Optionally, based on the processed monitoring data and the processing method, the indicator value of the indicator to be monitored is determined, including: determining the processing order of filtering, correlation and aggregation of the processed monitoring data according to the processing method; and processing the processed monitoring data sequentially according to the processing order.

[0014] Optionally, the processed monitoring data is processed sequentially according to the processing order, including: when it is necessary to perform association processing on the processed monitoring data according to the processing order, determining the corresponding label of the indicator to be monitored; determining the first data with the corresponding label and the second data used to calculate the indicator to be monitored in the processed monitoring data; adding the first data to the label group of the second data to obtain the data after association processing.

[0015] Optionally, the processed monitoring data is processed sequentially according to the processing order, including: determining the aggregation function corresponding to the indicator to be monitored when it is necessary to aggregate the processed monitoring data according to the processing order; and substituting the processed monitoring data that has undergone filtering and correlation processing into the aggregation function to obtain the aggregated indicator.

[0016] Optionally, it also includes: generating alarm information and sending the alarm information to the corresponding contact person when the indicator value meets the preset alarm rules.

[0017] Optionally, the external request also carries the tenant's key. Before determining the value of the metric to be monitored based on the processed monitoring data, the process also includes: determining that the key contained in the external request is consistent with the key corresponding to the tenant.

[0018] Secondly, embodiments of this disclosure provide a container monitoring method, which is applied to a data acquisition component. The container monitoring method includes:

[0019] Acquire the basic monitoring data, tenant name, and corresponding task identification code within the node where the data collection component is located. The basic monitoring data is in units of containers.

[0020] Based on the task identification code, match the tenant name with the container within the node;

[0021] Based on the correspondence, the tenant name and task identification code are added to the basic monitoring data corresponding to the container to obtain the processed monitoring data.

[0022] Output the processed monitoring data to the server.

[0023] Optionally, based on the task identification code, the correspondence between the tenant name and the container within the node is matched, including: determining the identifier of the container associated with the task identification code based on a preset association rule, wherein the association rule is used to represent the preset conditions for judging whether the container identifier matches the task identification code; and determining the correspondence between the tenant name and the container based on the correspondence between the task identification code and the tenant.

[0024] Thirdly, this disclosure also provides a container monitoring device applied to a server, the container monitoring device comprising:

[0025] The receiving module is used to receive external requests for monitoring data. The external requests carry the identifiers of the metrics to be monitored.

[0026] The processing module is used to determine the indicator value of the indicator to be monitored based on the processed monitoring data. The processed monitoring data is obtained by adding the tenant name and task identification code to the basic monitoring data. The module also sends the indicator value to the external requester so that the external requester can display the indicator value.

[0027] Optionally, the processing module is further configured to: collect the tenant name and task identification code corresponding to the node, and collect basic monitoring data in units of containers, before determining the indicator value of the indicator to be monitored based on the processed monitoring data; in response to the collection action of the collection component corresponding to the node, send the basic monitoring data, tenant name and task identification code to the collection component, which adds the tenant name and task identification code to the basic monitoring data to obtain the processed monitoring data; and obtain the processed monitoring data from the collection component.

[0028] Optionally, the processing module is specifically used to: poll the server manager's task interface or monitoring metric database interface, and extract the tenant name and corresponding task identification code from the task interface or monitoring metric database interface.

[0029] Optionally, the processing module is specifically used to: obtain processed monitoring data from the interface of the acquisition component by actively capturing the data.

[0030] Optionally, the processing module is specifically used to: determine the processing method based on the preset processing rules corresponding to the indicator to be monitored; and determine the indicator value of the indicator to be monitored based on the processed monitoring data and the processing method.

[0031] Optionally, the processing module is specifically used to: determine the processing order of filtering, correlation, and aggregation of the processed monitoring data according to the processing method; and process the processed monitoring data sequentially according to the processing order.

[0032] Optionally, the processing module is specifically used to: determine the corresponding label of the indicator to be monitored when it is necessary to perform association processing on the processed monitoring data according to the processing order; determine the first data with the corresponding label and the second data used to calculate the indicator to be monitored in the processed monitoring data; add the first data to the label group of the second data to obtain the data after association processing.

[0033] Optionally, the processing module is specifically used to: determine the aggregation function corresponding to the indicator to be monitored when it is necessary to aggregate the processed monitoring data according to the processing order; and substitute the processed monitoring data that has been filtered and correlated into the aggregation function to obtain the aggregated indicator.

[0034] Optionally, the processing module is also used to: generate alarm information and send the alarm information to the corresponding contact person when the indicator value meets the preset alarm rules.

[0035] Optionally, the processing module is also used to: when the external request also carries the tenant's key, before determining the indicator value of the indicator to be monitored based on the processed monitoring data, determine that the key contained in the external request is consistent with the key corresponding to the tenant.

[0036] Fourthly, this disclosure also provides a container monitoring device applied to a data acquisition component, the container monitoring device comprising:

[0037] The determination module is used to obtain the basic monitoring data, tenant name, and corresponding task identification code within the node where the acquisition component is located;

[0038] The processing module is used to match the tenant name with the container within the node based on the task identification code; and, based on the correspondence, add tenant and task identification code tags to the basic monitoring data corresponding to the container to obtain the processed basic monitoring data; and output the processed basic monitoring data.

[0039] Optionally, the determining module is further configured to: match the correspondence between the tenant name and the container within the node based on the task identification code, including: determining the identifier of the container associated with the task identification code based on a preset association rule, wherein the association rule is used to represent a preset condition for judging whether the container identifier matches the task identification code; and determining the correspondence between the tenant name and the container based on the correspondence between the task identification code and the tenant.

[0040] Fifthly, this disclosure also provides an electronic device comprising:

[0041] At least one processor;

[0042] and memory that is communicatively connected to at least one processor;

[0043] The memory stores instructions that can be executed by at least one processor to cause the electronic device to perform the container monitoring method as described in any embodiment corresponding to the first and second aspects.

[0044] Sixthly, this disclosure also provides a container monitoring system, which includes:

[0045] The acquisition layer, acquisition warning layer, and management layer are sequentially interconnected and communicate with each other.

[0046] The acquisition layer includes at least one node, and each node is provided with an acquisition component and at least one container. The acquisition component is used to execute the container monitoring method as described in any embodiment of the second aspect.

[0047] The alarm acquisition layer includes an alarm management module and a control module, with the control module communicating with both the acquisition layer and the management layer.

[0048] The management layer includes a service monitoring system, which is used to perform container monitoring methods as described in any embodiment corresponding to the first aspect.

[0049] Optionally, the alarm acquisition layer includes an alarm management module and a control module based on the Prometheus system.

[0050] In a seventh aspect, this disclosure also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the container monitoring method as described in any embodiment corresponding to the first and second aspects of this disclosure.

[0051] Eighthly, this disclosure also provides a computer program product comprising computer-executable instructions, which, when executed by a processor, are used to implement the container monitoring method as described in any embodiment corresponding to the first and second aspects of this disclosure.

[0052] The container monitoring method, apparatus, device, system, and storage medium provided in this disclosure receive external requests for monitoring data, determine the corresponding indicator values ​​for the external requests, obtain the corresponding indicator values ​​from the processed monitoring data with added tenant names and task identification codes, and send them to the requester, thereby completing the response to the external requests. By generating indicator values ​​based on monitoring data with tenant names and task identification codes, the indicator values ​​can be refined to be specific to different tenants and tasks, thereby effectively ensuring effective monitoring and management of server usage for different tenants, and thus ensuring the availability and reliability of monitoring data. Attached Figure Description

[0053] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0054] Figure 1 This is an application scenario diagram of the container monitoring method provided in the embodiments of this disclosure;

[0055] Figure 2 A flowchart illustrating a container monitoring method provided in one embodiment of this disclosure;

[0056] Figure 3 A flowchart illustrating a container monitoring method provided in yet another embodiment of this disclosure;

[0057] Figure 4 A flowchart illustrating a container monitoring method provided in yet another embodiment of this disclosure;

[0058] Figure 5 A flowchart illustrating a container monitoring method provided in yet another embodiment of this disclosure;

[0059] Figure 6 This is a schematic diagram of the structure of a container monitoring device provided in yet another embodiment of the present disclosure;

[0060] Figure 7 This is a schematic diagram of the structure of a container monitoring device provided in yet another embodiment of the present disclosure;

[0061] Figure 8 This is a schematic diagram of the structure of an electronic device provided in yet another embodiment of the present disclosure;

[0062] Figure 9 This is a schematic diagram of the structure of a container monitoring system provided in yet another embodiment of the present disclosure.

[0063] The accompanying drawings have illustrated specific embodiments of this disclosure, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concepts of this disclosure to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0064] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0065] The technical solutions of this disclosure and how they solve the aforementioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this disclosure will now be described with reference to the accompanying drawings.

[0066] The following is an explanation of the terms used in this plan:

[0067] Service monitoring system: A monitoring system on a server used to monitor virtual machines or cloud computing hosts such as server-based databases. It is mainly a distributed monitoring system; the representative of this is the Data Center Operating System (DC / OS), which is a distributed data center operating system with the cluster manager Apache Mesos as the distributed system kernel.

[0068] Prometheus System: An open-source distributed monitoring system based on time-series databases, and also a DC / OS, capable of monitoring servers, databases, and Virtual Private Servers (VPS).

[0069] Native platform: refers to the existing open-source base version of the Prometheus system.

[0070] Containers: Facilities used to house applications and provide the basic environment and services required by those applications. Containers reside on servers and are the smallest software units that service monitoring systems can monitor for the fundamental data they provide.

[0071] Node: The smallest hardware unit in a server, generally representing a single physical device, but can also include multiple physical machines; a node typically contains multiple containers.

[0072] Cluster: A collection of multiple containers and nodes within a server. From an external access perspective, the software units corresponding to a cluster are collectively referred to as an availability zone.

[0073] Tenant: A customer who rents containers on a server and runs programs. Each tenant can rent multiple containers or just one container.

[0074] Data Acquisition Component: A virtual data acquisition tool that runs on the server.

[0075] The existing Prometheus system, based on a data sequence database, is widely used in cloud computing and cloud virtual machines due to its advantages such as high-dimensional data models, visualized data display, efficient storage, and ease of operation and maintenance. However, Prometheus system's server monitoring is container-based, thus only providing container-based monitoring data, or monitoring data for nodes or the entire cluster. In this case, monitoring data for different tenants are all mixed together. For administrators providing cloud computing or cloud virtual machine rentals, when they need to obtain usage metrics for different tenants, the metrics obtained from the monitoring data cannot directly reflect the situation of different tenants, resulting in limited monitoring performance, insufficient availability, and insufficient reliability of the service monitoring system.

[0076] To address this issue, this disclosure provides a container monitoring method that generates metrics based on processed monitoring data with added tenant names and task identifiers. This allows the processed monitoring data to be differentiated according to different tenants and tasks, ensuring that the generated metrics correspond to specific tenants and tasks, thereby significantly improving the metric monitoring effect.

[0077] The application scenarios of the embodiments of this disclosure are explained below:

[0078] Figure 1 This diagram illustrates an application scenario of the container monitoring method provided in this embodiment of the disclosure. Figure 1 As shown, in the container monitoring process, the service monitoring system 100 determines the metrics to be generated based on the input operation of the user 110 at the front end 111, and then generates the corresponding metrics based on the monitoring data of the server 130 obtained from the collection component 120, and pushes them to the corresponding user 110, thereby completing the container monitoring.

[0079] It should be noted that, Figure 1 The scenario shown is illustrated using only one user and one data collection component as an example, but this disclosure is not limited to this. In other words, the number of users and data collection components can be arbitrary.

[0080] The container monitoring method provided in this disclosure is described in detail below through specific embodiments.

[0081] Figure 2 This is a flowchart illustrating a container monitoring method provided in one embodiment of the present disclosure. This container monitoring method is applied to a server. Figure 2As shown, the container monitoring method provided in this embodiment includes the following steps:

[0082] Step S201: Receive external requests for monitoring data.

[0083] The external request carries an identifier for the metric to be monitored.

[0084] External requests primarily originate from server users, such as tenants and administrators. There are typically multiple tenants. Based on user actions on the client side, the service monitoring system on the server receives requests for the monitored metrics specified in the sending action; these are external requests.

[0085] External requests provide the corresponding identifiers for the metrics to be monitored, enabling the service monitoring system to determine the metrics that need to be generated. For example, if the external request contains an abbreviation for the "container usage duration" metric, the service monitoring system can determine that the required metric is container usage duration based on that abbreviation.

[0086] Furthermore, the metrics to be monitored are the corresponding metrics generated by the service monitoring system based on the acquired monitoring data. These metrics are pre-built into the service monitoring system's monitoring metric database, containing metric types. Therefore, when the service monitoring system identifies a metric to be monitored corresponding to an external request, it can determine the generation method of the metric through the record corresponding to that metric in the monitoring metric database, and generate the corresponding metric based on that record.

[0087] Step S202: Determine the indicator value of the indicator to be monitored based on the processed monitoring data.

[0088] The processed monitoring data is obtained by adding the tenant name and task identification code to the basic monitoring data.

[0089] Basic monitoring data refers to the data that the service monitoring system can collect through its built-in basic controls, such as usage duration and data communication volume per container. After adding tenant names and task identifiers, this monitoring data can be used to calculate corresponding metrics for different tenants. Therefore, this basic monitoring data with added tenant names and task identifiers is the processed data.

[0090] Furthermore, the indicator value to be monitored is determined, that is, based on the records in the monitoring indicator database, the calculation method of the indicator to be monitored is determined, and then based on the determined calculation method, the corresponding indicator value is calculated through the processed monitoring data.

[0091] For example, the metric to be monitored is the daily traffic usage of tenant A over the past 30 days. Therefore, by querying the calculation method of daily traffic usage recorded in the monitoring metric database, and then based on the daily traffic usage corresponding to tenant A (i.e., the basic monitoring data with the tenant name), the metric value to be monitored can be obtained.

[0092] Step S203: Send the indicator value to the external requester so that the external requester can display the indicator value.

[0093] The display can include displaying the indicator value on the external requester's display device based on the format specified in the external request, or it can involve directly sending the indicator value to the external requester, whose device then displays it based on the set format. For example, creating a new page to display the indicator value.

[0094] In some embodiments, the metric values ​​sent to the external requester are proactively pushed to the external requester by the service monitoring system after calculation, or they can be obtained by the external requester through proactive crawling.

[0095] The container monitoring method provided in this disclosure receives external requests for monitoring data, determines the corresponding indicator value for the external request, obtains the corresponding indicator value by adding tenant name and task identification code to the processed monitoring data, and sends it to the requester, thereby completing the response to the external request. By generating indicator values ​​based on monitoring data with tenant name and task identification code, the indicator values ​​can be refined to be specific to different tenants and tasks, thereby effectively ensuring effective monitoring and management of server usage for different tenants, and thus ensuring the availability and reliability of monitoring data.

[0096] Figure 3 A flowchart illustrating a container monitoring method provided in another embodiment of this disclosure. The container monitoring method provided in this embodiment of the disclosure is... Figure 2 A refinement based on the illustrated embodiment. For example... Figure 3 As shown, the container monitoring method provided in this embodiment includes the following steps:

[0097] Step S301: Collect the tenant name and task identification code corresponding to the node, and collect basic monitoring data in units of containers.

[0098] Each node corresponds to at least one container.

[0099] The server comes with basic data collection tools, such as cAdvisor, which can obtain information about the containers running on the server, thereby enabling the collection of basic container-based monitoring data.

[0100] The basic data collection tool operates on a node-based scale. Each node on the server is equipped with a basic data collection tool to collect basic monitoring data within that node's scope.

[0101] Optionally, poll the server manager's task interface or monitoring metrics database interface to extract the tenant name and corresponding task identification code from the task interface or monitoring metrics database interface.

[0102] The manager here refers to the aforementioned Apache Mesos cluster manager. This manager can capture and record tenant information running within the cluster, such as tenant names and task identifiers. The manager's task interface is the interface within the cluster manager that allows it to retrieve the information it collects.

[0103] The monitoring metrics database is a built-in database of the service monitoring system. It is used to record information related to the metrics that the service monitoring system can calculate and generate, as well as information collected within the cluster, such as tenant information that has been collected and saved, such as tenant name and task identification code.

[0104] Therefore, by accessing the cluster manager's task interface or the monitoring metrics database interface, the tenant name and the corresponding task identification code can be obtained.

[0105] The collected data is stored in the database corresponding to the service monitoring system. Specifically, the service monitoring system is based on the Prometheus system, which is itself a time-series database. Therefore, the data collected by the service monitoring system and the data collected by the basic data collection tools are directly stored in the database corresponding to the service monitoring system, and tags are set for easy reading and retrieval.

[0106] Step S302: In response to the collection action of the collection component corresponding to the node, send basic monitoring data, tenant name and task identification code to the collection component.

[0107] The acquisition component is used to add the tenant name and task identification code to the basic monitoring data to obtain the processed monitoring data.

[0108] The data collection component has the same deployment scope as the basic data collection tool, both collecting data within their respective nodes. Specifically, the data collection component retrieves data from the service monitoring system's database, including data collected by the basic data collection tool, as well as tenant names and task identifiers collected by the service monitoring system. It then adds key-value pairs to the basic monitoring data to obtain the processed monitoring data.

[0109] For example, the data acquisition component collects tenant A from the database, and the task identification code for tenant A is m. Tenant A rents containers 1 and 2 within the node. It then reads the basic monitoring data corresponding to containers 1 and 2, such as the used traffic. Finally, it adds the tenant name and task identification code to the basic monitoring data, thus obtaining the used traffic of containers 1 and 2 corresponding to tenant A and task m. This facilitates subsequent calculations of metrics such as the used traffic of tenant A or the used traffic of task m.

[0110] Step S303: Obtain the processed monitoring data from the acquisition component.

[0111] In some embodiments, the service monitoring system periodically obtains processed monitoring data from the acquisition component, such as reading it once per minute, so as to facilitate the calculation of corresponding indicators based on external requests at any time.

[0112] Optionally, the processed monitoring data can be obtained from the interface of the data acquisition component by actively crawling.

[0113] The service monitoring system actively retrieves processed monitoring data directly from the collection components of each node, and processes it into corresponding indicators based on external requests.

[0114] Step S304: Receive external requests for monitoring data.

[0115] The external request carries an identifier for the metric to be monitored.

[0116] External requests for monitoring data refer to requests for feedback on relevant metrics based on the monitoring data, i.e., metrics to be monitored.

[0117] Step S305: Determine the indicator value of the indicator to be monitored based on the processed monitoring data.

[0118] The processed monitoring data is obtained by adding the tenant name and task identification code to the basic monitoring data.

[0119] By processing the monitoring data with tenant name and task identifier, metric values ​​corresponding to tenant and task can be obtained.

[0120] For example, the processed monitoring data, such as containers 1 and 2 mentioned above, correspond to the used traffic of tenant A and task m. If the externally requested monitoring metric is the traffic usage value of task m, then the traffic usage value can be obtained by simply adding the used traffic of task m corresponding to containers 1 and 2.

[0121] Step S306: Send the indicator value to the external requester so that the external requester can display the indicator value.

[0122] As in the example above, if the request for the traffic usage value metric is issued by tenant A, the calculated traffic usage value of task m will be sent to tenant A to complete the request.

[0123] In this embodiment, basic monitoring data, tenant names, and task identification codes are pre-collected, and the basic monitoring data is processed into processed monitoring data with tenant names and task identification codes by the collection component. Thus, when an external request is received, the corresponding indicator value of the external request is obtained based on the processed monitoring data. This enables the monitoring indicators to be targeted to specific tenants and tasks, significantly improving the monitoring capabilities and availability of the service monitoring system and avoiding the situation where only container-based indicators are available, making the monitoring indicators difficult to use.

[0124] Figure 4 This is a flowchart illustrating a container monitoring method provided in yet another embodiment of this disclosure. Figure 4 As shown, the container monitoring method may include:

[0125] Step S401: Receive external requests for monitoring data.

[0126] The external request carries an identifier for the metric to be monitored.

[0127] In some embodiments, the metrics to be monitored are pre-built into the monitoring metric database, and the monitoring data is data that has been captured and stored in the database of the service monitoring system.

[0128] Optionally, the external request also carries the tenant's key, and it is determined that the key contained in the external request is consistent with the key corresponding to the tenant.

[0129] In some embodiments, when a new tenant is created on the server, a corresponding key is assigned to the new tenant so that the service monitoring system can identify the corresponding tenant based on the key carried in the external request.

[0130] Therefore, each key corresponds one-to-one with a tenant name. Here, the tenant name is a unique tenant identifier, not a tenant name that can be repeated.

[0131] Step S402: Determine the processing method based on the preset processing rules corresponding to the indicators to be monitored.

[0132] The processing rules are used to represent the processed monitoring data and specific calculation methods required for the indicators to be monitored. The processing method refers to the specific calculation method.

[0133] For example, the average memory usage rate of a specific tenant is a monitored metric. The processing rule is to average the memory usage rate of the tenant within a set time period. The required processed monitoring data is the memory usage rate of the specific tenant at a specific time point. The processing method is to average the processed monitoring data within the set time period.

[0134] Step S403: Based on the processed monitoring data and processing method, determine the indicator value of the indicator to be monitored.

[0135] Determining the value of the indicator to be monitored is the process of calculating the corresponding indicator value based on the processed monitoring data and processing methods.

[0136] Furthermore, the processing order for filtering, correlation, and aggregation of the processed monitoring data is determined based on the processing method.

[0137] The processed monitoring data is processed sequentially according to the processing order.

[0138] In processing the processed monitoring data, three processes are used: filtering, correlation, and aggregation. Depending on the metrics corresponding to the external request, the conditions and order on which filtering, correlation, and aggregation are based will vary.

[0139] For example, for the metric of maximum memory utilization of tenant A, the required processed monitoring data is the real-time memory utilization of each container corresponding to tenant A. After filtering, the maximum memory utilization of each container is obtained. Then, based on the corresponding algorithm, the maximum memory utilization is associated and the maximum memory utilization of tenant A is calculated through an aggregation function.

[0140] Optionally, the association processing steps include: determining the corresponding label of the indicator to be monitored when it is necessary to perform association processing on the processed monitoring data according to the processing order;

[0141] Identify the first data with corresponding tags in the processed monitoring data and the second data used to calculate the monitoring indicators;

[0142] Add the first data to the label group of the second data to obtain the data after association processing.

[0143] In this system, the corresponding label for the monitored indicator is the category label for that indicator, such as average traffic during peak hours. The first data is the data in the processed monitoring data that corresponds to that category label, such as real-time traffic. When the processed monitoring data cannot directly yield the indicator value, it is necessary to establish a correlation between the processed monitoring data and the monitored indicator through other monitoring data. For example, the average traffic during peak hours obviously cannot be directly obtained through the first data; therefore, a second data is needed to establish a correlation between peak hours and real-time traffic, such as the time of occurrence of peak hours recorded in the monitoring indicator database. Thus, the second data needs to be associated with the first data to facilitate obtaining the monitored indicator.

[0144] Furthermore, the correlation processing includes determining the correlation relationship by reading the correlation labels of preset indicators in the monitoring indicator database.

[0145] Optionally, the aggregation process includes: determining the aggregation function corresponding to the monitored indicator when it is necessary to aggregate the processed monitoring data according to the processing order;

[0146] The processed monitoring data, after filtering and correlation, is substituted into the aggregation function to obtain the aggregated metrics.

[0147] The processed monitoring data is basic monitoring data with tenant name and task identification code. Therefore, when the monitoring metric is for a tenant or a task, the processed monitoring data needs to be aggregated. For example, if there are 32 containers corresponding to a tenant, and the monitoring metric is for the tenant, the processed monitoring data corresponding to the 32 containers needs to be aggregated by summing or averaging.

[0148] Step S404: Send the indicator value to the external requester so that the external requester can display the indicator value.

[0149] Optionally, when the indicator value meets the preset alarm rules, an alarm message is generated and sent to the corresponding contact person.

[0150] The service monitoring system also has preset alarm rules. When the processed monitoring data or the indicator value obtained in response to external requests meets the alarm rules, the corresponding processed monitoring data or indicator value and the corresponding alarm information will be pushed to the outside so that tenants or managers can respond and handle it in a timely manner.

[0151] Alarm rules include the conditions for generating alarm information, the corresponding alarm information content, and the contact persons to whom the alarm is pushed. The contact persons are typically the server administrator and the tenant corresponding to the processed monitoring data, or all tenants of the node corresponding to the monitoring data.

[0152] In this embodiment, the processing method corresponding to the monitored indicator is determined based on the monitored indicator corresponding to the external request, and the processed monitoring data is processed accordingly to obtain the indicator value. The processed monitoring data or the indicator value of the monitored indicator is monitored in real time to ensure whether the alarm rules are met, thereby ensuring effective monitoring of the server's operating status and quickly generating the corresponding indicator value, thus ensuring the monitoring effect.

[0153] Figure 5 This is a flowchart illustrating a container monitoring method provided in one embodiment of the present disclosure. The container monitoring method is applied to a data acquisition component. Figure 5 As shown, the container monitoring method provided in this embodiment includes the following steps:

[0154] Step S501: Obtain the basic monitoring data, tenant name, and corresponding task identification code within the node where the acquisition component is located.

[0155] The basic monitoring data is in units of containers.

[0156] The data collection component actively collects basic monitoring data, tenant names, and task identification codes from the database of the service monitoring system corresponding to its node. Generally, the collection process is timed; different time intervals are used for different basic monitoring data, such as collecting tenant names and task identification codes every 6 hours or every 24 hours.

[0157] Step S502: Based on the task identification code, match the tenant name with the container in the node.

[0158] Specifically, it includes the following steps:

[0159] Step 1 (not shown): Based on preset association rules, determine the identifier of the container associated with the task identification code.

[0160] Among them, the association rule is used to represent the preset conditions for judging whether the container identifier and the task identification code match.

[0161] Generally, container-based basic monitoring data contains identification codes or related tag information for the tasks being executed. However, it is not possible to directly determine the specific task based solely on these identification codes or tag information. Therefore, by comparing the identification codes or tag information within the container with the corresponding task identification codes in the service monitoring system's database node, the relationship between the container-based basic monitoring data and the task can be established.

[0162] Step 2 (not shown): Based on the correspondence between the task identifier and the tenant, determine the correspondence between the tenant name and the container.

[0163] Since there is a correspondence between the tenant name and the task identification code stored in the cluster manager or monitoring metrics database, the correspondence between the tenant name and the container and the container-based basic monitoring data can be obtained based on the association between the task identification code and the container and the container-based basic monitoring data.

[0164] Step S503: Based on the correspondence, add the tenant name and task identification code to the basic monitoring data corresponding to the container to obtain the processed monitoring data.

[0165] Based on the correspondence obtained in step S5022, key-value pairs of the corresponding tenant name and task identification code are added to the container-based basic monitoring data to obtain the processed monitoring data.

[0166] Step S504: Output the processed monitoring data to the server.

[0167] In some embodiments, the process of outputting processed monitoring data to a server or service monitoring system is based on the proactive capture action of the service monitoring system.

[0168] In this embodiment, the acquisition component obtains basic monitoring data, tenant names, and corresponding task identification codes within the node where it is located. Based on the task identification codes, it matches the correspondence between tenant names and containers within the node. Then, based on the correspondence, it adds tenant names and task identification codes to the basic monitoring data to obtain processed monitoring data, which is then output to the server or service monitoring system. This completes the data acquisition and processing, effectively facilitating the service monitoring system's identification and monitoring of the data, and improving monitoring availability and reliability.

[0169] Figure 6 This is a schematic diagram of a container monitoring device provided in one embodiment of the present disclosure. This container monitoring device is applied to a server, such as... Figure 6 As shown, the container monitoring device 600 includes a receiving module 610 and a processing module 620. Wherein:

[0170] The receiving module 610 is used to receive external requests for monitoring data, wherein the external requests carry the identifier of the indicator to be monitored.

[0171] The processing module 620 is used to determine the indicator value of the indicator to be monitored based on the processed monitoring data, wherein the processed monitoring data is obtained by adding the tenant name and task identification code to the basic monitoring data; and to send the indicator value to the external requester so that the external requester can display the indicator value.

[0172] Optionally, the processing module 620 is further configured to: collect the tenant name and task identification code corresponding to the node, and collect basic monitoring data in units of containers, before determining the indicator value of the indicator to be monitored based on the processed monitoring data; in response to the collection action of the collection component corresponding to the node, send the basic monitoring data, tenant name and task identification code to the collection component, which adds the tenant name and task identification code to the basic monitoring data to obtain the processed monitoring data; and obtain the processed monitoring data from the collection component.

[0173] Optionally, the processing module 620 is specifically used to: poll the server manager's task interface or monitoring metric database interface, and extract the tenant name and corresponding task identification code from the task interface or monitoring metric database interface.

[0174] Optionally, the processing module 620 is specifically used to: obtain processed monitoring data from the interface of the acquisition component by actively capturing the data.

[0175] Optionally, the processing module 620 is specifically used to: determine the processing method based on the preset processing rules corresponding to the indicator to be monitored; and determine the indicator value of the indicator to be monitored based on the processed monitoring data and the processing method.

[0176] Optionally, the processing module 620 is specifically used to: determine the processing order of filtering, correlation and aggregation of the processed monitoring data according to the processing method; and process the processed monitoring data sequentially according to the processing order.

[0177] Optionally, the processing module 620 is specifically used to: determine the corresponding label of the indicator to be monitored when it is necessary to perform association processing on the processed monitoring data according to the processing order; determine the first data with the corresponding label and the second data used to calculate the indicator to be monitored in the processed monitoring data; add the first data to the label group of the second data to obtain the data after association processing.

[0178] Optionally, the processing module 620 is specifically used to: determine the aggregation function corresponding to the indicator to be monitored when it is necessary to aggregate the processed monitoring data according to the processing order; and substitute the processed monitoring data that has been filtered and correlated into the aggregation function to obtain the aggregated indicator.

[0179] Optionally, the processing module 620 is also used to: generate alarm information and send the alarm information to the corresponding contact person when the indicator value meets the preset alarm rules.

[0180] Optionally, the processing module 620 is further configured to: when the external request also carries the tenant's key, before determining the indicator value of the indicator to be monitored based on the processed monitoring data, determine that the key contained in the external request is consistent with the key corresponding to the tenant.

[0181] In this embodiment, the container monitoring device, through the combination of various modules, can realize container monitoring and system data monitoring based on tenants and tasks, effectively ensuring the accuracy and availability of monitoring.

[0182] Figure 7 This is a schematic diagram of a container monitoring device provided in one embodiment of the present disclosure. The container monitoring device is applied to a data acquisition component, such as… Figure 7 As shown, the container monitoring device 700 includes: a determination module 710 and a processing module 720. Wherein:

[0183] The determination module 710 is used to obtain the basic monitoring data, tenant name and corresponding task identification code within the node where the acquisition component is located.

[0184] The processing module 720 is used to match the tenant name with the container in the node based on the task identification code; and, based on the correspondence, add tenant and task identification code tags to the basic monitoring data corresponding to the container to obtain the processed basic monitoring data; and output the processed basic monitoring data.

[0185] Optionally, the determining module 710 is further configured to: match the correspondence between the tenant name and the container within the node based on the task identification code, including: determining the identifier of the container associated with the task identification code based on a preset association rule, wherein the association rule is used to represent a preset condition for judging whether the container identifier matches the task identification code; and determining the correspondence between the tenant name and the container based on the correspondence between the task identification code and the tenant.

[0186] In this embodiment, the container monitoring device, through the combination of various modules, can add tags such as tenant name and task identification code to the basic monitoring data, thereby obtaining and outputting the processed monitoring data. Since the processed monitoring data contains tenant and task information, the monitoring data is isolated based on tenant and task.

[0187] Figure 8 This is a schematic diagram of the structure of an electronic device provided in one embodiment of the present disclosure, such as... Figure 8 As shown, the electronic device 800 includes a memory 810 and a processor 820.

[0188] The memory 810 stores a computer program that can be executed by at least one processor 820. This computer program is executed by at least one processor 820 to enable the electronic device to implement the container monitoring method provided in any of the above embodiments.

[0189] The memory 810 and the processor 820 can be connected via bus 830.

[0190] The relevant explanations can be understood by referring to the corresponding descriptions and effects in the method embodiments, and will not be repeated here.

[0191] Figure 9 This is a schematic diagram of the structure of a container monitoring system provided in an embodiment of the present disclosure. The container monitoring system 900 includes: a data acquisition layer 910, a data acquisition warning layer 920, and a management layer 930 that are sequentially and mutually connected.

[0192] The acquisition layer 910 includes at least one node, each node containing an acquisition component and at least one container. The acquisition component is used to execute the container monitoring method as described in any embodiment corresponding to the second aspect. In the foregoing embodiments of this solution, both the node and the acquisition component are located within a server.

[0193] The alarm acquisition layer 920 includes an alarm management module and a control module, with the control module communicating with the acquisition layer and the management layer, respectively.

[0194] The basic data acquisition tool in the aforementioned embodiments of this solution is the tool in the control module.

[0195] Optionally, the alarm acquisition layer 920 includes an alarm management module and a control module based on the Prometheus system.

[0196] The management layer 930 includes a service monitoring system for performing container monitoring methods as described in any embodiment corresponding to the first aspect.

[0197] Optionally, the management layer communicates with external terminals. Server tenants can view existing monitoring information through external terminals, such as viewing monitoring views through a graphical interface. At this time, the service monitoring system will obtain the corresponding monitoring data through control modules and acquisition components. Tenants can also initiate requests to create new monitoring views, modify monitoring views, query and modify alarm rule information through external terminals. These requests can all be completed through the cooperation of the service monitoring system with the alarm acquisition layer and the acquisition layer.

[0198] In this embodiment, container monitoring is achieved by dividing the container monitoring system into a collection layer, a collection alarm layer, and a management layer. This enables container monitoring based on the Prometheus system. Furthermore, by setting up collection components at each node of the collection layer, data isolation based on tenant name and task identification code is achieved, thereby significantly improving the accuracy, availability, and reliability of data monitoring.

[0199] One embodiment of this disclosure provides a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the container monitoring method provided in any of the above method embodiments.

[0200] The computer-readable storage medium can be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0201] One embodiment of this disclosure provides a computer program product comprising computer-executable instructions that, when executed by a processor, are used to implement the container monitoring method as described in the above method embodiments.

[0202] In the several embodiments provided in this disclosure, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0203] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0204] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A container monitoring method, characterized in that, The container monitoring method, applied to servers, includes: Receive external requests for monitoring data, the external requests carrying the identifier of the metric to be monitored and the tenant's key; Determine that the key contained in the external request is consistent with the key corresponding to the tenant; Collect the tenant name and task identification code corresponding to the node, and collect basic monitoring data in units of containers, wherein each node corresponds to at least one container; In response to the collection action of the collection component corresponding to the node, the basic monitoring data, the tenant name and the task identification code are sent to the collection component. The collection component is used to add the tenant name and the task identification code to the basic monitoring data to obtain the processed monitoring data. The processed monitoring data is obtained from the acquisition component; Based on the processed monitoring data, determine the index value of the indicator to be monitored; The indicator value is sent to the external requester so that the external requester can display the indicator value.

2. The container monitoring method according to claim 1, characterized in that, The tenant name and task identification code corresponding to the data collection node include: Poll the server's manager's task interface or monitoring metrics database interface, and extract the tenant name and corresponding task identification code from the task interface or monitoring metrics database interface.

3. The container monitoring method according to claim 1, characterized in that, The obtained processed monitoring data from the acquisition component includes: The processed monitoring data is obtained from the interface of the acquisition component by actively capturing the data.

4. The container monitoring method according to claim 1, characterized in that, The step of determining the indicator value of the indicator to be monitored based on the processed monitoring data includes: Based on the preset processing rules corresponding to the indicators to be monitored, the processing method is determined; Based on the processed monitoring data and the processing method, the indicator value of the indicator to be monitored is determined.

5. The container monitoring method according to claim 4, characterized in that, The step of determining the indicator value of the indicator to be monitored based on the processed monitoring data and the processing method includes: The processing order for filtering, correlation, and aggregation of the processed monitoring data is determined according to the processing method. The processed monitoring data is processed sequentially according to the processing order.

6. The container monitoring method according to claim 5, characterized in that, The step of processing the processed monitoring data sequentially according to the processing order includes: According to the processing order, when it is necessary to perform correlation processing on the processed monitoring data, the corresponding label of the indicator to be monitored is determined; Determine the first data with the corresponding tag in the processed monitoring data and the second data used to calculate the indicator to be monitored; Add the first data to the tag group of the second data to obtain the data after association processing.

7. The container monitoring method according to claim 5, characterized in that, The step of processing the processed monitoring data sequentially according to the processing order includes: According to the processing order, when it is necessary to aggregate the processed monitoring data, the aggregation function corresponding to the indicator to be monitored is determined. The processed monitoring data, after filtering and correlation, is substituted into the aggregation function to obtain the aggregated indicators.

8. The container monitoring method according to any one of claims 1 to 7, characterized in that, Also includes: When the indicator value meets the preset alarm rules, an alarm message is generated and sent to the corresponding contact person.

9. A container monitoring method, characterized in that, The container monitoring method, applied to the data acquisition component, includes: Acquire the basic monitoring data, tenant name, and corresponding task identification code within the node where the acquisition component is located. The basic monitoring data is in units of containers. Based on the task identification code, match the tenant name with the container within the node; Based on the correspondence, the tenant name and task identification code are added to the basic monitoring data corresponding to the container to obtain the processed monitoring data. The processed monitoring data is output to the server.

10. The container monitoring method according to claim 9, characterized in that, The step of matching the tenant name with the container within the node based on the task identification code includes: Based on preset association rules, the identifier of the container associated with the task identification code is determined. The association rules are used to represent preset conditions for judging whether the container identifier matches the task identification code. Based on the correspondence between the task identification code and the tenant, the correspondence between the tenant name and the container is determined.

11. A capacity monitoring device, characterized in that, Applied to servers, including: The receiving module is used to receive external requests for monitoring data, the external requests carrying the identifier of the metric to be monitored and the tenant's key; The processing module is used to determine the indicator value of the indicator to be monitored based on the processed monitoring data, which is obtained by adding the tenant name and task identification code to the basic monitoring data; and to send the indicator value to the external requester so that the external requester can display the indicator value. The processing module is further configured to determine that the key contained in the external request is consistent with the key corresponding to the tenant; The processing module also uses the tenant name and task identification code corresponding to the collection node, and collects basic monitoring data in units of containers, wherein the node corresponds to at least one container. In response to the collection action of the collection component corresponding to the node, the basic monitoring data, the tenant name and the task identification code are sent to the collection component. The collection component is used to add the tenant name and the task identification code to the basic monitoring data to obtain the processed monitoring data. The processed monitoring data is obtained from the acquisition component.

12. A container monitoring device, characterized in that, Applied to the acquisition components, including: The determination module is used to obtain the basic monitoring data, tenant name, and corresponding task identification code within the node where the acquisition component is located; The processing module is used to match the tenant name with the container in the node based on the task identification code; and, based on the correspondence, add tenant and task identification code tags to the basic monitoring data corresponding to the container to obtain the processed basic monitoring data; and, output the processed basic monitoring data.

13. An electronic device, characterized in that, include: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, cause the electronic device to perform the container monitoring method as described in any one of claims 1-10.

14. A container monitoring system, characterized in that, include: The acquisition layer, acquisition warning layer, and management layer are sequentially interconnected and communicate with each other. The acquisition layer includes at least one node, and the node is provided with an acquisition component and at least one container. The acquisition component is used to perform the container monitoring method as described in any one of claims 9-10. The alarm acquisition layer includes an alarm management module and a control module, and the control module is communicatively connected to the acquisition layer and the management layer, respectively. The management layer includes a service monitoring system, which is used to perform the container monitoring method as described in any one of claims 1-8.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the container monitoring method as described in any one of claims 1-10.

16. A computer program product, characterized in that, The computer program product includes computer execution instructions, which, when executed by a processor, are used to implement the container monitoring method as described in any one of claims 1-10.

Citation Information

Patent Citations

  • Method and system for monitoring cloud computing virtual tenant network

    CN106330602A

  • Data monitoring method and device, computer equipment and storage medium

    CN111143163A

  • Intelligent monitoring method and device, electronic equipment and readable storage medium

    CN112527599A

  • Container service monitoring method, system and computer readable storage medium

    WO2020125265A1