155 lines
4.6 KiB
YAML
155 lines
4.6 KiB
YAML
## Update the following values
|
|
domainName: &domainName openreplay.mycorp.org
|
|
credentials:
|
|
grafana: &grafana
|
|
adminPassword: "grafanaAdminPassword"
|
|
alertManager: &alertmanager
|
|
slack_api_url: "https://hooks.slack.com/services/xxxx/xxxx/xxxxx"
|
|
|
|
## Custom configuration for Monitoring and logging stack
|
|
fullnameOverride: "openreplay"
|
|
grafana:
|
|
<<: *grafana
|
|
env:
|
|
GF_SERVER_ROOT_URL: http://grafana.local.com/grafana
|
|
additionalDataSources:
|
|
- name: loki
|
|
editable: true
|
|
type: loki
|
|
url: http://loki.logging:3100
|
|
ingress:
|
|
enabled: true
|
|
ingressClassName: openreplay
|
|
hosts:
|
|
- *domainName
|
|
annotations:
|
|
nginx.ingress.kubernetes.io/rewrite-target: /$1
|
|
path: /grafana/(.*)
|
|
tls:
|
|
- hosts:
|
|
- *domainName
|
|
secretName: openreplay-ssl
|
|
|
|
prometheus:
|
|
prometheusSpec:
|
|
storageSpec:
|
|
volumeClaimTemplate:
|
|
spec:
|
|
accessModes: ["ReadWriteOnce"]
|
|
resources:
|
|
requests:
|
|
storage: 200Gi
|
|
alertmanager:
|
|
config:
|
|
global:
|
|
resolve_timeout: 5m
|
|
<<: *alertmanager
|
|
route:
|
|
# group_by: ['job']
|
|
group_by: ['alertname','container']
|
|
group_wait: 30s
|
|
group_interval: 5m
|
|
repeat_interval: 12h
|
|
receiver: 'slack'
|
|
routes:
|
|
- match:
|
|
alertname: Watchdog
|
|
receiver: 'slack'
|
|
receivers:
|
|
- name: slack
|
|
slack_configs:
|
|
- channel: '${CHANGE_ME_SLACK_CHANNEL}'
|
|
color: '{{ template "slack.color" . }}'
|
|
title: '{{ template "slack.title" . }}'
|
|
text: '{{ template "slack.text" . }}'
|
|
send_resolved: true
|
|
actions:
|
|
- type: button
|
|
text: 'Runbook :green_book:'
|
|
url: '{{ (index .Alerts 0).Annotations.runbook_url }}'
|
|
# - type: button
|
|
# text: 'Query :mag:'
|
|
# url: '{{ (index .Alerts 0).GeneratorURL }}'
|
|
# - type: button
|
|
# text: 'Dashboard :chart_with_upwards_trend:'
|
|
# url: '{{ (index .Alerts 0).Annotations.dashboard_url }}'
|
|
# - type: button
|
|
# text: 'Silence :no_bell:'
|
|
# url: '{{ template "__alert_silence_link" . }}'
|
|
templates:
|
|
- /etc/alertmanager/config/*.tmpl
|
|
|
|
templateFiles:
|
|
template_1.tmpl: |-
|
|
{{/* Alertmanager Silence link */}}
|
|
{{ 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
|
|
{{- end }}
|
|
|
|
{{/* Severity of the alert */}}
|
|
{{ define "__alert_severity" -}}
|
|
{{- if eq .CommonLabels.severity "critical" -}}
|
|
*Severity:* `Critical`
|
|
{{- else if eq .CommonLabels.severity "warning" -}}
|
|
*Severity:* `Warning`
|
|
{{- else if eq .CommonLabels.severity "info" -}}
|
|
*Severity:* `Info`
|
|
{{- else -}}
|
|
*Severity:* :question: {{ .CommonLabels.severity }}
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
{{/* Title of the Slack alert */}}
|
|
{{ define "slack.title" -}}
|
|
[{{ .Status | toUpper -}}
|
|
{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{- end -}}
|
|
] {{ .CommonLabels.alertname }}
|
|
{{- end }}
|
|
|
|
|
|
{{/* Color of Slack attachment (appears as line next to alert )*/}}
|
|
{{ define "slack.color" -}}
|
|
{{ if eq .Status "firing" -}}
|
|
{{ if eq .CommonLabels.severity "warning" -}}
|
|
warning
|
|
{{- else if eq .CommonLabels.severity "critical" -}}
|
|
danger
|
|
{{- else -}}
|
|
#439FE0
|
|
{{- end -}}
|
|
{{ else -}}
|
|
good
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
{{/* The text to display in the alert */}}
|
|
{{ define "slack.text" -}}
|
|
|
|
{{ template "__alert_severity" . }}
|
|
{{- if (index .Alerts 0).Annotations.summary }}
|
|
{{- "\n" -}}
|
|
*Summary:* {{ (index .Alerts 0).Annotations.summary }}
|
|
{{- end }}
|
|
|
|
{{ range .Alerts }}
|
|
|
|
{{- if .Annotations.description }}
|
|
{{- "\n" -}}
|
|
{{ .Annotations.description }}
|
|
{{- "\n" -}}
|
|
{{- end }}
|
|
{{- if .Annotations.message }}
|
|
{{- "\n" -}}
|
|
{{ .Annotations.message }}
|
|
{{- "\n" -}}
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|