github.com/oam-dev/kubevela@v1.9.11/pkg/monitor/metrics/multicluster.go (about) 1 /* 2 Copyright 2022 The KubeVela Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package metrics 18 19 import "github.com/prometheus/client_golang/prometheus" 20 21 var ( 22 // ClusterIsConnectedGauge report if the cluster is connected 23 ClusterIsConnectedGauge = prometheus.NewGaugeVec(prometheus.GaugeOpts{ 24 Name: "cluster_isconnected", 25 Help: "if cluster is connected.", 26 }, []string{"cluster"}) 27 28 // ClusterWorkerNumberGauge report the number of WorkerNumber in cluster 29 ClusterWorkerNumberGauge = prometheus.NewGaugeVec(prometheus.GaugeOpts{ 30 Name: "cluster_worker_node_number", 31 Help: "cluster worker node number.", 32 ConstLabels: prometheus.Labels{}, 33 }, []string{"cluster"}) 34 35 // ClusterMasterNumberGauge report the number of MasterNumber in cluster 36 ClusterMasterNumberGauge = prometheus.NewGaugeVec(prometheus.GaugeOpts{ 37 Name: "cluster_master_node_number", 38 Help: "cluster master node number.", 39 ConstLabels: prometheus.Labels{}, 40 }, []string{"cluster"}) 41 42 // ClusterMemoryCapacityGauge report the number of MemoryCapacity in cluster 43 ClusterMemoryCapacityGauge = prometheus.NewGaugeVec(prometheus.GaugeOpts{ 44 Name: "cluster_memory_capacity", 45 Help: "cluster memory capacity number.", 46 ConstLabels: prometheus.Labels{}, 47 }, []string{"cluster"}) 48 49 // ClusterCPUCapacityGauge report the number of CPUCapacity in cluster 50 ClusterCPUCapacityGauge = prometheus.NewGaugeVec(prometheus.GaugeOpts{ 51 Name: "cluster_cpu_capacity", 52 Help: "cluster cpu capacity number.", 53 ConstLabels: prometheus.Labels{}, 54 }, []string{"cluster"}) 55 56 // ClusterPodCapacityGauge report the number of PodCapacity in cluster 57 ClusterPodCapacityGauge = prometheus.NewGaugeVec(prometheus.GaugeOpts{ 58 Name: "cluster_pod_capacity", 59 Help: "cluster pod capacity number.", 60 ConstLabels: prometheus.Labels{}, 61 }, []string{"cluster"}) 62 63 // ClusterMemoryAllocatableGauge report the number of MemoryAllocatable in cluster 64 ClusterMemoryAllocatableGauge = prometheus.NewGaugeVec(prometheus.GaugeOpts{ 65 Name: "cluster_memory_allocatable", 66 Help: "cluster memory allocatable number.", 67 ConstLabels: prometheus.Labels{}, 68 }, []string{"cluster"}) 69 70 // ClusterCPUAllocatableGauge report the number of CPUAllocatable in cluster 71 ClusterCPUAllocatableGauge = prometheus.NewGaugeVec(prometheus.GaugeOpts{ 72 Name: "cluster_cpu_allocatable", 73 Help: "cluster cpu allocatable number.", 74 ConstLabels: prometheus.Labels{}, 75 }, []string{"cluster"}) 76 77 // ClusterPodAllocatableGauge report the number of PodAllocatable in cluster 78 ClusterPodAllocatableGauge = prometheus.NewGaugeVec(prometheus.GaugeOpts{ 79 Name: "cluster_pod_allocatable", 80 Help: "cluster pod allocatable number.", 81 ConstLabels: prometheus.Labels{}, 82 }, []string{"cluster"}) 83 84 // ClusterMemoryUsageGauge report the number of MemoryUsage in cluster 85 ClusterMemoryUsageGauge = prometheus.NewGaugeVec(prometheus.GaugeOpts{ 86 Name: "cluster_memory_usage", 87 Help: "cluster memory usage number.", 88 ConstLabels: prometheus.Labels{}, 89 }, []string{"cluster"}) 90 91 // ClusterCPUUsageGauge report the number of CPUUsage in cluster 92 ClusterCPUUsageGauge = prometheus.NewGaugeVec(prometheus.GaugeOpts{ 93 Name: "cluster_cpu_usage", 94 Help: "cluster cpu usage number.", 95 ConstLabels: prometheus.Labels{}, 96 }, []string{"cluster"}) 97 )