1- package controller
1+ package metrics
22
33import (
44 "fmt"
@@ -28,7 +28,7 @@ var klusterInfo = prometheus.NewGaugeVec(
2828 Name : "kluster_info" ,
2929 Help : "detailed information on a kluster" ,
3030 },
31- []string {"kluster_namespace" ,"kluster_name" ,"kluster_version" ,"creator" ,"account" ,"project_id" },
31+ []string {"kluster_namespace" , "kluster_name" , "kluster_version" , "creator" , "account" , "project_id" },
3232)
3333
3434var klusterStatusPhase = prometheus .NewGaugeVec (
@@ -58,14 +58,14 @@ var nodePoolStatus = prometheus.NewGaugeVec(
5858 []string {"kluster_id" , "node_pool" , "status" },
5959)
6060
61- func setMetricKlusterInfo (namespace , name , version , projectID string , annotations , labels map [string ]string ) {
61+ func SetMetricKlusterInfo (namespace , name , version , projectID string , annotations , labels map [string ]string ) {
6262 promLabels := prometheus.Labels {
6363 "kluster_namespace" : namespace ,
64- "kluster_name" : name ,
65- "kluster_version" : version ,
66- "creator" : getCreatorFromAnnotations (annotations ),
67- "account" : getAccountFromLabels (labels ),
68- "project_id" : projectID ,
64+ "kluster_name" : name ,
65+ "kluster_version" : version ,
66+ "creator" : getCreatorFromAnnotations (annotations ),
67+ "account" : getAccountFromLabels (labels ),
68+ "project_id" : projectID ,
6969 }
7070 klusterInfo .With (promLabels ).Set (1 )
7171}
@@ -77,7 +77,7 @@ kubernikus_kluster_status_phase{"kluster_id"="<id>","phase"="running"} 0
7777kubernikus_kluster_status_phase{"kluster_id"="<id>","phase"="pending"} 0
7878kubernikus_kluster_status_phase{"kluster_id"="<id>","phase"="terminating"} 0
7979*/
80- func setMetricKlusterStatusPhase (klusterName string , klusterPhase models.KlusterPhase ) {
80+ func SetMetricKlusterStatusPhase (klusterName string , klusterPhase models.KlusterPhase ) {
8181 // Set current phase to 1, others to 0
8282 for _ , phase := range klusterPhases {
8383 labels := prometheus.Labels {
@@ -147,6 +147,8 @@ func init() {
147147 klusterStatusPhase ,
148148 nodePoolSize ,
149149 nodePoolStatus ,
150+ KlusterReconcilicationCount ,
151+ KlusterReconciliationLatency ,
150152 )
151153}
152154
0 commit comments