<p>I created alert rules for pod memory utilisation, in Prometheus. Alerts are showing perfectly on my slack channel, but it do not contain the name of the pod so that difficult to understand which pod is having the issue . </p>

<p>It is Just showing <code>[FIRING:35] (POD_MEMORY_HIGH_UTILIZATION default/k8s warning)</code>. But when I look in to the "Alert" section in the Prometheus UI, I can see the fired rules with its pod name. Can anyone help?</p>

<p>My alert notification template is as follows: </p>

<pre><code>alertname: TargetDown
      alertname: POD_CPU_HIGH_UTILIZATION
      alertname:  POD_MEMORY_HIGH_UTILIZATION
receivers:

    - name: 'slack-notifications'

      slack_configs:

      - channel: '#devops'
        title: '{{ .CommonAnnotations.summary }}'
        text: '{{ .CommonAnnotations.description }}'

        send_resolved: true
</code></pre>

<p>I have added the option <code>title: '{{ .CommonAnnotations.summary }}' text: '{{ .CommonAnnotations.description }}'</code> in my alert notification template and now it is showing the description. My description is <code>description: pod {{$labels.pod}} is using high memory</code>. But only showing <code>is using high memory</code>. Not specifying the pod name</p>

<p>As mentioned in the <a href="https://engineering.infinityworks.com/slack-prometheus-alertmanager/" rel="nofollow noreferrer">article</a>, you should check the alert rules and update them if necessary. See an example:</p>

<pre><code>ALERT ElasticacheCPUUtilisation
  IF aws_elasticache_cpuutilization_average &gt; 80
  FOR 10m
  LABELS { severity = "warning" }
    ANNOTATIONS {
    summary = "ElastiCache CPU Utilisation Alert",
    description = "Elasticache CPU Usage has breach the threshold set (80%) on cluster id {{ $labels.cache_cluster_id }}, now at {{ $value }}%",
    runbook = "https://mywiki.com/ElasticacheCPUUtilisation",
  }
</code></pre>

<p>To provide external URL for your prometheus GUI, apply CLI argument to your prometheus server and restart it:</p>

<pre><code>-web.external-url=http://externally-available-url:9090/
</code></pre>

<p>After that, you can put the values into your alertmanager configuration. See an example:</p>

<pre><code>receivers:
  - name: 'iw-team-slack'
    slack_configs:
    - channel: alert-events
      send_resolved: true
      api_url: https://hooks.slack.com/services/&lt;your_token&gt;
      title: '[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] Monitoring Event Notification'
      text: &gt;-
        {{ range .Alerts }}
           *Alert:* {{ .Annotations.summary }} - `{{ .Labels.severity }}`
          *Description:* {{ .Annotations.description }}
          *Graph:* &lt;{{ .GeneratorURL }}|:chart_with_upwards_trend:&gt; *Runbook:* &lt;{{ .Annotations.runbook }}|:spiral_note_pad:&gt;
          *Details:*
          {{ range .Labels.SortedPairs }} • *{{ .Name }}:* `{{ .Value }}`
          {{ end }}
        {{ end }}
</code></pre>
