Amazon SNS remove labels from alert

11 views
Skip to first unread message

SysAdmin EM

unread,
Jun 9, 2023, 8:50:40 AM6/9/23
to promethe...@googlegroups.com
Hi all, I have configured Alertmanager to send alerts to Amazon SNS, everything is working correctly but I see a lot of information in the alert that arrives. I have read the documentation but I have not understood how to resolve it.
The alert sends the following information.

Alerts Firing:
Labels:
 - alertname = HpaMaxedOut
 - app_kubernetes_io_component = metrics
 - app_kubernetes_io_instance = kube-state-metrics
 - app_kubernetes_io_managed_by = Helm
 - app_kubernetes_io_name = kube-state-metrics
 - app_kubernetes_io_part_of = kube-state-metrics
 - app_kubernetes_io_version = 2.7.0
 - cluster = test-dev
 - helm_sh_chart = kube-state-metrics-4.29.0
 - horizontalpodautoscaler = apache-hpa
 - instance = 10.x.x.x:8080
 - job = kubernetes-service-endpoints
 - namespace = test-apache
 - node = ip-10-x-x-x.ec2.internal
 - service = kube-state-metrics
 - severity = critical
Annotations:
 - description = The maximum number of desired Pods has been hit
  VALUE = 2
  CLUSTER = test-dev
 HPA = apache-hpa
 - summary = Kubernetes HPA scale capability (instance 10.x.x.x:8080)
Source: /graph?g0.expr=kube_horizontalpodautoscaler_status_desired_replicas+%3E%3D+kube_horizontalpodautoscaler_spec_max_replicas&g0.tab=1

I would like to put together something simpler without so much information, for example.
- alertname = HpaMaxedOut
VALUE = 2
CLUSTER = test-dev
- description = The maximum number of desired Pods has been hit
- summary = Kubernetes HPA scale capability (instance 10.x.x.x:8080)

Here my config:

    groups:
      - name: HpaMaxedOut
        rules:
        - alert: DeploymentReplicasLimitReached
          expr: kube_horizontalpodautoscaler_status_desired_replicas >= kube_horizontalpodautoscaler_spec_max_replicas
          for: 1m
          labels:
            severity: critical
          annotations:
            summary: Kubernetes HPA scale capability (instance {{ $labels.instance }})
            description: "The maximum number of desired Pods has been hit\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}" Any helps?



Reply all
Reply to author
Forward
0 new messages