Skip to content

Commit

Permalink
Replace silence link with silence repo, also on Slack (#1777)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoBrigitte authored Dec 17, 2024
1 parent 502e15f commit d8b8c60
Show file tree
Hide file tree
Showing 18 changed files with 56 additions and 188 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Replace the silence link on Slack with silence repository link

## [4.82.0] - 2024-12-17

### Changed
Expand All @@ -15,7 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Update alert and query URLs for Mimir to point to the Active notification rather than the rule page
- Move link section (runbook, dashboard, explors) before instance to avoid them being lost due to OpsGenie max description being reached
- Move the warnings for missing runbook and dashboard up into the link section
- Replace Alertmanager link with silence repository
- Replace Alertmanager and silence link with silence repository

### Removed

Expand Down
14 changes: 3 additions & 11 deletions files/templates/alertmanager/notification-template.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
[[- else ]]
πŸ‘€ Query: {{ template "__queryurl" . }}
[[- end ]]
πŸ”” Silence: https://github.com/giantswarm/silences#silences
πŸ”” Silence: {{ template "__alert_silence_link" . }}

---

Expand All @@ -68,17 +68,9 @@
πŸ”₯ {{ if .Labels.instance }}{{ .Labels.instance }}: {{ end }}{{ .Annotations.description }}{{ end }}
{{- end }}

# This builds the silence URL. We exclude the alertname in the range
# to avoid the issue of having trailing comma separator (%2C) at the end
# of the generated URL
# Link to the silence repository where silences should be created
{{ define "__alert_silence_link" -}}
{{ .ExternalURL }}/#/silences/new?filter=%7B
{{- range .CommonLabels.SortedPairs -}}
{{- if ne .Name "alertname" -}}
{{- .Name }}%3D"{{- .Value -}}"%2C%20
{{- end -}}
{{- end -}}
alertname%3D"{{ .CommonLabels.alertname }}"%7D
https://github.com/giantswarm/silences#silences
{{- end }}

# Link to related PMs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
πŸ“ˆ Dashboard: ⚠️ There is no **dashboard** for this alert, time to sketch.
{{ end -}}
πŸ‘€ Query: {{ template "__queryurl" . }}
πŸ”” Silence: https://github.com/giantswarm/silences#silences
πŸ”” Silence: {{ template "__alert_silence_link" . }}

---

Expand All @@ -52,17 +52,9 @@
πŸ”₯ {{ if .Labels.instance }}{{ .Labels.instance }}: {{ end }}{{ .Annotations.description }}{{ end }}
{{- end }}

# This builds the silence URL. We exclude the alertname in the range
# to avoid the issue of having trailing comma separator (%2C) at the end
# of the generated URL
# Link to the silence repository where silences should be created
{{ define "__alert_silence_link" -}}
{{ .ExternalURL }}/#/silences/new?filter=%7B
{{- range .CommonLabels.SortedPairs -}}
{{- if ne .Name "alertname" -}}
{{- .Name }}%3D"{{- .Value -}}"%2C%20
{{- end -}}
{{- end -}}
alertname%3D"{{ .CommonLabels.alertname }}"%7D
https://github.com/giantswarm/silences#silences
{{- end }}

# Link to related PMs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
πŸ“ˆ Dashboard: ⚠️ There is no **dashboard** for this alert, time to sketch.
{{ end -}}
πŸ‘€ Query: {{ template "__queryurl" . }}
πŸ”” Silence: https://github.com/giantswarm/silences#silences
πŸ”” Silence: {{ template "__alert_silence_link" . }}

---

Expand All @@ -52,17 +52,9 @@
πŸ”₯ {{ if .Labels.instance }}{{ .Labels.instance }}: {{ end }}{{ .Annotations.description }}{{ end }}
{{- end }}

# This builds the silence URL. We exclude the alertname in the range
# to avoid the issue of having trailing comma separator (%2C) at the end
# of the generated URL
# Link to the silence repository where silences should be created
{{ define "__alert_silence_link" -}}
{{ .ExternalURL }}/#/silences/new?filter=%7B
{{- range .CommonLabels.SortedPairs -}}
{{- if ne .Name "alertname" -}}
{{- .Name }}%3D"{{- .Value -}}"%2C%20
{{- end -}}
{{- end -}}
alertname%3D"{{ .CommonLabels.alertname }}"%7D
https://github.com/giantswarm/silences#silences
{{- end }}

# Link to related PMs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
πŸ“ˆ Dashboard: ⚠️ There is no **dashboard** for this alert, time to sketch.
{{ end -}}
πŸ‘€ Query: {{ template "__queryurl" . }}
πŸ”” Silence: https://github.com/giantswarm/silences#silences
πŸ”” Silence: {{ template "__alert_silence_link" . }}

---

Expand All @@ -52,17 +52,9 @@
πŸ”₯ {{ if .Labels.instance }}{{ .Labels.instance }}: {{ end }}{{ .Annotations.description }}{{ end }}
{{- end }}

# This builds the silence URL. We exclude the alertname in the range
# to avoid the issue of having trailing comma separator (%2C) at the end
# of the generated URL
# Link to the silence repository where silences should be created
{{ define "__alert_silence_link" -}}
{{ .ExternalURL }}/#/silences/new?filter=%7B
{{- range .CommonLabels.SortedPairs -}}
{{- if ne .Name "alertname" -}}
{{- .Name }}%3D"{{- .Value -}}"%2C%20
{{- end -}}
{{- end -}}
alertname%3D"{{ .CommonLabels.alertname }}"%7D
https://github.com/giantswarm/silences#silences
{{- end }}

# Link to related PMs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
πŸ“ˆ Dashboard: ⚠️ There is no **dashboard** for this alert, time to sketch.
{{ end -}}
πŸ‘€ Query: {{ template "__queryurl" . }}
πŸ”” Silence: https://github.com/giantswarm/silences#silences
πŸ”” Silence: {{ template "__alert_silence_link" . }}

---

Expand All @@ -52,17 +52,9 @@
πŸ”₯ {{ if .Labels.instance }}{{ .Labels.instance }}: {{ end }}{{ .Annotations.description }}{{ end }}
{{- end }}

# This builds the silence URL. We exclude the alertname in the range
# to avoid the issue of having trailing comma separator (%2C) at the end
# of the generated URL
# Link to the silence repository where silences should be created
{{ define "__alert_silence_link" -}}
{{ .ExternalURL }}/#/silences/new?filter=%7B
{{- range .CommonLabels.SortedPairs -}}
{{- if ne .Name "alertname" -}}
{{- .Name }}%3D"{{- .Value -}}"%2C%20
{{- end -}}
{{- end -}}
alertname%3D"{{ .CommonLabels.alertname }}"%7D
https://github.com/giantswarm/silences#silences
{{- end }}

# Link to related PMs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
πŸ“ˆ Dashboard: ⚠️ There is no **dashboard** for this alert, time to sketch.
{{ end -}}
πŸ‘€ Query: {{ template "__queryurl" . }}
πŸ”” Silence: https://github.com/giantswarm/silences#silences
πŸ”” Silence: {{ template "__alert_silence_link" . }}

---

Expand All @@ -52,17 +52,9 @@
πŸ”₯ {{ if .Labels.instance }}{{ .Labels.instance }}: {{ end }}{{ .Annotations.description }}{{ end }}
{{- end }}

# This builds the silence URL. We exclude the alertname in the range
# to avoid the issue of having trailing comma separator (%2C) at the end
# of the generated URL
# Link to the silence repository where silences should be created
{{ define "__alert_silence_link" -}}
{{ .ExternalURL }}/#/silences/new?filter=%7B
{{- range .CommonLabels.SortedPairs -}}
{{- if ne .Name "alertname" -}}
{{- .Name }}%3D"{{- .Value -}}"%2C%20
{{- end -}}
{{- end -}}
alertname%3D"{{ .CommonLabels.alertname }}"%7D
https://github.com/giantswarm/silences#silences
{{- end }}

# Link to related PMs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
πŸ“ˆ Dashboard: ⚠️ There is no **dashboard** for this alert, time to sketch.
{{ end -}}
πŸ‘€ Query: {{ template "__queryurl" . }}
πŸ”” Silence: https://github.com/giantswarm/silences#silences
πŸ”” Silence: {{ template "__alert_silence_link" . }}

---

Expand All @@ -52,17 +52,9 @@
πŸ”₯ {{ if .Labels.instance }}{{ .Labels.instance }}: {{ end }}{{ .Annotations.description }}{{ end }}
{{- end }}

# This builds the silence URL. We exclude the alertname in the range
# to avoid the issue of having trailing comma separator (%2C) at the end
# of the generated URL
# Link to the silence repository where silences should be created
{{ define "__alert_silence_link" -}}
{{ .ExternalURL }}/#/silences/new?filter=%7B
{{- range .CommonLabels.SortedPairs -}}
{{- if ne .Name "alertname" -}}
{{- .Name }}%3D"{{- .Value -}}"%2C%20
{{- end -}}
{{- end -}}
alertname%3D"{{ .CommonLabels.alertname }}"%7D
https://github.com/giantswarm/silences#silences
{{- end }}

# Link to related PMs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
πŸ“ˆ Dashboard: ⚠️ There is no **dashboard** for this alert, time to sketch.
{{ end -}}
πŸ‘€ Query: {{ template "__queryurl" . }}
πŸ”” Silence: https://github.com/giantswarm/silences#silences
πŸ”” Silence: {{ template "__alert_silence_link" . }}

---

Expand All @@ -52,17 +52,9 @@
πŸ”₯ {{ if .Labels.instance }}{{ .Labels.instance }}: {{ end }}{{ .Annotations.description }}{{ end }}
{{- end }}

# This builds the silence URL. We exclude the alertname in the range
# to avoid the issue of having trailing comma separator (%2C) at the end
# of the generated URL
# Link to the silence repository where silences should be created
{{ define "__alert_silence_link" -}}
{{ .ExternalURL }}/#/silences/new?filter=%7B
{{- range .CommonLabels.SortedPairs -}}
{{- if ne .Name "alertname" -}}
{{- .Name }}%3D"{{- .Value -}}"%2C%20
{{- end -}}
{{- end -}}
alertname%3D"{{ .CommonLabels.alertname }}"%7D
https://github.com/giantswarm/silences#silences
{{- end }}

# Link to related PMs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
πŸ“ˆ Dashboard: ⚠️ There is no **dashboard** for this alert, time to sketch.
{{ end -}}
πŸ‘€ Query: {{ template "__queryurl" . }}
πŸ”” Silence: https://github.com/giantswarm/silences#silences
πŸ”” Silence: {{ template "__alert_silence_link" . }}

---

Expand All @@ -52,17 +52,9 @@
πŸ”₯ {{ if .Labels.instance }}{{ .Labels.instance }}: {{ end }}{{ .Annotations.description }}{{ end }}
{{- end }}

# This builds the silence URL. We exclude the alertname in the range
# to avoid the issue of having trailing comma separator (%2C) at the end
# of the generated URL
# Link to the silence repository where silences should be created
{{ define "__alert_silence_link" -}}
{{ .ExternalURL }}/#/silences/new?filter=%7B
{{- range .CommonLabels.SortedPairs -}}
{{- if ne .Name "alertname" -}}
{{- .Name }}%3D"{{- .Value -}}"%2C%20
{{- end -}}
{{- end -}}
alertname%3D"{{ .CommonLabels.alertname }}"%7D
https://github.com/giantswarm/silences#silences
{{- end }}

# Link to related PMs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
πŸ“ˆ Dashboard: ⚠️ There is no **dashboard** for this alert, time to sketch.
{{ end -}}
πŸ‘€ Explore: {{ template "__queryurl" . }}
πŸ”” Silence: https://github.com/giantswarm/silences#silences
πŸ”” Silence: {{ template "__alert_silence_link" . }}

---

Expand All @@ -52,17 +52,9 @@
πŸ”₯ {{ if .Labels.instance }}{{ .Labels.instance }}: {{ end }}{{ .Annotations.description }}{{ end }}
{{- end }}

# This builds the silence URL. We exclude the alertname in the range
# to avoid the issue of having trailing comma separator (%2C) at the end
# of the generated URL
# Link to the silence repository where silences should be created
{{ define "__alert_silence_link" -}}
{{ .ExternalURL }}/#/silences/new?filter=%7B
{{- range .CommonLabels.SortedPairs -}}
{{- if ne .Name "alertname" -}}
{{- .Name }}%3D"{{- .Value -}}"%2C%20
{{- end -}}
{{- end -}}
alertname%3D"{{ .CommonLabels.alertname }}"%7D
https://github.com/giantswarm/silences#silences
{{- end }}

# Link to related PMs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
πŸ“ˆ Dashboard: ⚠️ There is no **dashboard** for this alert, time to sketch.
{{ end -}}
πŸ‘€ Explore: {{ template "__queryurl" . }}
πŸ”” Silence: https://github.com/giantswarm/silences#silences
πŸ”” Silence: {{ template "__alert_silence_link" . }}

---

Expand All @@ -52,17 +52,9 @@
πŸ”₯ {{ if .Labels.instance }}{{ .Labels.instance }}: {{ end }}{{ .Annotations.description }}{{ end }}
{{- end }}

# This builds the silence URL. We exclude the alertname in the range
# to avoid the issue of having trailing comma separator (%2C) at the end
# of the generated URL
# Link to the silence repository where silences should be created
{{ define "__alert_silence_link" -}}
{{ .ExternalURL }}/#/silences/new?filter=%7B
{{- range .CommonLabels.SortedPairs -}}
{{- if ne .Name "alertname" -}}
{{- .Name }}%3D"{{- .Value -}}"%2C%20
{{- end -}}
{{- end -}}
alertname%3D"{{ .CommonLabels.alertname }}"%7D
https://github.com/giantswarm/silences#silences
{{- end }}

# Link to related PMs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
πŸ“ˆ Dashboard: ⚠️ There is no **dashboard** for this alert, time to sketch.
{{ end -}}
πŸ‘€ Explore: {{ template "__queryurl" . }}
πŸ”” Silence: https://github.com/giantswarm/silences#silences
πŸ”” Silence: {{ template "__alert_silence_link" . }}

---

Expand All @@ -52,17 +52,9 @@
πŸ”₯ {{ if .Labels.instance }}{{ .Labels.instance }}: {{ end }}{{ .Annotations.description }}{{ end }}
{{- end }}

# This builds the silence URL. We exclude the alertname in the range
# to avoid the issue of having trailing comma separator (%2C) at the end
# of the generated URL
# Link to the silence repository where silences should be created
{{ define "__alert_silence_link" -}}
{{ .ExternalURL }}/#/silences/new?filter=%7B
{{- range .CommonLabels.SortedPairs -}}
{{- if ne .Name "alertname" -}}
{{- .Name }}%3D"{{- .Value -}}"%2C%20
{{- end -}}
{{- end -}}
alertname%3D"{{ .CommonLabels.alertname }}"%7D
https://github.com/giantswarm/silences#silences
{{- end }}

# Link to related PMs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
πŸ“ˆ Dashboard: ⚠️ There is no **dashboard** for this alert, time to sketch.
{{ end -}}
πŸ‘€ Explore: {{ template "__queryurl" . }}
πŸ”” Silence: https://github.com/giantswarm/silences#silences
πŸ”” Silence: {{ template "__alert_silence_link" . }}

---

Expand All @@ -52,17 +52,9 @@
πŸ”₯ {{ if .Labels.instance }}{{ .Labels.instance }}: {{ end }}{{ .Annotations.description }}{{ end }}
{{- end }}

# This builds the silence URL. We exclude the alertname in the range
# to avoid the issue of having trailing comma separator (%2C) at the end
# of the generated URL
# Link to the silence repository where silences should be created
{{ define "__alert_silence_link" -}}
{{ .ExternalURL }}/#/silences/new?filter=%7B
{{- range .CommonLabels.SortedPairs -}}
{{- if ne .Name "alertname" -}}
{{- .Name }}%3D"{{- .Value -}}"%2C%20
{{- end -}}
{{- end -}}
alertname%3D"{{ .CommonLabels.alertname }}"%7D
https://github.com/giantswarm/silences#silences
{{- end }}

# Link to related PMs
Expand Down
Loading

0 comments on commit d8b8c60

Please sign in to comment.