Skip to content

Commit

Permalink
Don't prepend service name to generic alerts
Browse files Browse the repository at this point in the history
Before this commit, the logic would prepend the name of the container
to the alertname. The container name is used internally to determine
how to gather the needed metrics. As the container name may not be same
as the name of the service, this could be confusing.

enterach alert contains all the necessary information about the affected
service in the description. That makes prepending the name redundant.
  • Loading branch information
Kidswiss committed Jun 5, 2024
1 parent b37fc5a commit e1b4bda
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/comp-functions/functions/common/nonsla/alerting.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var (

pvFillUp: func(name, namespace string) promV1.Rule {
return promV1.Rule{
Alert: name + "PersistentVolumeFillingUp",
Alert: "PersistentVolumeFillingUp",
Annotations: map[string]string{
"description": "The volume claimed by the instance {{ $labels.name }} in namespace {{ $labels.label_appcat_vshn_io_claim_namespace }} is only {{ $value | humanizePercentage }} free.",
"runbook_url": "https://runbooks.prometheus-operator.dev/runbooks/kubernetes/kubepersistentvolumefillingup",
Expand All @@ -52,7 +52,7 @@ var (
},
pvExpectedFillUp: func(name, namespace string) promV1.Rule {
return promV1.Rule{
Alert: name + "PersistentVolumeExpectedToFillUp",
Alert: "PersistentVolumeExpectedToFillUp",
Annotations: map[string]string{
"description": "Based on recent sampling, the volume claimed by the instance {{ $labels.name }} in namespace {{ $labels.label_appcat_vshn_io_claim_namespace }} is expected to fill up within four days. Currently {{ $value | humanizePercentage }} is available.",
"runbook_url": "https://runbooks.prometheus-operator.dev/runbooks/kubernetes/kubepersistentvolumefillingup",
Expand All @@ -71,7 +71,7 @@ var (
},
memCritical: func(name, namespace string) promV1.Rule {
return promV1.Rule{
Alert: name + "MemoryCritical",
Alert: "MemoryCritical",
Annotations: map[string]string{
"description": "The memory claimed by the instance {{ $labels.name }} in namespace {{ $labels.label_appcat_vshn_io_claim_namespace }} has been over 85% for 2 hours.\n Please reduce the load of this instance, or increase the memory.",
"runbook_url": "https://hub.syn.tools/appcat/runbooks/vshn-generic.html#MemoryCritical",
Expand Down

0 comments on commit e1b4bda

Please sign in to comment.