Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
Signed-off-by: Will Kutler <wkutler@redhat.com>
  • Loading branch information
willkutler committed Dec 6, 2022
1 parent 34dbc4a commit 26039a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions controllers/configurationpolicy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ func (r *ConfigurationPolicyReconciler) handleObjectTemplates(plc policyv1.Confi
if len(plc.OwnerReferences) > 0 {
parent = plc.OwnerReferences[0].Name
}

policyUserErrorsCounter.WithLabelValues(parent, plc.GetName(), "invalid-template").Add(1)

return
Expand Down Expand Up @@ -1638,6 +1639,7 @@ func (r *ConfigurationPolicyReconciler) getMapping(
if len(policy.OwnerReferences) > 0 {
parent = policy.OwnerReferences[0].Name
}

policyUserErrorsCounter.WithLabelValues(parent, policy.GetName(), "no-object-CRD").Add(1)
}

Expand Down Expand Up @@ -2465,6 +2467,7 @@ func (r *ConfigurationPolicyReconciler) addForUpdate(policy *policyv1.Configurat
if len(policy.OwnerReferences) > 0 {
parent = policy.OwnerReferences[0].Name
}

policySystemErrorsCounter.WithLabelValues(parent, policy.GetName(), "status-update-failed").Add(1)
}
}
Expand Down
4 changes: 2 additions & 2 deletions controllers/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var (
)
policyUserErrorsCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "policy_user_errors",
Name: "policy_user_errors_total",
Help: "The number of user errors encountered while processing policies",
},
[]string{
Expand All @@ -78,7 +78,7 @@ var (
)
policySystemErrorsCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "policy_system_errors",
Name: "policy_system_errors_total",
Help: "The number of system errors encountered while processing policies",
},
[]string{
Expand Down

0 comments on commit 26039a8

Please sign in to comment.