Disclosure of Invention
In view of the foregoing, an object of the embodiments of the present application is to provide a service index calculation method and system, which can simplify the burden of configuration.
In a first aspect, an embodiment of the present application provides a service index calculation method, including: monitoring SLO resources through a target program, wherein the SLO resources are targets corresponding to service indexes; if the SLO resource is changed, generating a rule file according to the changed SLO resource and a target SLI resource, wherein the SLI resource is a plurality of general templates corresponding to a plurality of service indexes, and the target SLI resource is a general template corresponding to the changed SLO resource; monitoring change information of the rule file through a target monitoring cluster; and updating a calculation task in the target monitoring cluster according to the change information, wherein the calculation task is used for calculating the index value of the service index.
In the implementation process, by setting various universal templates corresponding to various service indexes, one universal template can be used for various SLO resources, and the configuration burden can be greatly simplified. In addition, the system can generate a corresponding rule file according to the configured SLO resource and the universal template corresponding to the SLO resource, and further update the calculation task through the rule file so as to calculate the index value of the updated service index. For a user, various general templates (namely, a plurality of SLI resources) corresponding to various service indexes are configured in advance, and when the indexes are updated every time later, the SLO resources are only required to be configured, and the system can update a calculation task according to the configured SLO resources and execute the calculation task so as to obtain the index values of the service indexes. In the whole process, the user only needs to configure SLO resources, so that the workload of the user is greatly reduced, and the working efficiency is improved.
In one embodiment, the SLI resource is a custom SLI resource, and before the target program listens to the SLO resource, the method further includes: writing the custom SLI resources obtained by the man-machine interaction interface into a target open source cluster, wherein the number of the custom SLI resources is multiple, and the target open source cluster is used for storing the custom SLI resources.
In the implementation process, through setting the man-machine interaction interface, a user can intuitively check the configured SLI resources, so that the defects of the configured SLI resources are easily found, the configured SLI resources are optimized, and the accuracy of SLI resource configuration is improved. In addition, the user can configure the corresponding SLI resources in a self-defined mode according to the actual situation, and the flexibility of SLI resource configuration is improved.
In one embodiment, the SLO resource is a custom SLO resource, and before the target program listens to the SLO resource, the method further includes: associating the custom SLO resource obtained by the man-machine interaction interface with a target custom SLI resource corresponding to the custom SLO resource; writing the custom SLO resource into the target open source cluster; updating the SLO resources in the target open source cluster through the custom SLO resources.
In the implementation process, when a user needs to perform index value calculation of a service index, the user-defined SLO resource is written into the target open source cluster after the obtained user-defined SLO resource is associated with the target user-defined SLI resource, so that the SLO resource in the target open source cluster is updated, and then the target software is triggered to generate a rule file according to the SLO resource updating condition. Because the custom SLO resource is associated with the corresponding target custom SLI resource before writing into the target open source cluster, a rule file can be directly generated through the associated target custom SLI resource and the custom SLO resource. The custom SLI resource and the custom SLO resource are not required to be matched additionally, the occurrence of the condition that the custom SLO resource is matched to an unsuitable custom SLI resource is reduced, and the accuracy of rule file generation is improved.
In one embodiment, the custom SLI resource includes a SLO resource to-be-selected variable and a field obtaining manner, and before the associating the custom SLO resource obtained by the man-machine interaction interface with the target custom SLI resource corresponding to the custom SLO resource, the method further includes: determining a target custom SLI resource through the acquired operation information on the custom SLI resource; displaying SLO resource to-be-selected variables in the target custom SLI resource according to a display mode corresponding to a field acquisition mode in the target custom SLI resource on the man-machine interaction interface; and determining the custom SLO resource through the obtained operation information of the SLO resource to-be-selected variable in the target custom SLI resource.
In the implementation process, the parameters of the effective SLO resources corresponding to the target custom SLI resources and the corresponding acquisition modes thereof are configured in the target custom SLI resources in advance, and when the custom SLI resources are configured, a plurality of SLO resources corresponding to the target custom SLI resources are displayed on a man-machine exchange interface together with the target custom SLI resources in the form of variables to be selected, and a user can directly select the corresponding variables to complete the configuration of the custom SLO resources, so that the configuration of the custom SLO resources is greatly simplified. And the user only needs to select among a plurality of variables to be selected, so that the user threshold for carrying out SLO resource allocation is reduced.
In one embodiment, the target open source cluster is a Kubernetes cluster.
In the implementation process, the target open source cluster is set to be the Kubernetes cluster, so that the Kubernetes cluster is a cluster for realizing automation of operation tasks, most of complicated operation tasks can be executed instead of users, the burden of the users is reduced, and the error probability is reduced.
In one embodiment, the listening, by the target program, to the SLO resource includes: monitoring the SLO resource and the SLI resource through a target program; checking validity of the SLO resource and the SLI resource through the target program; and if the SLO resource is changed, generating a rule file according to the target SLI resource, wherein the rule file comprises the following steps: and when the SLO resource and the SLI resource are legal, if the SLO resource is changed, generating a rule file according to the target SLI resource.
In the implementation process, before the rule file is generated, the validity of the SLO resource and the SLI resource is checked, and the rule file is generated only when the SLO resource and the SLI resource are legal, so that the generation of an invalid rule file can be reduced, the index value calculation efficiency of the service index is improved, and meanwhile, the accuracy of the rule file is improved.
In one embodiment, if the SLO resource is changed, generating a rule file according to the target SLI resource includes: rendering the SLO resource into the target SLI resource; calculating according to the SLO resource and the target SLI resource to obtain an initial file; and calibrating the initial file, and determining the rule file according to the calibration result of the initial file.
In the implementation process, the rule file is determined after the initial file is obtained through calculation according to the SLO resource and the target SLI resource, so that the obtained rule file is accurate, and the accuracy of the rule file can be improved.
In one embodiment, the target monitoring cluster includes: prometheus cluster and Victoria metrics cluster.
In the implementation process, the service index calculation method can use a Prometheus cluster and a Victoria metrics cluster as target monitoring clusters, namely the service index calculation method can support two query grammars of PromQL and MetricsQL simultaneously, so that a target program can adapt to different cluster scales and monitoring scheme types, and the application scene of the service index calculation method is increased.
In a second aspect, embodiments of the present application further provide a service index computing system, including: a target open source cluster and a target monitoring cluster; the target open source cluster is used for storing SLO resources and SLI resources, the SLO resources are targets corresponding to service indexes, and the SLI resources are various universal templates corresponding to various service indexes; the target program monitors the SLO resource and the SLI resource and generates a rule file according to the SLO resource and the SLI resource; the target monitoring cluster is used for monitoring the change information of the rule file, and updating the calculation task in the target monitoring cluster according to the change information, wherein the calculation task is used for calculating the index value of the service index.
In the implementation process, by storing various general templates (i.e., a plurality of SLI resources) corresponding to various service indexes in the target open source cluster in advance, when the indexes are updated each time later, only the SLO resources are needed to be configured, the target program can calculate rule files according to the configured SLO resources, and then the target monitoring cluster updates the calculation tasks according to the change information of the rule files and executes the calculation tasks, so that the index values of the service indexes are obtained. In the whole process, the user only needs to configure SLO resources, so that the workload of the user is greatly reduced, and the working efficiency is improved.
In one embodiment, the SLI resource is a custom SLI resource, the SLO resource is a custom SLO resource, and the service index computing system further includes a man-machine interface; the man-machine interaction interface is used for acquiring a self-defined SLI resource and writing the self-defined SLI resource into the target open source cluster; the target open source cluster is used for storing the custom SLI resources, and the number of the custom SLI resources is multiple; the man-machine interaction interface is also used for displaying the custom SLI resource; the man-machine interaction interface is further used for associating the custom SLO resource obtained by the man-machine interaction interface with a target custom SLI resource corresponding to the custom SLO resource, and writing the custom SLO resource into the target open source cluster so as to update the SLO resource in the target open source cluster through the custom SLO resource.
In the implementation process, through setting the man-machine interaction interface, a user can interact with information in the system through the man-machine interaction interface, so that the user-defined configuration of SLI resources and SLO resources is completed, and the flexibility of SLI resources and SLO resources configuration is improved.
In order to make the above objects, features and advantages of the present application more comprehensible, embodiments accompanied with figures are described in detail below.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
SLO (Service Level Objective, chinese name: quality of service objective) and SLI (Service Level Indicator, chinese name: mechanism to measure quality of service) are important concepts in quality of service management, which are commonly used in cloud computing, distributed systems, and large IT projects.
SLI is a specific indicator of quality of service. For example, delay, error rate, throughput, etc. Whereas SLO is a target defined based on SLI.
SLO and SLI play an important role in cloud services, IT services, and large enterprise environments. SLI provides specific measurable quality of service criteria, while SLO sets targets based on these criteria. Together, the two ensure predictability and reliability of the service, helping to improve customer satisfaction, risk management, and resource optimization.
SLO and SLI provide a structured way for micro services to measure and manage performance. In the Kubernetes environment, these concepts and tools work together to ensure the health, scalability, and reliability of micro-services. By real-time monitoring, automatic expansion, fault recovery and resource optimization, SLO and SLI play a key role in the micro-services deployed by Kubernetes.
However, the inventor of the present application has found through long-term research that the existing open source tool exists: the definition of SLO and SLI are coupled, resulting in the problem that the definition of SLI cannot be multiplexed, the SLI needs to be repeatedly defined by SLO of different targets, and the SLI needs to be repeatedly defined by SLO of different services.
In view of this, the present application proposes a service index calculation method, by setting a plurality of general templates corresponding to a plurality of service indexes, one general template can be used for a plurality of SLO resources, and the burden of configuration can be greatly simplified. And by setting the Prometheus cluster and the Victoria metrics cluster, the service index calculation method can simultaneously support two query grammars of PromQL and MetricsQL, so that the target program can adapt to different cluster scales and monitoring scheme selection types, and the application scene of the service index calculation method is increased. In addition, by setting a man-machine interaction interface and interacting information in the system through the man-machine interaction interface, the user-defined configuration of SLI resources and SLO resources is further completed, and the flexibility of SLI resources and SLO resources configuration is improved.
For the convenience of understanding the present embodiment, a detailed description will be given of a service index computing system that performs a service index computing method disclosed in the embodiments of the present application.
Fig. 1 is a schematic diagram of a service index computing system according to an embodiment of the present application. Comprising the following steps: a target open source cluster 110 and a target monitoring cluster 120.
The target open source cluster 110 is provided with multiple types of interfaces such as reading, writing, programming, monitoring and the like, and interfaces are used for interfacing with external corresponding service devices. The number and types of interfaces in the target open source cluster 110 may be selected according to practical situations, which are not specifically limited in this application.
The target open source cluster 110 is used to store information such as SLO resources, SLI resources, and target programs. The SLO resource is a target corresponding to the service index, and the SLI resource is a plurality of universal templates corresponding to a plurality of service indexes.
Alternatively, the target open source cluster 110 may be one of an OpenShift cluster, an AWS EKS cluster, a Kubernetes cluster, and the like, and the target open source cluster 110 may be selected according to practical situations, which is not specifically limited in this application.
In one embodiment, the SLI resource may be a custom SLI resource and the SLO resource may be a custom SLO resource. The custom SLI resources are multiple. The target open source cluster 110 may also be used to store information such as CRD (Custom Resource Definition) definitions of SLI resources, CRD definitions of SLO resources, and CRD definitions of rule files corresponding to each time sequence database. The information stored in the target open source cluster 110 may be adjusted according to the actual situation, which is not specifically limited in this application.
The target program may monitor the SLO resource and the SLI resource through a program interface provided by the target open source cluster 110, and generate a rule file according to the SLO resource and the SLI resource.
Alternatively, the generated rule file may be stored in the target open source cluster 110.
The target monitoring cluster 120 described above may interface with the target monitoring cluster 120 of the target open source cluster 110 through a listening interface of the target open source cluster 110. The target monitoring cluster 120 is configured to monitor change information of the rule file, and update a calculation task in the target monitoring cluster 120 according to the change information, where the calculation task is configured to calculate an index value of the service index.
Alternatively, the target monitoring cluster 120 may also be used to perform a computing task periodically, or as it is updated, or in real-time, etc.
The monitoring clusters may include one or more types, and the target monitoring cluster 120 is a monitoring cluster set in the service index computing system. For example, the monitoring clusters include a Prometheus cluster and a Victoria metrics cluster. If the Prometaus cluster is set in the service indicator computing system, the target monitoring cluster 120 is the Prometaus cluster. If the victoria metrics cluster is set in the service index computing system, the target monitoring cluster 120 is the victoria metrics cluster. The type of the target monitoring cluster 120 may be selected according to practical situations, and the application is not particularly limited.
In one embodiment, the target open source cluster 110 may include an API Server sub-cluster 111 and an ETCD sub-cluster 112. The ETCD sub-cluster 112 is a high available distributed key value storage sub-cluster, and the ETCD sub-cluster 112 is configured to store information such as SLO resources, SLI resources, target programs, CRD definitions of the SLI resources, CRD definitions of the SLO resources, CRD definitions of rule files corresponding to each time sequence database, and rule files. The API Server sub-cluster 111 is used for providing various interfaces such as reading, writing, programming, and monitoring, and the API Server sub-cluster 111 is a central hub for performing data interaction and communication between each functional module in the target open source cluster 110 and between each functional module and external services. The target monitoring cluster 120 may interface with the ETCD sub-cluster 112 through the API Server sub-cluster 111, so as to monitor the change information of the rule file. The target program may interface with the ETCD sub-cluster 112 through the API Server sub-cluster 111 to perform operations such as access, interception, and calculation on information in the ETCD sub-cluster 112.
In the implementation process, by storing multiple general templates (i.e., multiple SLI resources) corresponding to multiple service indexes in the target open source cluster 110 in advance, only the SLO resources need to be configured when the indexes are updated each time later, the target program can calculate rule files according to the configured SLO resources, and the target monitoring cluster 120 updates the calculation tasks according to the change information of the rule files and executes the calculation tasks, so as to obtain the index values of the service indexes. In the whole process, the user only needs to configure SLO resources, so that the workload of the user is greatly reduced, and the working efficiency is improved.
In one possible implementation, the service indicator computing system further includes a human-machine interaction interface 130.
The human-machine interaction interface 130 herein provides an interactive interface (e.g., a user-operated interface) between the electronic device and the user or is used to display image data to a user reference. In this embodiment, the man-machine interface 130 may be a liquid crystal display or a touch display. In the case of a touch display, the touch display may be a capacitive touch screen or a resistive touch screen, etc. supporting single-point and multi-point touch operations. Supporting single-point and multi-point touch operations means that the touch display can sense touch operations simultaneously generated from one or more positions on the touch display, and the sensed touch operations are passed to the processor for calculation and processing.
The man-machine interface 130 is configured to obtain a custom SLI resource, and write the custom SLI resource into the target open source cluster 110.
It can be appreciated that, under different users or different situations of the service index computing system application, the required SLI resources and SLO resources may be different, so as to improve the accuracy of computing the index value of the service index, and adaptively configure the SLI resources according to different user requirements and different situations. In the process of configuring the SLI resource, the man-machine interaction interface 130 may be configured to obtain a custom SLI resource set by a user, and write the custom SLI resource into the target open source cluster 110 after obtaining the custom SLI resource, so as to store the custom SLI resource through the target open source cluster 110. Of course, the human-machine interface 130 may also be used to display custom SLI resources.
Likewise, the man-machine interaction interface 130 may be used to obtain custom SLO resources set by a user, and the user configures corresponding custom SLO resources through the man-machine interaction interface 130. After the human-computer interaction interface 130 obtains the custom SLO resource, the obtained custom SLO resource may be associated with the target custom SLI resource corresponding to the custom SLO resource. The target custom SLI resource can be a custom SLI resource selected by a user, or can be a custom SLI resource automatically matched by a system according to the custom SLO resource. The determination of the target custom SLI resource can be selected according to practical situations, and the application is not particularly limited.
In addition, the human-computer interaction interface 130 may also write custom SLO resources into the target open source cluster 110 to update SLO resources in the target open source cluster 110 through the custom SLO resources.
Illustratively, a user may configure one or more service index calculation generic templates of the service index calculation system according to requirements to obtain a plurality of custom SLI resources between performing index value calculation of the service index. After obtaining the plurality of custom SLI resources, the man-machine interaction interface 130 writes the custom SLI resources into the target open source cluster 110, and the target open source cluster 110 stores the custom SLI resources.
When the user needs to calculate the index value of the corresponding service index, the man-machine interaction interface 130 may display the custom SLI resources stored in the target open source cluster 110, and the user may select one or more custom SLI resources as the target custom SLI resource according to the requirement, and perform SLO resource configuration on the selected target custom SLI resource. After obtaining the SLO resource configured by the user, the man-machine interaction interface 130 associates the SLO resource with the target custom SLI resource, and writes the SLO resource into the target open source cluster 110. And after the target program monitors the change of the SLO resource, generating a rule file according to the SLO resource and the target custom SLI resource. After the target monitoring cluster 120 monitors the change information of the rule file, the computing task in the target monitoring cluster 120 is updated according to the change information, and the index value of the service index is computed according to the updated computing task.
In the implementation process, by setting the man-machine interaction interface 130, the user can interact with information in the system through the man-machine interaction interface 130, so that the user-defined configuration of SLI resources and SLO resources is completed, and the flexibility of SLI resources and SLO resources configuration is increased.
The service index calculation system in this embodiment may be used to perform each step in each method provided in the embodiments of the present application. The implementation of the service indicator calculation method is described in detail below by means of several embodiments.
Referring to fig. 2, a flowchart of a service index calculation method according to an embodiment of the present application is shown. The specific flow shown in fig. 2 will be described in detail.
In step 201, the SLO resource is monitored by the target program.
The SLO resource is a target corresponding to the service index.
The target program here may be an OpenSLO-Operator program. The target program monitors and writes SLO resources of the target open source cluster through a program interface provided by the target open source cluster.
Alternatively, the target program may monitor the SLO resource in real time, or may monitor the SLO resource at regular time. The manner in which the target program monitors the SLO resource may be adjusted according to the actual situation, which is not particularly limited in this application.
Step 202, if the SLO resource is changed, generating a rule file according to the changed SLO resource and the target SLI resource.
The SLI resources are various general templates corresponding to various service indexes. For example, SLI resources may include delay templates, error rate templates, throughput templates, and the like. The specific type of the SLI resource can be selected according to practical situations, and the application is not particularly limited.
It will be appreciated that each service indicator may have a corresponding target, i.e., each SLI resource may be configured with a corresponding SLO resource, where the SLI resource may be configured in association with the SLO resource, and each SLO resource may have a corresponding SLI resource. The general template corresponding to the changed SLO resource is the target SLI resource.
Optionally, the SLI resource may be a custom SLI resource, and the SLO resource may also be a custom SLO resource.
It should be appreciated that after the rule file is generated, the rule file stored in the target open source cluster may be updated.
And 203, monitoring change information of the rule file through the target monitoring cluster.
The monitoring clusters herein may comprise a plurality of types. Such as Prometheus clusters and Victoria metrics clusters, etc. Each service index computing system can configure a corresponding monitoring cluster according to actual demands, and the target monitoring cluster is the monitoring cluster configured in the service index computing system.
The change information of the rule file may be all information of the rule file, information changed in the rule file, or the like. The specific type of the change information can be adjusted according to actual conditions, and the application is not particularly limited.
Optionally, the target monitoring cluster may monitor the change information of the rule file in real time, or may monitor the change information of the rule file at regular time, and the mode of the target monitoring cluster for monitoring the change information of the rule file may be adjusted according to the actual situation, which is not limited in this application.
And step 204, updating the computing tasks in the target monitoring cluster according to the change information.
Wherein the calculation task is used for calculating an index value of the service index.
It should be understood that after the target monitoring cluster monitors the change information of the rule file, the target monitoring cluster may update the computing task in the target monitoring cluster according to the change information, and execute the updated computing task to obtain the index value of the updated service index.
Optionally, after the target monitoring cluster monitors the change information of the rule file, the computing task can be directly updated through the changed rule file, and corresponding information in the computing task can be updated according to the changed information in the changed rule file. The change mode of the calculation task can be adjusted according to actual conditions.
In the implementation process, by setting various universal templates corresponding to various service indexes, one universal template can be used for various SLO resources, and the configuration burden can be greatly simplified. In addition, the system can generate a corresponding rule file according to the configured SLO resource and the universal template corresponding to the SLO resource, and further update the calculation task through the rule file so as to calculate the index value of the updated service index. For a user, various general templates (namely, a plurality of SLI resources) corresponding to various service indexes are configured in advance, and when the indexes are updated every time later, the SLO resources are only required to be configured, and the system can update a calculation task according to the configured SLO resources and execute the calculation task so as to obtain the index values of the service indexes. In the whole process, the user only needs to configure SLO resources, so that the workload of the user is greatly reduced, and the working efficiency is improved.
In one possible implementation, before step 201, the method further includes: writing the custom SLI resource obtained by the man-machine interaction interface into a target open source cluster, wherein the target open source cluster is used for storing the custom SLI resource.
The custom SLI resource may be one or more. The custom SLI resource comprises SLO resource to-be-selected variables and a field acquisition mode.
The target open source cluster may be one of an OpenShift cluster, an AWS EKS cluster, a Kubernetes cluster, and the like, and the target open source cluster may be selected according to actual situations, which is not particularly limited in the present application.
It should be appreciated that the SLI resource may be custom. Before service index calculation is performed, a developer can self-define and configure universal templates corresponding to various service indexes through a human-computer interaction interface according to actual requirements. After the human-computer interaction interface obtains the configured self-defined SLI resources, the self-defined SLI resources are written into the target open source cluster, so that the self-defined SLI resources are stored through the target open source cluster.
Optionally, the custom SLI resource may be configured when the service index computing system is used for the first time, or may be configured in a process of using the service index computing system, or the configured custom SLI resource may be updated according to an actual situation. The configuration mode and time of the custom SLI resource can be adjusted according to actual conditions, and the application is not particularly limited.
For ease of understanding, specific contents of SLI resources are exemplified below by a response time template:
apiVersion: operator.openslo.dev/v1
kind: SLI
metadata:
/(/ omit)
spec:
description: interface { { parameters. Uri } } average response time
parameters:
Description: interface path
match: http_server_requests:call_seconds_sum{job="{{.job}}"}
name: uri
type: string
thresholdMetric:
metricSource:
spec:
expr:>-
rate(http_server_requests:call_seconds_sum{job="{{.Service}}",
uri="{{.Parameters.uri}}"}) /
rate(http_server_requests:call_seconds_count{job="{{.Service}}",
uri="{{.Parameters.uri}}"})
record: slo:http_server_latency:rate{{.Window}}
type: VictoriaMetrics
unit: second
In the implementation process, through setting the man-machine interaction interface, a user can intuitively check the configured SLI resources, so that the defects of the configured SLI resources are easily found, the configured SLI resources are optimized, and the accuracy of SLI resource configuration is improved. In addition, the user can configure the corresponding SLI resources in a self-defined mode according to the actual situation, and the flexibility of SLI resource configuration is improved.
In one possible implementation, before step 201, the method further includes: associating the user-defined SLO resource obtained by the man-machine interaction interface with a target user-defined SLI resource corresponding to the user-defined SLO resource; writing the custom SLO resource into a target open source cluster; and updating the SLO resources in the target open source cluster through the custom SLO resources.
It should be understood that when the user needs to calculate the index value of the service index, the human-computer interaction interface may display the custom SLI resource stored in the target open source cluster, so that the user may operate the custom SLI resource displayed in the human-computer interaction interface. After the human-computer interaction interface obtains the operation information of the user on the displayed custom SLI resource, the user-defined SLO resource for configuration can be further obtained.
Optionally, the configuration of the custom SLO resource may include, but is not limited to, the following:
mode one: after the human-computer interaction interface obtains the operation information of the user on the displayed custom SLI resources, various custom SLO resources configured in the selected custom SLI resources are displayed on the human-computer interaction interface so as to select the custom SLO resources required to be configured currently. After the user selects the corresponding custom SLO resource, the human-computer interaction interface correlates the custom SLI resource selected by the user with the selected custom SLO resource.
Mode two: and after the human-computer interaction interface acquires the operation information of the user on the displayed custom SLI resource, displaying the selected custom SLI resource on the human-computer interaction interface. The displayed custom SLI resource comprises a blank part requiring a user to configure the custom SLO resource. And configuring corresponding custom SLO resources in the blank area by the user. After the user configures the corresponding custom SLO resource, the human-computer interaction interface associates the custom SLI resource selected by the user with the configured custom SLO resource.
In the implementation process, when a user needs to perform index value calculation of a service index, the user-defined SLO resource is written into the target open source cluster after the obtained user-defined SLO resource is associated with the target user-defined SLI resource, so that the SLO resource in the target open source cluster is updated, and then the target software is triggered to generate a rule file according to the SLO resource updating condition. Because the custom SLO resource is associated with the corresponding target custom SLI resource before writing into the target open source cluster, a rule file can be directly generated through the associated target custom SLI resource and the custom SLO resource. The custom SLI resource and the custom SLO resource are not required to be matched additionally, the occurrence of the condition that the custom SLO resource is matched to an unsuitable custom SLI resource is reduced, and the accuracy of rule file generation is improved.
In one possible implementation manner, before associating the custom SLO resource obtained by the man-machine interaction interface with the target custom SLI resource corresponding to the custom SLO resource, the method further includes: determining a target custom SLI resource through the acquired operation information on the custom SLI resource; displaying SLO resource to-be-selected variables in the target custom SLI resource according to a display mode corresponding to a field acquisition mode in the target custom SLI resource on a human-computer interaction interface; and determining the custom SLO resource through the obtained operation information of the SLO resource to-be-selected variable in the target custom SLI resource.
It can be appreciated that after the user-defined SLI resources are displayed on the man-machine interface, the user can operate on the required user-defined SLI resources to select the required user-defined SLI resources from the displayed plurality of user-defined SLI resources, thereby determining the target user-defined SLI resources.
The operation information may include a selection operation, a sliding operation, a clicking operation, etc. of the displayed custom SLI resource, and the operation information may be selected according to actual situations, which is not specifically limited in the present application.
It can be appreciated that if the custom SLI resource is configured with multiple custom SLO resources applicable to the custom SLI resource in advance. When the SLO resource configuration is performed, after the target custom SLI resource is determined, the SLO resource to-be-selected variable in the target custom SLI resource can be displayed, and the user can operate the corresponding SLO resource to-be-selected variable to select the custom SLO resource which needs to be configured currently by the target custom SLI resource. The SLO resource candidate variables may be a plurality of custom SLO resources configured in advance in the custom SLI resources.
In one embodiment, when the human-computer interaction interface displays the SLO resource to-be-selected variable in the target custom SLI resource, the human-computer interaction interface may display the variable according to a display mode corresponding to a field acquisition mode configured in the target custom SLI resource.
In the implementation process, the parameters of the effective SLO resources corresponding to the target custom SLI resources and the corresponding acquisition modes of the parameters are configured in the target custom SLI resources in advance, and when the custom SLI resources are configured, various SLO resources corresponding to the target custom SLI resources are displayed on a man-machine exchange interface together with the target custom SLI resources in the form of variables to be selected, and a user can directly select the corresponding variables to complete configuration of the custom SLO resources, so that configuration of the custom SLO resources is greatly simplified. And the user only needs to select among a plurality of variables to be selected, so that the user threshold for carrying out SLO resource allocation is reduced.
In one possible implementation, the target open source cluster is a Kubernetes cluster.
The Kubernetes cluster is an open source platform for automatically deploying, expanding and managing containerized applications. It provides a container orchestration system that can help users manage the running of large-scale containerized applications. Kubernetes clusters are composed of Master nodes and multiple Node nodes. The Master node is the core of the control plane and is responsible for managing and monitoring the state of the entire cluster. Node nodes are where the application is actually running, each Node contains kubelet, kube-proxy, and container runtime components.
In the implementation process, the target open source cluster is set to be the Kubernetes cluster, so that the Kubernetes cluster is a cluster for realizing automation of operation tasks, most of complicated operation tasks can be executed instead of users, the burden of the users is reduced, and the error probability is reduced.
In one possible implementation, step 201 includes: monitoring SLO resources and SLI resources through a target program; and checking the validity of the SLO resource and the SLI resource through the target program.
The validity check of the SLO resource and SLI resource herein may be checked by a validity check function in the target program.
The validity of the SLO resource refers to whether the SLO resource meets the constraint of the basic YAML grammar and the SLO custom resource format in definition, whether the service standard formulated in the enterprise is followed in the process of formulating and delivering service, whether the SLO resource which is defined in the system currently is quoted/pointed, and the parameter setting of the SLO meets the requirement specified in the SLO resource. If the SLO resource meets the above grammar and format constraint and complies with the service standard established in the enterprise, and at the same time, the corresponding SLO resource can be found in the system and meets the parameter specification requirement of the corresponding SLI, the SLO resource is legal.
The validity of the SLI resource refers to whether the SLI resource meets the constraint of basic YAML grammar and SLI custom resource format in definition, whether the SLI resource conforms to monitoring index standards (in-enterprise monitoring standards) established in enterprises and whether the definition of parameters (parameter types, value ranges and the like) in the SLI is self-consistent. If the SLI resource meets the grammar and format constraint and conforms to the monitoring index standard formulated in the enterprise, and the definition of the parameters is self-consistent, the SLI resource is legal.
Optionally, the target program may check validity of the SLO resource when the SLO resource is changed, check validity of the SLI resource when the SLI resource is changed, check validity of the SLO resource and the SLI resource at the same time when the SLO resource is changed, and check validity of the SLO resource and the SLI resource at regular time.
Accordingly, step 202 includes: and when both the SLO resource and the SLI resource are legal, if the SLO resource is changed, generating a rule file according to the target SLI resource.
Specifically, the target program may generate a rule file according to the SLO resource, the target SLI resource, and the syntax rules set in advance.
In the implementation process, before the rule file is generated, the validity of the SLO resource and the SLI resource is checked, and the rule file is generated only when the SLO resource and the SLI resource are legal, so that the generation of an invalid rule file can be reduced, the index value calculation efficiency of the service index is improved, and meanwhile, the accuracy of the rule file is improved.
In one possible implementation, step 202 includes: rendering the SLO resource into a target SLI resource; calculating according to the SLO resource and the target SLI resource to obtain an initial file; and calibrating the initial file, and determining a rule file according to the calibration result of the initial file.
The initial file is a file directly calculated according to the SLO resource and the target SLI resource.
The rule file is a file calibrated by the initial file.
It should be understood that different target monitoring clusters may correspond to different grammars, so that the target monitoring clusters can identify the rule file to monitor the rule file. The target program can generate rule files of different types by adopting corresponding grammar according to the type of the target monitoring cluster. For example, if the target monitoring cluster is a victoria metrics cluster, then the rules file is generated using the metrics ql syntax. If the target monitoring cluster is a Prometheus cluster, a PromQL grammar is adopted to generate a rule file. After the rule file is generated, the generated rule file is written into the target open source cluster.
In the implementation process, the rule file is determined after the initial file is obtained through calculation according to the SLO resource and the target SLI resource, so that the obtained rule file is accurate, and the accuracy of the rule file can be improved.
In one possible implementation, the target monitoring cluster includes: prometheus cluster and Victoria metrics cluster.
The Prometheus cluster is a powerful monitoring platform, is an open source monitoring and early warning tool for containers and micro-services, integrates functions of acquisition, storage, inquiry, alarm and the like, has powerful PromSQL sentences, can perform very complex monitoring data aggregation calculation, and supports relational aggregation.
The victoria metrics cluster described above is a fast, efficient and scalable monitoring solution and time-series database that can be stored as a long-term remote of promethaus. It has powerful MetricsQL statement, and MetricsQL support may provide more powerful calculation function support, such as analysis functions of WITH grammar, share_gt_over_time, etc.
In the implementation process, the service index calculation method can use a Prometheus cluster and a Victoria metrics cluster as target monitoring clusters, namely the service index calculation method can support two query grammars of PromQL and MetricsQL simultaneously, so that a target program can adapt to different cluster scales and monitoring scheme types, and the application scene of the service index calculation method is increased.
Based on the same application conception, the embodiment of the present application further provides a service index calculating device corresponding to the service index calculating method, and since the principle of solving the problem by the device in the embodiment of the present application is similar to that of the foregoing embodiment of the service index calculating method, the implementation of the device in the embodiment of the present application may refer to the description in the embodiment of the foregoing method, and the repetition is omitted.
Fig. 3 is a schematic functional block diagram of a service index calculating device according to an embodiment of the present application. The respective modules in the service index calculation device in this embodiment are configured to execute the respective steps in the above-described method embodiment. The service index computing device comprises a first monitoring module 301, a generating module 302, a second monitoring module 303 and an updating module 304; wherein,
the first monitoring module 301 is configured to monitor, by using a target program, an SLO resource, where the SLO resource is a target corresponding to a service indicator.
The generating module 302 is configured to generate a rule file according to the changed SLO resource and a target SLO resource if the SLO resource is changed, where the SLO resource is a plurality of universal templates corresponding to a plurality of service indexes, and the target SLO resource is a universal template corresponding to the changed SLO resource.
The second monitoring module 303 is configured to monitor, through a target monitoring cluster, change information of the rule file.
The updating module 304 is configured to update a calculation task in the target monitoring cluster according to the change information, where the calculation task is used to calculate an index value of the service index.
In a possible implementation manner, the service index computing device further includes a writing module, configured to write the custom SLI resources obtained by the man-machine interaction interface into a target open source cluster, where the custom SLI resources are multiple, and the target open source cluster is configured to store the custom SLI resources.
In a possible implementation manner, the writing module is further configured to associate the custom SLO resource obtained by the man-machine interaction interface with a target custom SLI resource corresponding to the custom SLO resource; writing the custom SLO resource into the target open source cluster; updating the SLO resources in the target open source cluster through the custom SLO resources.
In a possible implementation manner, the writing module is specifically configured to determine a target custom SLI resource according to the obtained operation information on the custom SLI resource; displaying SLO resource to-be-selected variables in the target custom SLI resource according to a display mode corresponding to a field acquisition mode in the target custom SLI resource on the man-machine interaction interface; and determining the custom SLO resource through the obtained operation information of the SLO resource to-be-selected variable in the target custom SLI resource.
In a possible implementation manner, the first monitoring module 301 is further configured to: monitoring the SLO resource and the SLI resource through a target program; checking validity of the SLO resource and the SLI resource through the target program;
in a possible implementation, the updating module 304 is further configured to: and when the SLO resource and the SLI resource are legal, if the SLO resource is changed, generating a rule file according to the target SLI resource.
In a possible implementation manner, the generating module 302 is specifically configured to: rendering the SLO resource into the target SLI resource; calculating according to the SLO resource and the target SLI resource to obtain an initial file; and calibrating the initial file, and determining the rule file according to the calibration result of the initial file.
Furthermore, the embodiment of the present application further provides a computer readable storage medium, where a computer program is stored, where the computer program is executed by a processor to perform the steps of the service index calculation method described in the foregoing method embodiment.
The computer program product of the service index calculation method provided in the embodiment of the present application includes a computer readable storage medium storing program codes, where the instructions included in the program codes may be used to execute the steps of the service index calculation method described in the foregoing method embodiment, and specifically, reference may be made to the foregoing method embodiment, which is not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners as well. The apparatus embodiments described above are merely illustrative, for example, flow diagrams and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes. It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the same, but rather, various modifications and variations may be made by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application. It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.