Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expire silences after one day instead of one year #194

Merged
merged 3 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading