Add metrics of RunnerDeployment and HRA (#408)

* Add metrics of RunnerDeployment and HRA

* Use kube-state-metrics-style label names
This commit is contained in:
Hidetake Iwata
2021-03-19 16:14:02 +09:00
committed by GitHub
parent f6ab66c55b
commit 3a0332dfdc
5 changed files with 126 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/summerwind/actions-runner-controller/api/v1alpha1"
"github.com/summerwind/actions-runner-controller/controllers/metrics"
)
const (
@@ -77,6 +78,8 @@ func (r *RunnerDeploymentReconciler) Reconcile(req ctrl.Request) (ctrl.Result, e
return ctrl.Result{}, nil
}
metrics.SetRunnerDeployment(rd)
var myRunnerReplicaSetList v1alpha1.RunnerReplicaSetList
if err := r.List(ctx, &myRunnerReplicaSetList, client.InNamespace(req.Namespace), client.MatchingFields{runnerSetOwnerKey: req.Name}); err != nil {
return ctrl.Result{}, err