Skip to content

Commit

Permalink
Merge pull request #194 from appuio/silence-duration
Browse files Browse the repository at this point in the history
Expire silences after one day instead of one year
  • Loading branch information
haasad authored Mar 28, 2024
2 parents 3225f0f + b70457c commit 735dbbb
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion component/scripts/silence.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ while IFS= read -r silence; do
body=$(printf %s "$silence" | \
jq \
--arg startsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '-1 min')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 year')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 day')" \
--arg createdBy "Kubernetes object \`cronjob/silence\` in the monitoring namespace" \
'.startsAt = $startsAt | .endsAt = $endsAt | .createdBy = $createdBy'
)
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/references/parameters.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ default::
Contains the list of silences to be applied.
The key is used as the comment of the silence and the value is a dictionary which is passed to Alertmanager.

Silences removed from the hierarchy stay active in Alertmanager for up to a year until they expire.
Silences removed from the hierarchy stay active in Alertmanager for up to 24h until they expire.

Silences all non-SYN alerts by default.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data:
body=$(printf %s "$silence" | \
jq \
--arg startsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '-1 min')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 year')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 day')" \
--arg createdBy "Kubernetes object \`cronjob/silence\` in the monitoring namespace" \
'.startsAt = $startsAt | .endsAt = $endsAt | .createdBy = $createdBy'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data:
body=$(printf %s "$silence" | \
jq \
--arg startsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '-1 min')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 year')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 day')" \
--arg createdBy "Kubernetes object \`cronjob/silence\` in the monitoring namespace" \
'.startsAt = $startsAt | .endsAt = $endsAt | .createdBy = $createdBy'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data:
body=$(printf %s "$silence" | \
jq \
--arg startsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '-1 min')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 year')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 day')" \
--arg createdBy "Kubernetes object \`cronjob/silence\` in the monitoring namespace" \
'.startsAt = $startsAt | .endsAt = $endsAt | .createdBy = $createdBy'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data:
body=$(printf %s "$silence" | \
jq \
--arg startsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '-1 min')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 year')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 day')" \
--arg createdBy "Kubernetes object \`cronjob/silence\` in the monitoring namespace" \
'.startsAt = $startsAt | .endsAt = $endsAt | .createdBy = $createdBy'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data:
body=$(printf %s "$silence" | \
jq \
--arg startsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '-1 min')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 year')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 day')" \
--arg createdBy "Kubernetes object \`cronjob/silence\` in the monitoring namespace" \
'.startsAt = $startsAt | .endsAt = $endsAt | .createdBy = $createdBy'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data:
body=$(printf %s "$silence" | \
jq \
--arg startsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '-1 min')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 year')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 day')" \
--arg createdBy "Kubernetes object \`cronjob/silence\` in the monitoring namespace" \
'.startsAt = $startsAt | .endsAt = $endsAt | .createdBy = $createdBy'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data:
body=$(printf %s "$silence" | \
jq \
--arg startsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '-1 min')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 year')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 day')" \
--arg createdBy "Kubernetes object \`cronjob/silence\` in the monitoring namespace" \
'.startsAt = $startsAt | .endsAt = $endsAt | .createdBy = $createdBy'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data:
body=$(printf %s "$silence" | \
jq \
--arg startsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '-1 min')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 year')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 day')" \
--arg createdBy "Kubernetes object \`cronjob/silence\` in the monitoring namespace" \
'.startsAt = $startsAt | .endsAt = $endsAt | .createdBy = $createdBy'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data:
body=$(printf %s "$silence" | \
jq \
--arg startsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '-1 min')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 year')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 day')" \
--arg createdBy "Kubernetes object \`cronjob/silence\` in the monitoring namespace" \
'.startsAt = $startsAt | .endsAt = $endsAt | .createdBy = $createdBy'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data:
body=$(printf %s "$silence" | \
jq \
--arg startsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '-1 min')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 year')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 day')" \
--arg createdBy "Kubernetes object \`cronjob/silence\` in the monitoring namespace" \
'.startsAt = $startsAt | .endsAt = $endsAt | .createdBy = $createdBy'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data:
body=$(printf %s "$silence" | \
jq \
--arg startsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '-1 min')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 year')" \
--arg endsAt "$(date -u +'%Y-%m-%dT%H:%M:%S' --date '+1 day')" \
--arg createdBy "Kubernetes object \`cronjob/silence\` in the monitoring namespace" \
'.startsAt = $startsAt | .endsAt = $endsAt | .createdBy = $createdBy'
)
Expand Down

0 comments on commit 735dbbb

Please sign in to comment.