Skip to content

Commit

Permalink
fix bugs introduced by double quote
Browse files Browse the repository at this point in the history
  • Loading branch information
asiyani committed Jan 16, 2025
1 parent f7900cf commit ff029eb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions common/stock/namespace_sync.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ groups:
action: "Check the web UI / logs for errors."
link: https://argocd-system.$ENVIRONMENT.$PROVIDER.uw.systems/applications/{{$labels.namespace}}/{{$labels.name}}
- alert: KubeApplierErrors
expr: '(kube_applier_last_run_success != 1) * on (namespace) group_left(team) uw_namespace_oncall_team'
expr: "(kube_applier_last_run_success != 1) * on (namespace) group_left(team) uw_namespace_oncall_team"
for: 1h10m
labels:
alerttype: stock
alertgroup: namespace_sync
annotations:
summary: "kube-applier encountered errors while applying {{ $labels.namespace }}"
impact: 'Some manifest won't be automatically deployed.'
impact: "Some manifest won't be automatically deployed."
action: "Check the web UI / logs for errors."
link: https://kube-applier-system.$ENVIRONMENT.$PROVIDER.uw.systems/
13 changes: 7 additions & 6 deletions common/stock/timezone-bst.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ groups:
# 3. Oct, days till last Sunday
# 4. Oct, till 01:00 GMT & March, from 01:00 GMT
- record: utility:is_summer_time_bst
expr: '(vector(1) and (month() > 3 and month() < 10))'
expr: |
(vector(1) and (month() > 3 and month() < 10))
or
(vector(1) and (month() == 3 and (day_of_month() - day_of_week()) >= 25) and absent((day_of_month() >= 25) and (day_of_week() == 0)))
or
Expand All @@ -25,12 +26,12 @@ groups:
or
vector(0)
- record: utility:time_bst
expr: 'time() + 3600 * utility:is_summer_time_bst'
expr: "time() + 3600 * utility:is_summer_time_bst"
- record: utility:hour_bst
expr: 'hour(utility:time_bst)'
expr: "hour(utility:time_bst)"
- record: utility:minute_bst
expr: 'minute(utility:time_bst)'
expr: "minute(utility:time_bst)"
- record: utility:day_of_week_bst
expr: 'day_of_week(utility:time_bst)'
expr: "day_of_week(utility:time_bst)"
- record: utility:is_weekday_bst
expr: '(vector(1) and (utility:day_of_week_bst > 0) and (utility:day_of_week_bst < 6)) or vector(0)'
expr: "(vector(1) and (utility:day_of_week_bst > 0) and (utility:day_of_week_bst < 6)) or vector(0)"
14 changes: 8 additions & 6 deletions kube-applier/kube-applier.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ groups:
team: infra
annotations:
summary: "kube-applier has not been able to sync the git repository in the last hour"
impact: 'Recent changes have not been applied.'
impact: "Recent changes have not been applied."
- alert: KubeApplierErrors
expr: 'kube_applier_last_run_success * on(namespace) group_left kube_namespace_labels{label_uw_systems_owner="system"} != 1'
for: 1h10m
labels:
team: infra
annotations:
summary: "kube-applier encountered errors while applying {{ $labels.namespace }}"
impact: 'Some manifest won't be automatically deployed.'
impact: "Some manifest won't be automatically deployed."
- alert: KubeApplierKubectlKilled
expr:
sum(rate(kube_applier_kubectl_exit_code_count{exit_code="-1"}[5m]))
Expand All @@ -30,9 +30,10 @@ groups:
annotations:
description: "kubectl is returning an exit code of -1 which indicates it was killed, probably by the OOM killer"
summary: "kube-applier: kubectl is being killed in {{ $labels.namespace }}"
impact: 'namespaces may fail to apply'
impact: "namespaces may fail to apply"
- alert: KubeApplierAutoApplyIsDisabled
expr: 'kube_applier_waybill_spec_auto_apply'
expr: |
kube_applier_waybill_spec_auto_apply
* on(namespace) group_left kube_namespace_labels{label_uw_systems_owner="system"} == 0
for: 1h
labels:
Expand All @@ -52,7 +53,8 @@ groups:
description: "to check status: `kubectl -n {{ $labels.namespace }} describe waybill`"
summary: "kube-applier running in dry run mode in {{ $labels.namespace }} for 1 hr"
- alert: KubeApplierRunIsLate
expr: 'kube_applier_waybill_spec_auto_apply *'
expr: |
kube_applier_waybill_spec_auto_apply *
time() - kube_applier_last_run_timestamp_seconds - 2*kube_applier_waybill_spec_run_interval
* on(namespace) group_left kube_namespace_labels{label_uw_systems_owner="system"} > 0
for: 15m
Expand All @@ -64,4 +66,4 @@ groups:
run should finish roughly every hour, so this may indicate that kube-applier
is hung, hasn't initiated a new run or is taking much longer than expected to finish.
summary: "kube-applier: last run in {{ $labels.namespace }} is too old"
impact: 'Some of the latest changes may not have been applied'
impact: "Some of the latest changes may not have been applied"

0 comments on commit ff029eb

Please sign in to comment.