diff --git a/apps/k8s01/mail/dashboards/logs.json b/apps/k8s01/mail/dashboards/logs.json new file mode 100644 index 0000000000000000000000000000000000000000..66c38a09042c7ae068b7709a8124a12112da8640 --- /dev/null +++ b/apps/k8s01/mail/dashboards/logs.json @@ -0,0 +1,252 @@ +{ + "__inputs": [ + { + "name": "DS_LOKI", + "label": "Loki", + "description": "", + "type": "datasource", + "pluginId": "loki", + "pluginName": "Loki" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "9.1.6" + }, + { + "type": "panel", + "id": "logs", + "name": "Logs", + "version": "" + }, + { + "type": "datasource", + "id": "loki", + "name": "Loki", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "loki", + "uid": "${DS_LOKI}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.1.6", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "${DS_LOKI}" + }, + "editorMode": "code", + "expr": "sum(count_over_time({namespace=\"mail\"} |= `NOQUEUE: reject` [$__range]))", + "queryType": "range", + "refId": "A" + } + ], + "title": "Rejected mails", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "${DS_LOKI}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 6, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.1.6", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "${DS_LOKI}" + }, + "editorMode": "builder", + "expr": "sum(count_over_time({namespace=\"mail\", container=\"postfix\"} |= `status=sent (250 2.0.0` [$__range]))", + "queryType": "range", + "refId": "A" + } + ], + "title": "Successful delivered", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "${DS_LOKI}" + }, + "gridPos": { + "h": 22, + "w": 22, + "x": 1, + "y": 9 + }, + "id": 4, + "options": { + "dedupStrategy": "none", + "enableLogDetails": true, + "prettifyLogMessage": false, + "showCommonLabels": false, + "showLabels": false, + "showTime": false, + "sortOrder": "Descending", + "wrapLogMessage": false + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "${DS_LOKI}" + }, + "editorMode": "builder", + "expr": "{namespace=\"mail\"} |= ``", + "queryType": "range", + "refId": "A" + } + ], + "title": "Panel Title", + "type": "logs" + } + ], + "refresh": "30s", + "schemaVersion": 37, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-24h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Mail logs", + "uid": "b5TQlE4Vz", + "version": 2, + "weekStart": "" +} diff --git a/apps/k8s01/mail/kustomization.yaml b/apps/k8s01/mail/kustomization.yaml index 4131d44ebcf19598ab2dc8990c55c399f230d082..7de24ca62659820bbda446a0ab6a23b3654411e2 100644 --- a/apps/k8s01/mail/kustomization.yaml +++ b/apps/k8s01/mail/kustomization.yaml @@ -6,3 +6,10 @@ resources: - certificate.yaml - mail-values.yaml - ../../../shared/resourcequotas/default.yaml +configMapGenerator: + - name: mail-grafana-dashboards + files: + - ./dashboards/logs.json + options: + labels: + grafana_dashboard: mail