Skip to content

Commit

Permalink
Merge pull request #192 from appuio/fix/default-config-apply
Browse files Browse the repository at this point in the history
Fix params.defaultConfig overwriting customisations
  • Loading branch information
DebakelOrakel authored Feb 13, 2024
2 parents c0d3e6b + e902b80 commit 696b24c
Show file tree
Hide file tree
Showing 12 changed files with 159 additions and 110 deletions.
4 changes: 2 additions & 2 deletions component/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ local customRules =
{
enableUserWorkload: params.enableUserWorkload,
} + std.mapWithKey(
function(field, value) value + params.defaultConfig,
function(field, value) params.defaultConfig + com.makeMergeable(value),
params.configs {
prometheusK8s: patchRemoteWrite(super.prometheusK8s, params.remoteWriteDefaults.cluster),
}
Expand All @@ -99,7 +99,7 @@ local customRules =
data: {
'config.yaml': std.manifestYamlDoc(
std.mapWithKey(
function(field, value) value + params.defaultConfig,
function(field, value) params.defaultConfig + com.makeMergeable(value),
params.configsUserWorkload {
prometheus: patchRemoteWrite(super.prometheus, params.remoteWriteDefaults.userWorkload),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -856,8 +856,9 @@ spec:
rules:
- alert: SYN_KubePersistentVolumeErrors
annotations:
description: The persistent volume {{ $labels.persistentvolume }} on Cluster
{{ $labels.cluster }} has status {{ $labels.phase }}.
description: The persistent volume {{ $labels.persistentvolume }} {{ with
$labels.cluster -}} on Cluster {{ . }} {{- end }} has status {{ $labels.phase
}}.
summary: PersistentVolume is having issues with provisioning.
syn_component: openshift4-monitoring
expr: |
Expand All @@ -870,8 +871,9 @@ spec:
- alert: SYN_KubePersistentVolumeFillingUp
annotations:
description: The PersistentVolume claimed by {{ $labels.persistentvolumeclaim
}} in Namespace {{ $labels.namespace }} on Cluster {{ $labels.cluster
}} is only {{ $value | humanizePercentage }} free.
}} in Namespace {{ $labels.namespace }} {{ with $labels.cluster -}}
on Cluster {{ . }} {{- end }} is only {{ $value | humanizePercentage
}} free.
runbook_url: https://github.com/openshift/runbooks/blob/master/alerts/cluster-monitoring-operator/KubePersistentVolumeFillingUp.md
summary: PersistentVolume is filling up.
syn_component: openshift4-monitoring
Expand All @@ -896,8 +898,9 @@ spec:
annotations:
description: Based on recent sampling, the PersistentVolume claimed by
{{ $labels.persistentvolumeclaim }} in Namespace {{ $labels.namespace
}} on Cluster {{ $labels.cluster }} is expected to fill up within four
days. Currently {{ $value | humanizePercentage }} is available.
}} {{ with $labels.cluster -}} on Cluster {{ . }} {{- end }} is expected
to fill up within four days. Currently {{ $value | humanizePercentage
}} is available.
runbook_url: https://github.com/openshift/runbooks/blob/master/alerts/cluster-monitoring-operator/KubePersistentVolumeFillingUp.md
summary: PersistentVolume is filling up.
syn_component: openshift4-monitoring
Expand All @@ -923,8 +926,9 @@ spec:
- alert: SYN_KubePersistentVolumeInodesFillingUp
annotations:
description: The PersistentVolume claimed by {{ $labels.persistentvolumeclaim
}} in Namespace {{ $labels.namespace }} on Cluster {{ $labels.cluster
}} only has {{ $value | humanizePercentage }} free inodes.
}} in Namespace {{ $labels.namespace }} {{ with $labels.cluster -}}
on Cluster {{ . }} {{- end }} only has {{ $value | humanizePercentage
}} free inodes.
runbook_url: https://github.com/openshift/runbooks/blob/master/alerts/cluster-monitoring-operator/KubePersistentVolumeInodesFillingUp.md
summary: PersistentVolumeInodes are filling up.
syn_component: openshift4-monitoring
Expand All @@ -949,9 +953,9 @@ spec:
annotations:
description: Based on recent sampling, the PersistentVolume claimed by
{{ $labels.persistentvolumeclaim }} in Namespace {{ $labels.namespace
}} on Cluster {{ $labels.cluster }} is expected to run out of inodes
within four days. Currently {{ $value | humanizePercentage }} of its
inodes are free.
}} {{ with $labels.cluster -}} on Cluster {{ . }} {{- end }} is expected
to run out of inodes within four days. Currently {{ $value | humanizePercentage
}} of its inodes are free.
runbook_url: https://github.com/openshift/runbooks/blob/master/alerts/cluster-monitoring-operator/KubePersistentVolumeInodesFillingUp.md
summary: PersistentVolumeInodes are filling up.
syn_component: openshift4-monitoring
Expand Down Expand Up @@ -1947,7 +1951,7 @@ spec:
syn_component: openshift4-monitoring
expr: |
(
rate(prometheus_tsdb_head_samples_appended_total{job=~"prometheus-k8s|prometheus-user-workload"}[5m]) <= 0
sum without(type) (rate(prometheus_tsdb_head_samples_appended_total{job=~"prometheus-k8s|prometheus-user-workload"}[5m])) <= 0
and
(
sum without(scrape_job) (prometheus_target_metadata_cache_entries{job=~"prometheus-k8s|prometheus-user-workload"}) > 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -856,8 +856,9 @@ spec:
rules:
- alert: SYN_KubePersistentVolumeErrors
annotations:
description: The persistent volume {{ $labels.persistentvolume }} on Cluster
{{ $labels.cluster }} has status {{ $labels.phase }}.
description: The persistent volume {{ $labels.persistentvolume }} {{ with
$labels.cluster -}} on Cluster {{ . }} {{- end }} has status {{ $labels.phase
}}.
summary: PersistentVolume is having issues with provisioning.
syn_component: openshift4-monitoring
expr: |
Expand All @@ -870,8 +871,9 @@ spec:
- alert: SYN_KubePersistentVolumeFillingUp
annotations:
description: The PersistentVolume claimed by {{ $labels.persistentvolumeclaim
}} in Namespace {{ $labels.namespace }} on Cluster {{ $labels.cluster
}} is only {{ $value | humanizePercentage }} free.
}} in Namespace {{ $labels.namespace }} {{ with $labels.cluster -}}
on Cluster {{ . }} {{- end }} is only {{ $value | humanizePercentage
}} free.
runbook_url: https://github.com/openshift/runbooks/blob/master/alerts/cluster-monitoring-operator/KubePersistentVolumeFillingUp.md
summary: PersistentVolume is filling up.
syn_component: openshift4-monitoring
Expand All @@ -896,8 +898,9 @@ spec:
annotations:
description: Based on recent sampling, the PersistentVolume claimed by
{{ $labels.persistentvolumeclaim }} in Namespace {{ $labels.namespace
}} on Cluster {{ $labels.cluster }} is expected to fill up within four
days. Currently {{ $value | humanizePercentage }} is available.
}} {{ with $labels.cluster -}} on Cluster {{ . }} {{- end }} is expected
to fill up within four days. Currently {{ $value | humanizePercentage
}} is available.
runbook_url: https://github.com/openshift/runbooks/blob/master/alerts/cluster-monitoring-operator/KubePersistentVolumeFillingUp.md
summary: PersistentVolume is filling up.
syn_component: openshift4-monitoring
Expand All @@ -923,8 +926,9 @@ spec:
- alert: SYN_KubePersistentVolumeInodesFillingUp
annotations:
description: The PersistentVolume claimed by {{ $labels.persistentvolumeclaim
}} in Namespace {{ $labels.namespace }} on Cluster {{ $labels.cluster
}} only has {{ $value | humanizePercentage }} free inodes.
}} in Namespace {{ $labels.namespace }} {{ with $labels.cluster -}}
on Cluster {{ . }} {{- end }} only has {{ $value | humanizePercentage
}} free inodes.
runbook_url: https://github.com/openshift/runbooks/blob/master/alerts/cluster-monitoring-operator/KubePersistentVolumeInodesFillingUp.md
summary: PersistentVolumeInodes are filling up.
syn_component: openshift4-monitoring
Expand All @@ -949,9 +953,9 @@ spec:
annotations:
description: Based on recent sampling, the PersistentVolume claimed by
{{ $labels.persistentvolumeclaim }} in Namespace {{ $labels.namespace
}} on Cluster {{ $labels.cluster }} is expected to run out of inodes
within four days. Currently {{ $value | humanizePercentage }} of its
inodes are free.
}} {{ with $labels.cluster -}} on Cluster {{ . }} {{- end }} is expected
to run out of inodes within four days. Currently {{ $value | humanizePercentage
}} of its inodes are free.
runbook_url: https://github.com/openshift/runbooks/blob/master/alerts/cluster-monitoring-operator/KubePersistentVolumeInodesFillingUp.md
summary: PersistentVolumeInodes are filling up.
syn_component: openshift4-monitoring
Expand Down Expand Up @@ -1947,7 +1951,7 @@ spec:
syn_component: openshift4-monitoring
expr: |
(
rate(prometheus_tsdb_head_samples_appended_total{job=~"prometheus-k8s|prometheus-user-workload"}[5m]) <= 0
sum without(type) (rate(prometheus_tsdb_head_samples_appended_total{job=~"prometheus-k8s|prometheus-user-workload"}[5m])) <= 0
and
(
sum without(scrape_job) (prometheus_target_metadata_cache_entries{job=~"prometheus-k8s|prometheus-user-workload"}) > 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -859,8 +859,9 @@ spec:
rules:
- alert: SYN_KubePersistentVolumeErrors
annotations:
description: The persistent volume {{ $labels.persistentvolume }} on Cluster
{{ $labels.cluster }} has status {{ $labels.phase }}.
description: The persistent volume {{ $labels.persistentvolume }} {{ with
$labels.cluster -}} on Cluster {{ . }} {{- end }} has status {{ $labels.phase
}}.
summary: PersistentVolume is having issues with provisioning.
syn_component: openshift4-monitoring
expr: |
Expand All @@ -873,8 +874,9 @@ spec:
- alert: SYN_KubePersistentVolumeFillingUp
annotations:
description: The PersistentVolume claimed by {{ $labels.persistentvolumeclaim
}} in Namespace {{ $labels.namespace }} on Cluster {{ $labels.cluster
}} is only {{ $value | humanizePercentage }} free.
}} in Namespace {{ $labels.namespace }} {{ with $labels.cluster -}}
on Cluster {{ . }} {{- end }} is only {{ $value | humanizePercentage
}} free.
runbook_url: https://github.com/openshift/runbooks/blob/master/alerts/cluster-monitoring-operator/KubePersistentVolumeFillingUp.md
summary: PersistentVolume is filling up.
syn_component: openshift4-monitoring
Expand All @@ -899,8 +901,9 @@ spec:
annotations:
description: Based on recent sampling, the PersistentVolume claimed by
{{ $labels.persistentvolumeclaim }} in Namespace {{ $labels.namespace
}} on Cluster {{ $labels.cluster }} is expected to fill up within four
days. Currently {{ $value | humanizePercentage }} is available.
}} {{ with $labels.cluster -}} on Cluster {{ . }} {{- end }} is expected
to fill up within four days. Currently {{ $value | humanizePercentage
}} is available.
runbook_url: https://github.com/openshift/runbooks/blob/master/alerts/cluster-monitoring-operator/KubePersistentVolumeFillingUp.md
summary: PersistentVolume is filling up.
syn_component: openshift4-monitoring
Expand All @@ -926,8 +929,9 @@ spec:
- alert: SYN_KubePersistentVolumeInodesFillingUp
annotations:
description: The PersistentVolume claimed by {{ $labels.persistentvolumeclaim
}} in Namespace {{ $labels.namespace }} on Cluster {{ $labels.cluster
}} only has {{ $value | humanizePercentage }} free inodes.
}} in Namespace {{ $labels.namespace }} {{ with $labels.cluster -}}
on Cluster {{ . }} {{- end }} only has {{ $value | humanizePercentage
}} free inodes.
runbook_url: https://github.com/openshift/runbooks/blob/master/alerts/cluster-monitoring-operator/KubePersistentVolumeInodesFillingUp.md
summary: PersistentVolumeInodes are filling up.
syn_component: openshift4-monitoring
Expand All @@ -952,9 +956,9 @@ spec:
annotations:
description: Based on recent sampling, the PersistentVolume claimed by
{{ $labels.persistentvolumeclaim }} in Namespace {{ $labels.namespace
}} on Cluster {{ $labels.cluster }} is expected to run out of inodes
within four days. Currently {{ $value | humanizePercentage }} of its
inodes are free.
}} {{ with $labels.cluster -}} on Cluster {{ . }} {{- end }} is expected
to run out of inodes within four days. Currently {{ $value | humanizePercentage
}} of its inodes are free.
runbook_url: https://github.com/openshift/runbooks/blob/master/alerts/cluster-monitoring-operator/KubePersistentVolumeInodesFillingUp.md
summary: PersistentVolumeInodes are filling up.
syn_component: openshift4-monitoring
Expand Down Expand Up @@ -1950,7 +1954,7 @@ spec:
syn_component: openshift4-monitoring
expr: |
(
rate(prometheus_tsdb_head_samples_appended_total{job=~"prometheus-k8s|prometheus-user-workload"}[5m]) <= 0
sum without(type) (rate(prometheus_tsdb_head_samples_appended_total{job=~"prometheus-k8s|prometheus-user-workload"}[5m])) <= 0
and
(
sum without(scrape_job) (prometheus_target_metadata_cache_entries{job=~"prometheus-k8s|prometheus-user-workload"}) > 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,9 @@ spec:
rules:
- alert: SYN_KubePersistentVolumeErrors
annotations:
description: The persistent volume {{ $labels.persistentvolume }} on Cluster
{{ $labels.cluster }} has status {{ $labels.phase }}.
description: The persistent volume {{ $labels.persistentvolume }} {{ with
$labels.cluster -}} on Cluster {{ . }} {{- end }} has status {{ $labels.phase
}}.
summary: PersistentVolume is having issues with provisioning.
syn_component: openshift4-monitoring
expr: |
Expand All @@ -849,8 +850,9 @@ spec:
- alert: SYN_KubePersistentVolumeFillingUp
annotations:
description: The PersistentVolume claimed by {{ $labels.persistentvolumeclaim
}} in Namespace {{ $labels.namespace }} on Cluster {{ $labels.cluster
}} is only {{ $value | humanizePercentage }} free.
}} in Namespace {{ $labels.namespace }} {{ with $labels.cluster -}}
on Cluster {{ . }} {{- end }} is only {{ $value | humanizePercentage
}} free.
runbook_url: https://github.com/openshift/runbooks/blob/master/alerts/cluster-monitoring-operator/KubePersistentVolumeFillingUp.md
summary: PersistentVolume is filling up.
syn_component: openshift4-monitoring
Expand All @@ -875,8 +877,9 @@ spec:
annotations:
description: Based on recent sampling, the PersistentVolume claimed by
{{ $labels.persistentvolumeclaim }} in Namespace {{ $labels.namespace
}} on Cluster {{ $labels.cluster }} is expected to fill up within four
days. Currently {{ $value | humanizePercentage }} is available.
}} {{ with $labels.cluster -}} on Cluster {{ . }} {{- end }} is expected
to fill up within four days. Currently {{ $value | humanizePercentage
}} is available.
runbook_url: https://github.com/openshift/runbooks/blob/master/alerts/cluster-monitoring-operator/KubePersistentVolumeFillingUp.md
summary: PersistentVolume is filling up.
syn_component: openshift4-monitoring
Expand All @@ -902,8 +905,9 @@ spec:
- alert: SYN_KubePersistentVolumeInodesFillingUp
annotations:
description: The PersistentVolume claimed by {{ $labels.persistentvolumeclaim
}} in Namespace {{ $labels.namespace }} on Cluster {{ $labels.cluster
}} only has {{ $value | humanizePercentage }} free inodes.
}} in Namespace {{ $labels.namespace }} {{ with $labels.cluster -}}
on Cluster {{ . }} {{- end }} only has {{ $value | humanizePercentage
}} free inodes.
runbook_url: https://github.com/openshift/runbooks/blob/master/alerts/cluster-monitoring-operator/KubePersistentVolumeInodesFillingUp.md
summary: PersistentVolumeInodes are filling up.
syn_component: openshift4-monitoring
Expand All @@ -928,9 +932,9 @@ spec:
annotations:
description: Based on recent sampling, the PersistentVolume claimed by
{{ $labels.persistentvolumeclaim }} in Namespace {{ $labels.namespace
}} on Cluster {{ $labels.cluster }} is expected to run out of inodes
within four days. Currently {{ $value | humanizePercentage }} of its
inodes are free.
}} {{ with $labels.cluster -}} on Cluster {{ . }} {{- end }} is expected
to run out of inodes within four days. Currently {{ $value | humanizePercentage
}} of its inodes are free.
runbook_url: https://github.com/openshift/runbooks/blob/master/alerts/cluster-monitoring-operator/KubePersistentVolumeInodesFillingUp.md
summary: PersistentVolumeInodes are filling up.
syn_component: openshift4-monitoring
Expand Down Expand Up @@ -1945,7 +1949,7 @@ spec:
syn_component: openshift4-monitoring
expr: |
(
rate(prometheus_tsdb_head_samples_appended_total{job=~"prometheus-k8s|prometheus-user-workload"}[5m]) <= 0
sum without(type) (rate(prometheus_tsdb_head_samples_appended_total{job=~"prometheus-k8s|prometheus-user-workload"}[5m])) <= 0
and
(
sum without(scrape_job) (prometheus_target_metadata_cache_entries{job=~"prometheus-k8s|prometheus-user-workload"}) > 0
Expand Down
Loading

0 comments on commit 696b24c

Please sign in to comment.