Multi-tenant system monitoring method, device, electronic device and storage medium
By acquiring and attaching the home information of workloads, monitoring of tenants, projects, and application dimensions in multi-tenant systems is solved, and the problem of limited monitoring dimensions in the existing technology is improved, and the flexibility and accuracy of the monitoring system are improved.
Patent Information
- Application Number
- CN202411413460.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2044-10-11
Smart Images

Figure CN118916247B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of system monitoring technology, and in particular to a multi-tenant system monitoring method, device, electronic device and storage medium. Background Art
[0002] The services in Kubernetes (an open source container orchestration system) run on a resource pool composed of nodes, which makes the call chain and topological relationship of locating Pods very complicated. Therefore, Kubernetes needs to be monitored in a visual way. Among the existing monitoring methods, TKE (Tencent Kubernetes Engine) provides monitoring data collection and display functions at five levels: cluster, node, workload, Pod (the basic operating unit in Kubernetes, which is a further abstraction and encapsulation of Container containers, providing containers with higher-level deployment and management capabilities), and Container. However, it cannot monitor data in other dimensions, resulting in the problem of limited monitoring dimensions in multi-tenant systems.
[0003] Therefore, how to flexibly implement monitoring in different dimensions in a multi-tenant system is a problem that needs to be solved urgently. Summary of the invention
[0004] The main purpose of this application is to provide a multi-tenant system monitoring method, device, electronic device and storage medium, aiming to solve the technical problem of how to implement tenant, project and application-based monitoring in a multi-tenant system.
[0005] To achieve the above objectives, the present application proposes a multi-tenant system monitoring method, the multi-tenant system monitoring method comprising:
[0006] For any workload in the multi-tenant system, upon receiving a creation request instruction and an attribution information additional instruction of the workload, obtaining attribution information of the workload, wherein the attribution information at least includes a tenant, a project, and an application to which the workload belongs;
[0007] Adding the attribution information to the template information of the workload, and saving the template information;
[0008] After receiving the monitoring data query instruction, the target template information in each template information is determined based on the target attribution information in the monitoring data query instruction, and the monitoring data of the workload corresponding to the target template information in the tenant, project and / or application dimensions is returned.
[0009] In one embodiment, the step of obtaining the attribution information of the workload includes:
[0010] Reading the identity of the workload;
[0011] The identity identifier is queried in a preset attribution information database to obtain the record attribution information corresponding to the identity identifier, and the record attribution information is used as the attribution information.
[0012] In one embodiment, the step of adding the attribution information to the template information of the workload includes:
[0013] Acquire template information of the workload, and parse the template information to obtain annotation information of the workload;
[0014] The attribution information is appended to the annotation information to obtain new annotation information, and the template information is updated by the new annotation information.
[0015] In one embodiment, the target attribution information includes at least one of a target tenant field, a target project field, and a target application field. The step of determining the target template information in each template information based on the target attribution information in the monitoring data query instruction, and returning the monitoring data of the workload corresponding to the target template information in the tenant, project, and / or application dimension includes:
[0016] In the case where the target attribution information is the target tenant field, determining the first target template information in each template information, and returning the first monitoring data of the workload corresponding to the first target template information in the tenant dimension, wherein the first target template information all records the target tenant field, and the first monitoring data is all monitoring data of the tenant corresponding to the target tenant field;
[0017] In the case where the target attribution information is the target project field, second target template information in each template information is determined, and second monitoring data of the workload corresponding to the second target template information in the project dimension is returned, wherein the second target template information all records the target project field, and the second monitoring data is all monitoring data of the project corresponding to the target project field;
[0018] In the case where the target attribution information is the target application field, the third target template information in each template information is determined, and the third monitoring data of the workload corresponding to the third target template information in the application dimension is returned, wherein the third target template information records the target application field, and the third monitoring data is all monitoring data of the application corresponding to the target application field.
[0019] In one embodiment, the multi-tenant system monitoring method further includes:
[0020] Obtain tenant information of each tenant in the multi-tenant system, project information of each project under each tenant, and application information of each application under each project;
[0021] A query statement collection is generated based on each of the tenant information, each of the project information and each of the application information, and each query statement in the query statement collection is encapsulated to form a query option, wherein the query instruction is obtained after the query option is selected.
[0022] In one embodiment, before the step of obtaining the attribution information of the workload, the step further includes:
[0023] Authenticating the creation request instruction, and if the creation request instruction is authenticated, executing the step of obtaining the attribution information of the workload;
[0024] In the case where the creation request instruction authentication fails, an authentication failure prompt signal is output, and the step of obtaining the attribution information of the workload is canceled.
[0025] In one embodiment, the step of adding the attribution information to the template information of the workload further includes:
[0026] Verifying the template information based on preset standard template information, and if the template information passes the verification, executing the step of saving the template information;
[0027] In the case where the template information verification fails, a verification failure prompt signal is output, and the step of saving the template information is canceled.
[0028] In addition, to achieve the above purpose, the present application also proposes a multi-tenant system monitoring device, the multi-tenant system monitoring device comprising:
[0029] an acquisition module, configured to, for any workload in the multi-tenant system, acquire the attribution information of the workload upon receiving a creation request instruction and an attribution information additional instruction of the workload, wherein the attribution information at least includes the tenant, project, and application to which the workload belongs;
[0030] An additional module, used for adding the attribution information to the template information of the workload and saving the template information;
[0031] The monitoring module is used to determine the target template information in each template information based on the target attribution information in the monitoring data query instruction after receiving the monitoring data query instruction, and return the monitoring data of the workload corresponding to the target template information in the tenant, project and / or application dimensions.
[0032] In addition, to achieve the above-mentioned purpose, the present application also proposes an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the multi-tenant system monitoring method as described above.
[0033] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the multi-tenant system monitoring method described above are implemented.
[0034] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the multi-tenant system monitoring method described above are implemented.
[0035] One or more technical solutions proposed in this application have at least the following technical effects:
[0036] The present application first obtains the attribution information of any workload in the multi-tenant system upon receiving a creation request instruction and an attribution information appending instruction of the workload, so as to ensure that when creating the workload, the tenant, project and application to which the workload belongs can be accurately identified, thereby providing basic attribution information for subsequent monitoring and management; appends the attribution information to the template information of the workload, and saves the template information to combine the attribution information of the workload with the template information, so that the monitoring data of each workload can be associated with a specific tenant, project and application, which is convenient for quickly locating and filtering relevant data during the monitoring process, and improving the accuracy and practicality of the monitoring data; after receiving a monitoring data query instruction, determines the target template information in each template information based on the target attribution information in the monitoring data query instruction, and returns the monitoring data of the workload corresponding to the target template information in the tenant, project and / or application dimensions, so as to accurately filter out qualified monitoring data according to the query requirements, so that the monitoring system can quickly retrieve and display the monitoring data of a specific tenant, project or application, thereby improving the flexibility of the monitoring system.
[0037] In summary, this application combines the workload attribution information in the three dimensions of tenant, project, and application with its own template information, so that during the monitoring data query process, it can quickly locate and extract the corresponding monitoring data in the three dimensions of tenant, project, and application according to the target attribution information, thereby improving the flexibility of the monitoring system and realizing monitoring based on tenants, projects, and applications in a multi-tenant system. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0040] Figure 1 A flowchart of the first embodiment of the multi-tenant system monitoring method of the present application is provided;
[0041] Figure 2 A flowchart of the second embodiment of the multi-tenant system monitoring method of the present application is provided;
[0042] Figure 3 A brief flowchart of the multi-tenant system monitoring method provided in Example 2 of the present application;
[0043] Figure 4 A schematic diagram of a multi-tenant system monitoring method provided in Example 2 of the present application;
[0044] Figure 5 This is a schematic diagram of the module structure of the multi-tenant system monitoring device according to an embodiment of the present application;
[0045] Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the multi-tenant system monitoring method in the embodiment of the present application.
[0046] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0047] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0048] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0049] The main solution of the embodiment of the present application is: for any workload in the multi-tenant system, upon receiving a creation request instruction and an attribution information appending instruction of the workload, obtaining the attribution information of the workload, wherein the attribution information at least includes the tenant, project and application to which the workload belongs; appending the attribution information to the template information of the workload, and saving the template information; after receiving a monitoring data query instruction, determining the target template information in each template information based on the target attribution information in the monitoring data query instruction, and returning the monitoring data of the workload corresponding to the target template information in the tenant, project and / or application dimensions.
[0050] The existing technology only provides monitoring data collection and display functions at the cluster, node, workload, Pod, and Container levels, but cannot monitor data in other dimensions, resulting in the problem of limited monitoring dimensions in multi-tenant systems. Therefore, how to flexibly implement monitoring in different dimensions in a multi-tenant system is a problem that needs to be solved urgently.
[0051] The present application provides a solution, which combines the workload's attribution information in the three dimensions of tenant, project, and application with its own template information, so that in the monitoring data query process, the corresponding monitoring data in the three dimensions of tenant, project, and application can be quickly located and extracted according to the target attribution information, thereby improving the flexibility of the monitoring system and realizing monitoring in the dimensions of tenant, project, and application in a multi-tenant system.
[0052] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device that can realize the above functions. The following takes an electronic device as an example to illustrate this embodiment and the following embodiments.
[0053] Based on this, the present application embodiment provides a multi-tenant system monitoring method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the multi-tenant system monitoring method of the present application.
[0054] In this embodiment, the multi-tenant system monitoring method includes steps S10 to S30:
[0055] Step S10, for any workload in the multi-tenant system, upon receiving a creation request instruction and an attribution information additional instruction of the workload, obtaining attribution information of the workload, wherein the attribution information at least includes a tenant, a project, and an application to which the workload belongs;
[0056] It should be noted that a workload refers to a service instance running in any Kubernetes cluster of a multi-tenant system, which can be a Deployment, a StatefulSet, or other types of resources; a create request instruction refers to a command issued by a user or system to generate a new workload; an attribution information attachment instruction refers to a command instructing the system to associate specific attribution information with the newly created workload; attribution information refers to data that identifies the tenant, project, and application described in the workload, such as tenant ID, project name, and application tag.
[0057] It is understandable that since the monitoring method of the traditional multi-tenant system cannot support monitoring in different dimensions, performing step S10 can ensure that each workload in the multi-tenant system obtains the correct attribution information to support different fine-grained monitoring and management, and provide an effective data foundation for the subsequent accurate identification of the tenant, project and application to which the workload belongs.
[0058] In a feasible implementation manner, the step of obtaining the attribution information of the workload in step S10 may include steps S11 to S12:
[0059] Step S11, reading the identity of the workload;
[0060] It should be noted that an identity identifier refers to a tag used to uniquely identify a workload, such as the SPIFFE ID (Secure Production Identity Framework For Everyone Identity) or other unique codes.
[0061] It is understandable that since querying and determining the detailed information of the workload requires a reliable identifier, performing step S11 can avoid the inability to correctly query and determine the detailed information of the workload due to the lack of a unique identifier, and provides a reliable query basis for querying the attribution information of the workload.
[0062] Step S12, querying the identity identifier in a preset attribution information database, obtaining the record attribution information corresponding to the identity identifier, and using the record attribution information as the attribution information.
[0063] It should be noted that the recorded attribution information refers to the attribution information such as tenants, projects, and applications associated with the identity of the workload, which is stored in a preset attribution information database.
[0064] It is understandable that since the process of obtaining attribution information for complex tasks often leads to incomplete or inaccurate attribution information, which may cause errors in pulling monitoring data, step S12 is performed to ensure that the attribution information of the workload is accurate by retrieving the corresponding attribution information from the preset database based on the identity identifier, so that the monitoring data can be classified and reported according to the correct tenants, projects and applications.
[0065] In this implementation, by adopting database query and identification mapping methods, the workload is accurately associated with its tenant, project, and application, ensuring that the monitoring data of each workload can be classified and reported according to its correct attribution information, thereby improving the accuracy of the monitoring data and the management efficiency of the system.
[0066] Step S20, adding the attribution information to the template information of the workload, and saving the template information;
[0067] It should be noted that template information refers to a data structure or document that defines workload configuration and attributes. The template information includes detailed information such as workload operating parameters, resource requirements, annotation information, etc.
[0068] It is understandable that since traditional monitoring methods cannot divide workloads in different dimensions, it is difficult to perform accurate data screening and resource allocation according to the different needs of tenants, projects or applications during monitoring and management. Therefore, step S20 is performed to avoid the lack of flexibility in the management of monitoring data due to missing or unclear attribution information by appending the attribution information to the template information, and achieves a close association between the workload's attribution information and its configuration information, thereby ensuring the accuracy of the monitoring data and the flexibility of resource management.
[0069] In a feasible implementation manner, the step of adding the attribution information to the template information of the workload in step S20 may include steps S21-S22:
[0070] Step S21, acquiring template information of the workload, and parsing the template information to obtain annotation information of the workload;
[0071] It should be noted that annotation information refers to metadata attached to template information and used to describe or illustrate workload attributes, configurations, or behaviors.
[0072] It is understandable that since the template information of the workload is usually not rich enough, the readability and manageability are not strong, and it is difficult to support complex monitoring requirements, step S21 is performed to make full use of the annotation information to enhance the readability and manageability of the template information, avoid the difficulties in understanding and using the template information due to the lack of detailed description, and provide richer and easier to understand template information, which facilitates subsequent monitoring and management operations.
[0073] Step S22: append the attribution information to the annotation information to obtain new annotation information, and update the template information with the new annotation information.
[0074] It is understandable that since traditional monitoring solutions may not effectively integrate attribution information and template annotations, resulting in the inability to accurately correspond monitoring data to specific tenants, projects or applications, performing step S22 can avoid monitoring data classification errors caused by the separation of attribution information and template information, and ensure that the template information contains complete attribution information, so that the monitoring system can perform accurate data screening and resource management based on the attribution information.
[0075] In this implementation, by parsing the annotation information in the workload template information and appending the attribution information to the annotation information to update the template information, not only can it be ensured that the template information contains detailed attribution data of the workload, but it can also make the monitoring data closely correspond to specific tenants, projects or applications, thereby improving the data accuracy of the monitoring system and the level of refinement of resource management.
[0076] Step S30, after receiving the monitoring data query instruction, determine the target template information in each template information based on the target attribution information in the monitoring data query instruction, and return the monitoring data of the workload corresponding to the target template information in the tenant, project and / or application dimensions.
[0077] It should be noted that the monitoring data query instruction refers to the command issued by the user or system for retrieving the monitoring data of a multi-tenant system; the target attribution information refers to the information of a specific tenant, project or application specified during the query for filtering the monitoring data; the target template information refers to the template information corresponding to the target attribution information specified in the query instruction.
[0078] It is understandable that since traditional monitoring solutions can only monitor based on metadata that indicates logical hierarchical relationships in the system, and lack the ability to accurately filter data based on specific attribution information, the monitoring data retrieval efficiency is low and the accuracy is insufficient, and it is unable to meet flexible business needs. Therefore, performing step S30 can avoid monitoring data query errors or omissions caused by the inability to accurately match specific attribution information, ensure that the system can quickly and accurately retrieve and return relevant monitoring data according to user needs, improve the data relevance of the monitoring system, and at the same time meet the user's business monitoring needs in three dimensions: tenants, projects, and applications.
[0079] In a feasible implementation manner, the target attribution information includes at least one of a target tenant field, a target project field, and a target application field. The step of determining the target template information in each of the template information based on the target attribution information in the query instruction in step S30, and returning the monitoring data of the workload corresponding to the target template information in the tenant, project, and / or application dimension may include steps S31 to S33:
[0080] Step S31, when the target attribution information is the target tenant field, determine the first target template information in each of the template information, and return the first monitoring data of the workload corresponding to the first target template information in the tenant dimension, wherein the first target template information all records the target tenant field, and the first monitoring data is all monitoring data of the tenant corresponding to the target tenant field;
[0081] It should be noted that the target tenant field refers to field information used to identify a specific tenant, the first template information refers to template information containing the specific tenant field information, and the first monitoring data refers to all monitoring data related to the specific tenant.
[0082] It is understandable that, since the traditional monitoring method cannot filter the monitoring data in the tenant dimension, performing step S31 can avoid confusion of monitoring data among different tenants, thereby providing accurate and independent monitoring data for different tenants.
[0083] Step S32, when the target attribution information is the target project field, determine the second target template information in each of the template information, and return the second monitoring data of the workload corresponding to the second target template information in the project dimension, wherein the second target template information all records the target project field, and the second monitoring data is all monitoring data of the project corresponding to the target project field;
[0084] It should be noted that the target project field refers to field information used to identify a specific project, the second template information refers to template information containing the specific project field information, and the second monitoring data refers to all monitoring data related to the specific project.
[0085] It is understandable that, since it is impossible to filter monitoring data in the project dimension in the traditional monitoring method, performing step S32 can avoid confusion of monitoring data between different projects, thereby providing accurate and independent monitoring data for different projects.
[0086] Step S33, when the target attribution information is the target application field, determine the third target template information in each of the template information, and return the third monitoring data of the workload corresponding to the third target template information in the application dimension, wherein the third target template information records the target application field, and the third monitoring data is all monitoring data of the application corresponding to the target application field.
[0087] It should be noted that the target application field refers to field information used to identify a specific application, the third template information refers to template information containing the specific application field information, and the third monitoring data refers to all monitoring data related to the specific application.
[0088] It is understandable that, since it is impossible to filter monitoring data in the application dimension in traditional monitoring methods, performing step S33 can avoid confusion of monitoring data between different applications, thereby providing accurate and independent monitoring data for different applications.
[0089] In this implementation, by using condition matching and screening based on different attribution information fields (target tenant field, target project field, target application field), it is possible to quickly locate and display monitoring data for specific tenants, projects or applications, thereby improving the query efficiency and accuracy of monitoring data, while ensuring data isolation and security between different tenants, projects and applications.
[0090] This embodiment provides a multi-tenant system monitoring method, which combines the workload attribution information in the three dimensions of tenant, project, and application with its own template information, so that in the monitoring data query process, the corresponding monitoring data in the three dimensions of tenant, project, and application can be quickly located and extracted according to the target attribution information, thereby improving the flexibility of the monitoring system and realizing monitoring in the dimensions of tenant, project, and application in the multi-tenant system.
[0091] In a feasible implementation manner, before the step of obtaining the attribution information of the workload in step S10, steps S101 to S102 may be included:
[0092] Step S101, authenticating the creation request instruction, and if the creation request instruction is authenticated, executing the step of obtaining the attribution information of the workload;
[0093] It is understandable that since traditional monitoring methods may ignore the security and permission control of creation requests, step S101 is performed to authenticate the creation request instruction to avoid unauthorized users from creating workloads, thereby protecting system resources from illegal use and ensuring that only users with corresponding permissions can create workloads in the system.
[0094] Step S102: if the authentication of the creation request instruction fails, an authentication failure prompt signal is output, and the step of obtaining the attribution information of the workload is canceled.
[0095] It should be noted that the authentication failure prompt signal refers to the notification information sent to the user when the system finds that the creation request instruction does not meet the permission requirements during the authentication process.
[0096] It is understandable that, since traditional monitoring methods usually do not provide sufficient feedback mechanisms to handle authentication failures, performing step S102 can avoid the system's unresponsiveness or improper error handling after authentication failure, and provide users with clear authentication failure feedback, helping users understand the reasons why the operation was rejected, so as to guide users to take correct measures and maintain the security and stability of the system.
[0097] In this embodiment, by performing permission verification on the creation request instruction for creating a workload, it can not only ensure that only users with appropriate permissions can obtain and set the workload's ownership information, but also notify the user of the reason why the operation was rejected by outputting an authentication failure prompt signal, thereby improving the security and reliability of the system.
[0098] In a feasible implementation manner, after the step of adding the attribution information to the template information of the workload in step S20, steps S201 to S202 may be included:
[0099] Step S201, verifying the template information based on preset standard template information, and executing the step of saving the template information if the template information passes the verification;
[0100] It is understandable that since traditional monitoring methods usually lack verification of the correctness of template information, some erroneous template information is saved, which in turn leads to the inability to accurately pull information during the screening of monitoring information. Therefore, step S201 is performed to avoid saving template information with incorrect format or non-compliant with specifications, ensuring the accuracy and consistency of template information, thereby ensuring the stable operation of the monitoring system.
[0101] Step S202: if the template information verification fails, a verification failure prompt signal is output, and the step of saving the template information is canceled.
[0102] It should be noted that the verification failure prompt signal refers to the error notification information sent to the user when the system finds that the template does not meet the preset standard during the process of verifying the template information.
[0103] It is understandable that since traditional monitoring methods may not provide sufficient feedback mechanisms to handle verification failures, performing step S202 can avoid erroneously saving template information after verification fails, providing users with clear verification failure feedback, helping users to understand the problem in a timely manner and guiding them to take corrective measures, thereby preventing monitoring system failures caused by incorrect template information.
[0104] In this embodiment, by verifying the template information after the attribution information is added, it is ensured that the template information meets the preset standards. This not only prevents the template information that does not meet the specifications from being saved, but also notifies the user of the error by outputting a verification failure prompt signal, thereby maintaining the accuracy of the monitoring data and the reliability of the system.
[0105] In a feasible implementation manner, before the step of outputting the verification failure prompt signal in step S202, steps S210 to S220 may be included:
[0106] Step S210, extracting the data format of the preset standard template information, and modifying the template information based on the data format to obtain new template information;
[0107] It should be noted that the data format refers to the data structure and format specification followed by the preset standard template information, and the data format defines how the data in the template information should be organized and arranged.
[0108] It is understandable that since there is currently a lack of a way to eliminate template format errors when errors occur in the template information format, step S210 is performed to correct the template information based on standard template information, thereby avoiding the situation where only an error is reported but no effective action can be taken to resolve the error when an error occurs in the template information format. This can reduce inaccurate or failed monitoring data pulling due to incorrect template information format, thereby improving the accuracy of the monitoring data and the reliability of the system.
[0109] Exemplarily, when the resource limitation field in the template information fails to pass the check, the standard resource limitation field in the preset standard template information is extracted, and a string containing memory and CPU limitations is generated based on the standard resource limitation field, so that the resource limitation field in the template information is updated through the string to obtain new template information.
[0110] Step S220, returning the new template information to execute the step of verifying the template information based on the preset standard template information, and recording the number of consecutive triggering returns to execute, and when the number exceeds the preset number, executing the step of outputting the verification failure prompt signal.
[0111] It is understandable that, since the correction degree and correction performance of the system are limited, step S220 is performed to issue an alarm after the template information is continuously corrected for a preset number of times, thereby ensuring the normal operation of the system while reducing errors in the format of the template information.
[0112] In this implementation, by formatting the template information based on preset standard template information, the problems of workload deployment failure and low monitoring data accuracy caused by incorrect template information format are alleviated, further improving the reliability of the system and the correctness of the monitoring data.
[0113] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 2 , Figure 2 This is a flow chart of the second embodiment of the multi-tenant system monitoring method of the present application.
[0114] The multi-tenant system monitoring method further includes steps S01-S02:
[0115] Step S01, obtaining tenant information of each tenant in the multi-tenant system, project information of each project under each tenant, and application information of each application under each project;
[0116] It should be noted that tenant information refers to data that identifies and describes each tenant in a multi-tenant system, such as tenant ID, name, etc.; project information refers to information about specific projects under each tenant, such as project ID, name, etc.; application information refers to more fine-grained information about the application under each project, such as application ID, name, version, etc.
[0117] It is understandable that since traditional monitoring methods usually do not systematically collect and organize hierarchical structure information in a multi-tenant environment, performing step S01 can avoid the difficulty of querying monitoring data due to incomplete or inaccurate workload attribution information, and provide comprehensive and structured tenant, project and application information for accurate monitoring.
[0118] Step S02, generating a query statement collection based on each tenant information, each project information and each application information, and encapsulating each query statement in the query statement collection to form a query option, wherein the query instruction is obtained after the query option is selected.
[0119] It should be noted that the query statement collection refers to a set of PromQL statements or other query languages used to query monitoring data. Among them, PromQL statements are the query language of the Prometheus monitoring service, which supports instantaneous queries and time span queries, and has built-in multiple functions and operators. It can aggregate, slice, predict and combine raw data. Prometheus is an open source monitoring and alerting tool that is used to record the measurement data of systems and services, and provides multiple ways to query data, display charts and alert notifications; query options refer to a display method in which each encapsulated query statement can be used directly. Users can select query options to implement the execution of query instructions.
[0120] It is understandable that, since traditional monitoring methods often require users to manually write query statements, performing step S02 can avoid the tediousness and errors of manually constructing query statements, and automatically generate query options for different tenants, projects and applications, thereby improving the efficiency and accuracy of monitoring data retrieval.
[0121] In this embodiment, by pre-packaging query statements for different tenants, projects and applications, it is possible to flexibly build monitoring query options based on the structured information of the multi-tenant system, reduce the complexity and error rate of manually building query statements, and improve the retrieval efficiency and accuracy of monitoring data.
[0122] For example, to help understand the implementation process of the multi-tenant system monitoring method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 3 , Figure 3A brief flowchart of a multi-tenant system monitoring method is provided, specifically:
[0123] When an API request, i.e., a create request instruction, is received, it is processed by the API HTTP processor module, and the create request instruction is authenticated in the identity authorization verification module. If the authentication is passed, it is determined in the variant admission module whether the workload required to be created by the create request instruction is configured with a Webhook plug-in (referring to AdmissionWebhook, a mechanism in Kubernetes, which is used to intercept and modify workload resources by calling external Web services when workload resources are created, updated or deleted). If so, the execution logic of the Webhook plug-in is triggered: first, it is determined whether an attribution information append instruction is received. If the attribution information append instruction is received, the template information of the workload is obtained, and the annotation information is parsed from the template information. Then, the identity of the workload is obtained, and the attribution information of the workload is obtained according to the identity, and the attribution information is attached to the annotation information of the workload to update the template information of the workload. After the Webhook plug-in is executed, the template information of the workload is verified through the preset standard template information in the object architecture verification module. After the verification passes, the template information is verified again through the verification access module to see if it is valid. Finally, the verified valid template information is saved in ectd (an open source distributed key-value storage library) through the etcd module.
[0124] For further information, please refer to Figure 4 , Figure 4 A scenario diagram of a multi-tenant system monitoring method is provided, specifically:
[0125] The user creates a workload in the container management platform by creating a request instruction to deploy the workload by calling the Kubernetes interface through the container management platform. The Webhook plug-in is then triggered in the API service to attach additional annotation information to the workload through the plug-in in the settings module, that is, to attach attribution information to the annotation information of the workload, and deploy the workload with the attached information to the Kubernetes cluster. When users query monitoring data through PromQL statements, Promethes pulls and returns the monitoring data corresponding to the PromQL statement in the Kubernetes cluster. For example, through the PromQL statement: sum(sum(irate(container_cpu_usage_seconds_total[5m])+on(pod,namespace,szccluster) group_left(annotation_szcapp)(max(kube_pod_annotations{annotation_szcapp!=''})by(pod,namespace,szccluster,annotation_szcapp)*0))by(annotation_szcapp)), the application is used as the dimension to query the cpu_usage of all applications whose target application field is szcapp, that is, the CPU usage.
[0126] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the multi-tenant system monitoring method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0127] This application also provides a multi-tenant system monitoring device, please refer to Figure 5 , the multi-tenant system monitoring device comprises:
[0128] An acquisition module 10 is configured to, for any workload in the multi-tenant system, acquire the attribution information of the workload upon receiving a creation request instruction and an attribution information additional instruction of the workload, wherein the attribution information at least includes the tenant, project, and application to which the workload belongs;
[0129] An appending module 20, configured to append the attribution information to the template information of the workload and save the template information;
[0130] The monitoring module 30 is used to determine the target template information in each template information based on the target attribution information in the monitoring data query instruction after receiving the monitoring data query instruction, and return the monitoring data of the workload corresponding to the target template information in the tenant, project and / or application dimensions.
[0131] Optionally, the acquisition module 10 is further used for:
[0132] Reading the identity of the workload;
[0133] The identity identifier is queried in a preset attribution information database to obtain the record attribution information corresponding to the identity identifier, and the record attribution information is used as the attribution information.
[0134] Optionally, the additional module 20 is further used for:
[0135] Acquire template information of the workload, and parse the template information to obtain annotation information of the workload;
[0136] The attribution information is appended to the annotation information to obtain new annotation information, and the template information is updated by the new annotation information.
[0137] Optionally, the target attribution information includes at least one of a target tenant field, a target project field, and a target application field, and the monitoring module 30 is further used to:
[0138] In the case where the target attribution information is the target tenant field, determining the first target template information in each template information, and returning the first monitoring data of the workload corresponding to the first target template information in the tenant dimension, wherein the first target template information all records the target tenant field, and the first monitoring data is all monitoring data of the tenant corresponding to the target tenant field;
[0139] In the case where the target attribution information is the target project field, second target template information in each template information is determined, and second monitoring data of the workload corresponding to the second target template information in the project dimension is returned, wherein the second target template information all records the target project field, and the second monitoring data is all monitoring data of the project corresponding to the target project field;
[0140] In the case where the target attribution information is the target application field, the third target template information in each template information is determined, and the third monitoring data of the workload corresponding to the third target template information in the application dimension is returned, wherein the third target template information records the target application field, and the third monitoring data is all monitoring data of the application corresponding to the target application field.
[0141] Optionally, the encapsulation module 40 in the multi-tenant system monitoring device is further used for:
[0142] Obtain tenant information of each tenant in the multi-tenant system, project information of each project under each tenant, and application information of each application under each project;
[0143] A query statement collection is generated based on each of the tenant information, each of the project information and each of the application information, and each query statement in the query statement collection is encapsulated to form a query option, wherein the query instruction is obtained after the query option is selected.
[0144] Optionally, the acquisition module 10 is further used for:
[0145] Authenticating the creation request instruction, and if the creation request instruction is authenticated, executing the step of obtaining the attribution information of the workload;
[0146] In the case where the creation request instruction authentication fails, an authentication failure prompt signal is output, and the step of obtaining the attribution information of the workload is canceled.
[0147] Optionally, the additional module 20 is further used for:
[0148] Verifying the template information based on preset standard template information, and if the template information passes the verification, executing the step of saving the template information;
[0149] In the case where the template information verification fails, a verification failure prompt signal is output, and the step of saving the template information is canceled.
[0150] The multi-tenant system monitoring device provided by the present application adopts the multi-tenant system monitoring method in the above embodiment, which can solve the technical problem of how to flexibly implement monitoring of different dimensions in a multi-tenant system. Compared with the prior art, the beneficial effects of the multi-tenant system monitoring device provided by the present application are the same as the beneficial effects of the multi-tenant system monitoring method provided by the above embodiment, and the other technical features in the multi-tenant system monitoring device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0151] The present application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the multi-tenant system monitoring method in the above-mentioned embodiment one.
[0152] Reference below Figure 6, which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic devices in the embodiments of the present application may include but are not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), Tablet PCs (Tablet Personal Computers), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0153] like Figure 6 As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0154] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0155] The electronic device provided by the present application adopts the multi-tenant system monitoring method in the above embodiment, which can solve the technical problem of how to flexibly implement monitoring of different dimensions in a multi-tenant system. Compared with the prior art, the beneficial effects of the electronic device provided by the present application are the same as the beneficial effects of the multi-tenant system monitoring method provided by the above embodiment, and the other technical features in the electronic device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0156] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0157] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0158] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, the computer-readable program instructions being used to execute the multi-tenant system monitoring method in the above-mentioned embodiment.
[0159] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0160] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0161] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by an electronic device, the electronic device: for any workload in the multi-tenant system, upon receiving a creation request instruction and an attribution information appending instruction of the workload, obtains the attribution information of the workload, wherein the attribution information at least includes the tenant, project and application to which the workload belongs; appends the attribution information to the template information of the workload and saves the template information; after receiving a monitoring data query instruction, determines the target template information in each template information based on the target attribution information in the monitoring data query instruction, and returns the monitoring data corresponding to the target template information.
[0162] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0163] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0164] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0165] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned multi-tenant system monitoring method, and can solve the technical problem of how to flexibly implement monitoring of different dimensions in a multi-tenant system. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the multi-tenant system monitoring method provided in the above-mentioned embodiment, and will not be repeated here.
[0166] The present application also provides a computer program product, including a computer program, which implements the steps of the multi-tenant system monitoring method as described above when executed by a processor.
[0167] The computer program product provided by this application can solve the technical problem of how to flexibly implement monitoring of different dimensions in a multi-tenant system. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the multi-tenant system monitoring method provided by the above embodiment, which will not be repeated here.
[0168] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A multi-tenant system monitoring method, characterized in that: The multi-tenant system monitoring method comprises: For any workload in the multi-tenant system, upon receiving a creation request instruction and an attribution information additional instruction of the workload, obtaining attribution information of the workload, wherein the attribution information at least includes a tenant, a project, and an application to which the workload belongs; Adding the attribution information to the template information of the workload, and saving the template information; After receiving the monitoring data query instruction, when the target attribution information corresponding to the monitoring data query instruction is the target tenant field, determine the first target template information in each template information, and return the first monitoring data of the workload corresponding to the first target template information in the tenant dimension, wherein the first target template information records the target tenant field, and the first monitoring data is all monitoring data of the tenant corresponding to the target tenant field; In the case where the target attribution information corresponding to the monitoring data query instruction is a target project field, determining the second target template information in each template information, and returning the second monitoring data of the workload corresponding to the second target template information in the project dimension, wherein the second target template information all records the target project field, and the second monitoring data is all monitoring data of the project corresponding to the target project field; In the case where the target attribution information corresponding to the monitoring data query instruction is a target application field, determining the third target template information in each template information, and returning the third monitoring data of the workload corresponding to the third target template information in the application dimension, wherein the third target template information all records the target application field, and the third monitoring data is all monitoring data of the application corresponding to the target application field; After the step of adding the attribution information to the template information of the workload, the step further includes: Verifying the template information based on preset standard template information, and if the template information passes the verification, executing the step of saving the template information; If the template information fails to pass the verification, extracting the data format of the preset standard template information, and modifying the template information based on the data format to obtain new template information; Return the new template information to execute the step of verifying the template information based on the preset standard template information, and record the number of consecutive triggering returns; When the number of times exceeds the preset number of times, a verification failure prompt signal is output, and the step of saving the template information is canceled.
2. The multi-tenant system monitoring method according to claim 1, characterized in that: The step of obtaining the attribution information of the workload includes: Reading the identity of the workload; The identity identifier is queried in a preset attribution information database to obtain the record attribution information corresponding to the identity identifier, and the record attribution information is used as the attribution information.
3. The multi-tenant system monitoring method according to claim 1, characterized in that: The step of adding the attribution information to the template information of the workload includes: Acquire template information of the workload, and parse the template information to obtain annotation information of the workload; The attribution information is appended to the annotation information to obtain new annotation information, and the template information is updated by the new annotation information.
4. The multi-tenant system monitoring method according to claim 1, characterized in that: The multi-tenant system monitoring method further includes: Obtain tenant information of each tenant in the multi-tenant system, project information of each project under each tenant, and application information of each application under each project; A query statement collection is generated based on each of the tenant information, each of the project information and each of the application information, and each query statement in the query statement collection is encapsulated to form a query option, wherein the query instruction is obtained after the query option is selected.
5. The multi-tenant system monitoring method according to claim 1, characterized in that: Before the step of obtaining the attribution information of the workload, the step further includes: Authenticating the creation request instruction, and if the creation request instruction is authenticated, executing the step of obtaining the attribution information of the workload; In the case where the creation request instruction authentication fails, an authentication failure prompt signal is output, and the step of obtaining the attribution information of the workload is canceled.
6. A multi-tenant system monitoring device, characterized in that: The multi-tenant system monitoring device comprises: an acquisition module, configured to, for any workload in the multi-tenant system, acquire the attribution information of the workload upon receiving a creation request instruction and an attribution information additional instruction of the workload, wherein the attribution information at least includes the tenant, project, and application to which the workload belongs; An additional module, used for adding the attribution information to the template information of the workload and saving the template information; After the step of adding the attribution information to the template information of the workload, the step further includes: Verifying the template information based on preset standard template information, and if the template information passes the verification, executing the step of saving the template information; If the template information fails to pass the verification, extracting the data format of the preset standard template information, and modifying the template information based on the data format to obtain new template information; Return the new template information to execute the step of verifying the template information based on the preset standard template information, and record the number of consecutive triggering returns; When the number of times exceeds the preset number of times, a verification failure prompt signal is output, and the step of saving the template information is canceled; A monitoring module, for, after receiving a monitoring data query instruction, determining the first target template information in each template information when the target attribution information corresponding to the monitoring data query instruction is a target tenant field, and returning the first monitoring data of the workload corresponding to the first target template information in the tenant dimension, wherein the first target template information all records the target tenant field, and the first monitoring data is all monitoring data of the tenant corresponding to the target tenant field; In the case where the target attribution information corresponding to the monitoring data query instruction is a target project field, determining the second target template information in each template information, and returning the second monitoring data of the workload corresponding to the second target template information in the project dimension, wherein the second target template information all records the target project field, and the second monitoring data is all monitoring data of the project corresponding to the target project field; When the target attribution information corresponding to the monitoring data query instruction is the target application field, the third target template information in each template information is determined, and the third monitoring data of the workload corresponding to the third target template information in the application dimension is returned, wherein the third target template information records the target application field, and the third monitoring data is all monitoring data of the application corresponding to the target application field.
7. An electronic device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the multi-tenant system monitoring method according to any one of claims 1 to 5.
8. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the multi-tenant system monitoring method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Configuration management method and device, equipment and storage medium
CN114398151A
Multi-tenant system, multi-tenant management method, computer equipment and storage medium
CN115185946A