diff --git a/.github/workflows/KakeysBakery20240319120850.yml b/.github/workflows/KakeysBakery20240319120850.yml index 6531cc8..d446de2 100644 --- a/.github/workflows/KakeysBakery20240319120850.yml +++ b/.github/workflows/KakeysBakery20240319120850.yml @@ -107,6 +107,12 @@ jobs: cd ../../../ cd Telemetry/kube-configs + + cd grafana + kubectl -n $NAMESPACE delete configmap grafana-datasource-config || true + kubectl -n $NAMESPACE create configmap grafana-datasource-config --from-file=. + cd ../ + kubectl -n $NAMESPACE delete configmap loki-config || true kubectl -n $NAMESPACE create configmap loki-config --from-file=loki-config.yml diff --git a/Telemetry/kube-configs/grafana/dashboard.yml b/Telemetry/kube-configs/grafana/dashboard.yml new file mode 100644 index 0000000..c471f1f --- /dev/null +++ b/Telemetry/kube-configs/grafana/dashboard.yml @@ -0,0 +1,142 @@ +{ + "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": 1, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "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": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "up{job=\"blackbox\", instance=\"http://kakeysbakery.duckdns.org:80/health\"}", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Uptime", + "type": "timeseries" + } + ], + "refresh": "", + "revision": 1, + "schemaVersion": 38, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Telemetry Dashboard", + "uid": "mRb3e0BSk", + "version": 1, + "weekStart": "" +} \ No newline at end of file diff --git a/Telemetry/kube-configs/grafana/grafana-datasource.yml b/Telemetry/kube-configs/grafana/grafana-datasource.yml new file mode 100644 index 0000000..aa3f58d --- /dev/null +++ b/Telemetry/kube-configs/grafana/grafana-datasource.yml @@ -0,0 +1,25 @@ +#https://grafana.com/docs/grafana/latest/administration/provisioning/ +apiVersion: 1 + +datasources: +- name: Prometheus + type: prometheus + uid: prometheus + access: proxy + url: http://prometheus-service:9090 + jsonData: + timeInterval: 10s + basicAuth: false + isDefault: true + version: 1 + editable: false + +- name: Loki + type: loki + uid: loki + access: proxy + url: http://loki-service:3100 + basicAuth: false + isDefault: false + version: 1 + editable: false \ No newline at end of file