Skip to content

Commit

Permalink
make label name consistently use snake_case
Browse files Browse the repository at this point in the history
Signed-off-by: Rajat Jindal <[email protected]>
  • Loading branch information
rajatjindal committed Feb 28, 2024
1 parent 2a970a6 commit c042b5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions internal/controller/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ var (
spinOperatorSpinAppExecutorInfo = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "spin_operator_spinapp_executor_info",
Help: "info about spinapp executor labeled by name, namespace, create_deployment and runtimeclass",
Help: "info about spinapp executor labeled by name, namespace, create_deployment and runtime_class_name",
},
[]string{
"name",
"namespace",
"create_deployment",
"runtimeclass",
"runtime_class_name",
},
)
)
12 changes: 6 additions & 6 deletions internal/controller/spinappexecutor_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,17 @@ func (r *SpinAppExecutorReconciler) Reconcile(ctx context.Context, req ctrl.Requ
return ctrl.Result{}, client.IgnoreNotFound(err)
}

runtimeClass := ""
runtimeClassName := ""
if executor.Spec.DeploymentConfig != nil {
runtimeClass = executor.Spec.DeploymentConfig.RuntimeClassName
runtimeClassName = executor.Spec.DeploymentConfig.RuntimeClassName
}

// record spin_operator_spinapp_executor_info metric
spinOperatorSpinAppExecutorInfo.With(prometheus.Labels{
"name": executor.Name,
"namespace": executor.Namespace,
"create_deployment": fmt.Sprintf("%t", executor.Spec.CreateDeployment),
"runtimeclass": runtimeClass,
"name": executor.Name,
"namespace": executor.Namespace,
"create_deployment": fmt.Sprintf("%t", executor.Spec.CreateDeployment),
"runtime_class_name": runtimeClassName,
}).Set(1)

// Make sure the finalizer is present
Expand Down

0 comments on commit c042b5a

Please sign in to comment.