openreplay/ee/scripts/helmcharts/manifests/monitoring.yaml
rjshrjndrn d7e100e383 chore(helm): Adding grafana plugins
Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
2022-06-30 08:12:26 +02:00

168 lines
5.2 KiB
YAML

##################################################
## Update the following values
##
## For example,
# domainName: &domainName openreplay.supercompany.com
##################################################
domainName: &domainName "changeme.mycorp.org"
grafanaAdminPassword: &adminpass "changeNeGrafanaAdminPassword"
slackWebhookUrl: &slackwebhook "https://hooks.slack.com/services/xxxx/xxxx/xxxxx" # Slack webhook token for sending alerts
slackChannel: &slackchannel "changeMeAlertsChannel" # Name of the channel, to alerts to be delivered to.
########################################################
## Custom configuration for Monitoring and logging stack
########################################################
fullnameOverride: "openreplay"
grafana:
adminPassword: *adminpass
env:
GF_SERVER_ROOT_URL: http://grafana.local.com/grafana
additionalDataSources:
- name: loki
editable: true
type: loki
url: http://loki.logging:3100
plugins:
- grafana-piechart-panel
- vertamedia-clickhouse-datasource
- digrich-bubblechart-panel
- grafana-clock-panel
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
slack_api_url: *slackwebhook
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: *slackchannel
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 }}