<commit_before>groups:
- name: oomkill.alerts
  rules:
  - alert: PodOOMKilled
    expr: sum(changes(klog_pod_oomkill[24h]) > 0 or ((klog_pod_oomkill == 1) unless (klog_pod_oomkill offset 24h == 1))) by (namespace, pod_name)
    for: 5m
    labels:
      tier: {{ required ".Values.tier missing" .Values.tier }}
      service: resources
      severity: info
      context: memory
      meta: "{{`{{ $labels.namespace }}`}}/{{`{{ $labels.pod_name }}`}}"
    annotations:
      summary: Pod was oomkilled recently
      description: The pod {{`{{ $labels.namespace }}`}}/{{`{{ $labels.pod_name }}`}} was hit at least once by the oom killer within 24h

  - alert: PodConstantlyOOMKilled
    expr: sum(changes(klog_pod_oomkill[30m]) ) by (namespace, pod_name) > 2
    for: 5m
    labels:
      tier: {{ required ".Values.tier missing" .Values.tier }}
      service: resources
      severity: warning
      context: memory
      meta: "{{`{{ $labels.namespace }}`}}/{{`{{ $labels.pod_name }}`}}"
    annotations:
      summary: Pod was oomkilled more than 2 times in 30 minutes
      description: The pod {{`{{ $labels.namespace }}`}}/{{`{{ $labels.pod_name }}`}} killed several times in short succession. This could be due to wrong resource limits.

  - alert: PodOOMExceedingLimits
    expr: max(predict_linear(container_memory_working_set_bytes{pod_name=~".+"}[1h], 8 * 3600)) by (container_name, pod_name, namespace)  >  max(label_replace(label_replace(kube_pod_container_resource_limits_memory_bytes{pod=~".+"}, "pod_name", "$1", "pod", "(.*)"), "container_name", "$1", "container", "(.*)")) by (container_name, pod_name, namespace)
    for: 5m
    labels:
      tier: {{ required ".Values.tier missing" .Values.tier }}
      service: resources
      severity: info
      context: memory
      meta: "{{`{{ $labels.namespace }}`}}/{{`{{ $labels.pod_name }}`}}"
    annotations:
      summary: Pod will likely exceed memory limits in 8h
      description: The pod {{`{{ $labels.namespace }}`}}/{{`{{ $labels.pod_name }}`}} will exceed its memory limit in 8h.<commit_msg>Fix alert wording<commit_after>groups:
- name: oomkill.alerts
  rules:
  - alert: PodOOMKilled
    expr: sum(changes(klog_pod_oomkill[24h]) > 0 or ((klog_pod_oomkill == 1) unless (klog_pod_oomkill offset 24h == 1))) by (namespace, pod_name)
    for: 5m
    labels:
      tier: {{ required ".Values.tier missing" .Values.tier }}
      service: resources
      severity: info
      context: memory
      meta: "{{`{{ $labels.namespace }}`}}/{{`{{ $labels.pod_name }}`}}"
    annotations:
      summary: Pod was oomkilled recently
      description: The pod {{`{{ $labels.namespace }}`}}/{{`{{ $labels.pod_name }}`}} was hit at least once by the oom killer within 24h

  - alert: PodConstantlyOOMKilled
    expr: sum(changes(klog_pod_oomkill[30m]) ) by (namespace, pod_name) > 2
    for: 5m
    labels:
      tier: {{ required ".Values.tier missing" .Values.tier }}
      service: resources
      severity: warning
      context: memory
      meta: "{{`{{ $labels.namespace }}`}}/{{`{{ $labels.pod_name }}`}}"
    annotations:
      summary: Pod was oomkilled more than 2 times in 30 minutes
      description: The pod {{`{{ $labels.namespace }}`}}/{{`{{ $labels.pod_name }}`}} killed several times in short succession. This could be due to wrong resource limits.

  - alert: PodOOMExceedingLimits
    expr: max(predict_linear(container_memory_working_set_bytes{pod_name=~".+"}[1h], 8 * 3600)) by (container_name, pod_name, namespace)  >  max(label_replace(label_replace(kube_pod_container_resource_limits_memory_bytes{pod=~".+"}, "pod_name", "$1", "pod", "(.*)"), "container_name", "$1", "container", "(.*)")) by (container_name, pod_name, namespace)
    for: 5m
    labels:
      tier: {{ required ".Values.tier missing" .Values.tier }}
      service: resources
      severity: info
      context: memory
      meta: "{{`{{ $labels.namespace }}`}}/{{`{{ $labels.pod_name }}`}}/{{`{{ $labels.container_name }}`}}"
    annotations:
      summary: Pod will likely exceed memory limits in 8h
      description: The {{`{{ $labels.container_name }}`}} container of pod {{`{{ $labels.namespace }}`}}/{{`{{ $labels.pod_name }}`}} will exceed its memory limit in 8h.
{'fraction_non_alphanumeric': 0.1663905325443787, 'fraction_numerical': 0.013254437869822486, 'mean_word_length': 3.7429854096520763, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2016919', 'n_tokens_mistral': 1424, 'n_tokens_neox': 1341, 'n_words': 355}