Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eg-ayoub committed Aug 24, 2023
1 parent 934d49b commit 9961618
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## Release 125.0.6 (In development)

### Additions
### Enhancements

- Add alert configuration for KubeJobNotCompleted alert
- Make `KubeJobNotCompleted` alert time configurable
(PR[4128](https://github.com/scality/metalk8s/pull/4128))

## Release 125.0.5
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!jinja | metalk8s_kubernetes

{%- from "metalk8s/repo/macro.sls" import build_image_name with context %}
{%- set prometheus_defaults = salt.slsutil.renderer(
'salt://metalk8s/addons/prometheus-operator/config/prometheus.yaml',
Expand All @@ -11,20 +13,29 @@
{%- set rules = prometheus.get('spec', {}).get('rules', {}) %}

{%- raw %}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
labels:
app.kubernetes.io/part-of: metalk8s
metalk8s.scality.com/monitor: ''
release: prometheus-operator
name: metalk8s-kube-apps.rules
namespace: metalk8s-monitoring
spec:
groups:
- name: kubernetes-apps
rules:
- alert: KubeJobNotCompleted
annotations:
description: Job {{ $labels.namespace }}/{{ $labels.job_name }} is taking
more than {% endraw %} rules.kube_apps.kube_job_not_completed.warning.hours {% raw %} hours to complete.
more than {% endraw %} {{ rules.kube_apps.kube_job_not_completed.warning.hours }} {% raw %} hours to complete.
runbook_url: https://runbooks.prometheus-operator.dev/runbooks/kubernetes/kubejobnotcompleted
summary: Job did not complete in time
expr: |-
time() - max by(namespace, job_name, cluster) (kube_job_status_start_time{job="kube-state-metrics", namespace=~".*"}
and
kube_job_status_active{job="kube-state-metrics", namespace=~".*"} > 0) > {% endraw %} rules.kube_apps.kube_job_not_completed.warning.hours {% raw %}*60*60
kube_job_status_active{job="kube-state-metrics", namespace=~".*"} > 0) > {% endraw %} {{ rules.kube_apps.kube_job_not_completed.warning.hours }} {% raw %}*60*60
labels:
severity: warning
{%- endraw %}

0 comments on commit 9961618

Please sign in to comment.