From 8b99d6eac6b0f28746b9fd8193bee5061d6e67f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Heleno?= <33546359+lentidas@users.noreply.github.com> Date: Fri, 1 Mar 2024 11:48:42 +0100 Subject: [PATCH] feat: make the dashboard deployment dynamic (#74) * feat: make the dashboard deployment dynamic * docs(terraform-docs): generate docs and write to README.adoc --------- Co-authored-by: lentidas --- README.adoc | 6 +- aks/README.adoc | 4 +- charts/traefik/dashboards/global.json | 834 +++++++++++++++++ .../templates/grafana-dashboard-cm.yaml | 845 ------------------ .../traefik/templates/grafana-dashboard.yaml | 19 + eks/README.adoc | 4 +- kind/README.adoc | 4 +- nodeport/README.adoc | 4 +- scaleway/README.adoc | 4 +- sks/README.adoc | 4 +- 10 files changed, 868 insertions(+), 860 deletions(-) create mode 100644 charts/traefik/dashboards/global.json delete mode 100644 charts/traefik/templates/grafana-dashboard-cm.yaml create mode 100644 charts/traefik/templates/grafana-dashboard.yaml diff --git a/README.adoc b/README.adoc index 89909e1..9c07a2e 100644 --- a/README.adoc +++ b/README.adoc @@ -65,7 +65,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v6.1.0"` +Default: `"v6.1.1"` ==== [[input_enable_service_monitor]] <> @@ -155,9 +155,9 @@ Description: ID to pass other modules in order to refer to this module as a depe [cols="a,a",options="header,autowidth"] |=== |Name |Version -|[[provider_null]] <> |>= 3 |[[provider_utils]] <> |>= 1 |[[provider_argocd]] <> |>= 5 +|[[provider_null]] <> |>= 3 |=== = Resources @@ -198,7 +198,7 @@ Description: ID to pass other modules in order to refer to this module as a depe |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v6.1.0"` +|`"v6.1.1"` |no |[[input_enable_service_monitor]] <> diff --git a/aks/README.adoc b/aks/README.adoc index 625c6d8..b1eda2d 100644 --- a/aks/README.adoc +++ b/aks/README.adoc @@ -69,7 +69,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v6.1.0"` +Default: `"v6.1.1"` ==== [[input_enable_service_monitor]] <> @@ -200,7 +200,7 @@ Description: ID to pass other modules in order to refer to this module as a depe |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v6.1.0"` +|`"v6.1.1"` |no |[[input_enable_service_monitor]] <> diff --git a/charts/traefik/dashboards/global.json b/charts/traefik/dashboards/global.json new file mode 100644 index 0000000..39669ec --- /dev/null +++ b/charts/traefik/dashboards/global.json @@ -0,0 +1,834 @@ +{ + "annotations": { + "list": [ + { + "$$hashKey": "object:112", + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "limit": 100, + "name": "Annotations & Alerts", + "showIn": 0, + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "Traefik dashboard (based on Traefik by Thomas Cheronneau https://grafana.com/grafana/dashboards/4475)", + "editable": true, + "fiscalYearStartMonth": 0, + "gnetId": 12250, + "graphTooltip": 0, + "id": 21, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 16, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "refId": "A" + } + ], + "title": "Global stats", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 1 + }, + "hiddenSeries": false, + "id": 14, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "9.4.7", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(traefik_service_request_duration_seconds_sum{}) by (exported_service) / sum(traefik_service_request_duration_seconds_count{}) by (exported_service)", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{ exported_service }}", + "range": true, + "refId": "A", + "step": 240 + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Average response time by service", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:598", + "format": "s", + "logBase": 1, + "min": "0", + "show": true + }, + { + "$$hashKey": "object:599", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "breakPoint": "50%", + "combine": { + "label": "Others", + "threshold": 0 + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fontSize": "80%", + "format": "short", + "gridPos": { + "h": 7, + "w": 6, + "x": 12, + "y": 1 + }, + "id": 7, + "legend": { + "show": false, + "values": true + }, + "legendType": "Right side", + "links": [], + "maxDataPoints": 3, + "nullPointMode": "connected", + "pieType": "pie", + "strokeWidth": 1, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(traefik_service_requests_total[5m])) by (exported_service) ", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{ service }}", + "range": true, + "refId": "A" + } + ], + "title": "Requests by service", + "type": "grafana-piechart-panel", + "valueName": "total" + }, + { + "aliasColors": {}, + "breakPoint": "50%", + "combine": { + "label": "Others", + "threshold": 0 + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fontSize": "80%", + "format": "short", + "gridPos": { + "h": 7, + "w": 6, + "x": 18, + "y": 1 + }, + "id": 8, + "legend": { + "show": true, + "values": true + }, + "legendType": "Right side", + "links": [], + "maxDataPoints": 3, + "nullPointMode": "connected", + "pieType": "pie", + "strokeWidth": 1, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "expr": "sum(rate(traefik_entrypoint_requests_total{entrypoint =~ \"$entrypoint\"}[5m])) by (entrypoint) ", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{ entrypoint }}", + "refId": "A" + } + ], + "title": "Requests by protocol", + "type": "grafana-piechart-panel", + "valueName": "total" + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 8 + }, + "hiddenSeries": false, + "id": 5, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "9.4.7", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(traefik_entrypoint_requests_total{entrypoint=~\"$entrypoint\",code=\"200\"}[5m])) by (code,method)", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{ method }} : {{ code }}", + "range": true, + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Status code 200 over 5min", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 8 + }, + "hiddenSeries": false, + "id": 6, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "9.4.7", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(traefik_entrypoint_requests_total{entrypoint=~\"$entrypoint\",code!=\"200\"}[5m])) by (code,method)", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{ method }} : {{ code }}", + "range": true, + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Others status code over 5min", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "logBase": 1, + "show": true + }, + { + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 15 + }, + "id": 10, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "refId": "A" + } + ], + "title": "$service stats", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "rgb(31, 120, 193)", + "mode": "fixed" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 16 + }, + "id": 4, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "none", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.4.7", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(traefik_service_request_duration_seconds_sum{exported_service=~\"$service.*\"}) / sum(traefik_service_requests_total{exported_service=~\"$service.*\"}) * 1000", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "", + "range": true, + "refId": "A" + } + ], + "title": "$service response time", + "type": "stat" + }, + { + "aliasColors": {}, + "breakPoint": "50%", + "combine": { + "label": "Others", + "threshold": 0 + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fontSize": "80%", + "format": "short", + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 16 + }, + "id": 2, + "legend": { + "percentage": true, + "show": true, + "values": true + }, + "legendType": "Right side", + "links": [], + "maxDataPoints": 3, + "nullPointMode": "connected", + "pieType": "pie", + "strokeWidth": 1, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "traefik_service_requests_total{exported_service=~\"$service.*\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{ method }} : { {code }}", + "range": true, + "refId": "A" + } + ], + "title": "$service return code", + "type": "grafana-piechart-panel", + "valueName": "current" + }, + { + "aliasColors": {}, + "bars": true, + "dashLength": 10, + "dashes": false, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "links": [] + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 16 + }, + "hiddenSeries": false, + "id": 3, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": true, + "min": true, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "9.4.7", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(rate(traefik_service_requests_total{exported_service=~\"$service.*\"}[5m]))", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "Total requests $service", + "range": true, + "refId": "A" + } + ], + "thresholds": [], + "timeRegions": [], + "title": "Total requests over 5min $service", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:509", + "format": "short", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:510", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + } + ], + "refresh": "5m", + "revision": 1, + "schemaVersion": 38, + "style": "dark", + "tags": [ + "traefik-mixin" + ], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "", + "value": "" + }, + "hide": 0, + "includeAll": false, + "label": "Datasource", + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": { + "selected": false, + "text": "", + "value": "" + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "label_values(exported_service)", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "service", + "options": [], + "query": { + "query": "label_values(exported_service)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "/(.*)@.*/", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "current": { + "selected": true, + "text": [], + "value": [] + }, + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "definition": "", + "hide": 0, + "includeAll": true, + "multi": true, + "name": "entrypoint", + "options": [], + "query": "label_values(entrypoint)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Traefik", + "uid": "O23g2BeWk", + "version": 6, + "weekStart": "" +} diff --git a/charts/traefik/templates/grafana-dashboard-cm.yaml b/charts/traefik/templates/grafana-dashboard-cm.yaml deleted file mode 100644 index 37f773e..0000000 --- a/charts/traefik/templates/grafana-dashboard-cm.yaml +++ /dev/null @@ -1,845 +0,0 @@ -{{- if .Values.traefik.metrics.prometheus.serviceMonitor }} -apiVersion: v1 -kind: ConfigMap -metadata: - labels: - grafana_dashboard: "1" - name: grafana-dashboard -data: - traefik.json: |- - { - "annotations": { - "list": [ - { - "$$hashKey": "object:112", - "builtIn": 1, - "datasource": { - "type": "datasource", - "uid": "grafana" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "limit": 100, - "name": "Annotations & Alerts", - "showIn": 0, - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "type": "dashboard" - } - ] - }, - "description": "Traefik dashboard (data from prometheus) (based on Traefik by Thomas Cheronneau https://grafana.com/grafana/dashboards/4475)", - "editable": true, - "fiscalYearStartMonth": 0, - "gnetId": 12250, - "graphTooltip": 0, - "id": 21, - "links": [], - "liveNow": false, - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 16, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "refId": "A" - } - ], - "title": "Global stats", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "fieldConfig": { - "defaults": { - "links": [] - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 1 - }, - "hiddenSeries": false, - "id": 14, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "9.4.7", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "editorMode": "code", - "expr": "sum(traefik_service_request_duration_seconds_sum{}) by (exported_service) / sum(traefik_service_request_duration_seconds_count{}) by (exported_service)", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "{{"{{"}}exported_service{{"}}"}}", - "range": true, - "refId": "A", - "step": 240 - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Average response time by service", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:598", - "format": "s", - "logBase": 1, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:599", - "format": "short", - "logBase": 1, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "breakPoint": "50%", - "combine": { - "label": "Others", - "threshold": 0 - }, - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "fontSize": "80%", - "format": "short", - "gridPos": { - "h": 7, - "w": 6, - "x": 12, - "y": 1 - }, - "id": 7, - "legend": { - "show": false, - "values": true - }, - "legendType": "Right side", - "links": [], - "maxDataPoints": 3, - "nullPointMode": "connected", - "pieType": "pie", - "strokeWidth": 1, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "editorMode": "code", - "expr": "sum(rate(traefik_service_requests_total[5m])) by (exported_service) ", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "{{"{{"}} service {{"}}"}}", - "range": true, - "refId": "A" - } - ], - "title": "Requests by service", - "type": "grafana-piechart-panel", - "valueName": "total" - }, - { - "aliasColors": {}, - "breakPoint": "50%", - "combine": { - "label": "Others", - "threshold": 0 - }, - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "fontSize": "80%", - "format": "short", - "gridPos": { - "h": 7, - "w": 6, - "x": 18, - "y": 1 - }, - "id": 8, - "legend": { - "show": true, - "values": true - }, - "legendType": "Right side", - "links": [], - "maxDataPoints": 3, - "nullPointMode": "connected", - "pieType": "pie", - "strokeWidth": 1, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "expr": "sum(rate(traefik_entrypoint_requests_total{entrypoint =~ \"$entrypoint\"}[5m])) by (entrypoint) ", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "{{"{{"}} entrypoint {{"}}"}}", - "refId": "A" - } - ], - "title": "Requests by protocol", - "type": "grafana-piechart-panel", - "valueName": "total" - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "fieldConfig": { - "defaults": { - "links": [] - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 8 - }, - "hiddenSeries": false, - "id": 5, - "legend": { - "alignAsTable": true, - "avg": false, - "current": true, - "max": true, - "min": true, - "rightSide": true, - "show": true, - "total": false, - "values": true - }, - "lines": false, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "9.4.7", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "editorMode": "code", - "expr": "sum(rate(traefik_entrypoint_requests_total{entrypoint=~\"$entrypoint\",code=\"200\"}[5m])) by (code,method)", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "{{"{{"}}method{{"}}"}} : {{"{{"}}code{{"}}"}}", - "range": true, - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Status code 200 over 5min", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "show": true - }, - { - "format": "short", - "logBase": 1, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "fieldConfig": { - "defaults": { - "links": [] - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 8 - }, - "hiddenSeries": false, - "id": 6, - "legend": { - "alignAsTable": true, - "avg": false, - "current": true, - "max": true, - "min": true, - "rightSide": true, - "show": true, - "total": false, - "values": true - }, - "lines": false, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "9.4.7", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "editorMode": "code", - "expr": "sum(rate(traefik_entrypoint_requests_total{entrypoint=~\"$entrypoint\",code!=\"200\"}[5m])) by (code,method)", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{"{{"}} method {{"}}"}} : {{"{{"}}code{{"}}"}}", - "range": true, - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Others status code over 5min", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "logBase": 1, - "show": true - }, - { - "format": "short", - "logBase": 1, - "show": true - } - ], - "yaxis": { - "align": false - } - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 15 - }, - "id": 10, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "refId": "A" - } - ], - "title": "$service stats", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "rgb(31, 120, 193)", - "mode": "fixed" - }, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 8, - "x": 0, - "y": 16 - }, - "id": 4, - "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "none", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "mean" - ], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "9.4.7", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "editorMode": "code", - "expr": "sum(traefik_service_request_duration_seconds_sum{exported_service=~\"$service.*\"}) / sum(traefik_service_requests_total{exported_service=~\"$service.*\"}) * 1000", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "", - "range": true, - "refId": "A" - } - ], - "title": "$service response time", - "type": "stat" - }, - { - "aliasColors": {}, - "breakPoint": "50%", - "combine": { - "label": "Others", - "threshold": 0 - }, - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "fontSize": "80%", - "format": "short", - "gridPos": { - "h": 7, - "w": 8, - "x": 8, - "y": 16 - }, - "id": 2, - "legend": { - "percentage": true, - "show": true, - "values": true - }, - "legendType": "Right side", - "links": [], - "maxDataPoints": 3, - "nullPointMode": "connected", - "pieType": "pie", - "strokeWidth": 1, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "editorMode": "code", - "expr": "traefik_service_requests_total{exported_service=~\"$service.*\"}", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "{{"{{"}}method{{"}}"}} : {{"{{"}}code{{"}}"}}", - "range": true, - "refId": "A" - } - ], - "title": "$service return code", - "type": "grafana-piechart-panel", - "valueName": "current" - }, - { - "aliasColors": {}, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "fieldConfig": { - "defaults": { - "links": [] - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 7, - "w": 8, - "x": 16, - "y": 16 - }, - "hiddenSeries": false, - "id": 3, - "legend": { - "alignAsTable": true, - "avg": true, - "current": false, - "max": true, - "min": true, - "rightSide": false, - "show": true, - "total": false, - "values": true - }, - "lines": false, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "alertThreshold": true - }, - "percentage": false, - "pluginVersion": "9.4.7", - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "editorMode": "code", - "expr": "sum(rate(traefik_service_requests_total{exported_service=~\"$service.*\"}[5m]))", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "Total requests $service", - "range": true, - "refId": "A" - } - ], - "thresholds": [], - "timeRegions": [], - "title": "Total requests over 5min $service", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "mode": "time", - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:509", - "format": "short", - "logBase": 1, - "show": true - }, - { - "$$hashKey": "object:510", - "format": "short", - "logBase": 1, - "show": true - } - ], - "yaxis": { - "align": false - } - } - ], - "refresh": "5m", - "revision": 1, - "schemaVersion": 38, - "style": "dark", - "tags": [ - "prometheus", - "traefik" - ], - "templating": { - "list": [ - { - "current": { - "selected": false, - "text": "", - "value": "" - }, - "hide": 0, - "includeAll": false, - "label": "Datasource", - "multi": false, - "name": "datasource", - "options": [], - "query": "prometheus", - "queryValue": "", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "type": "datasource" - }, - { - "current": { - "selected": false, - "text": "", - "value": "" - }, - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "definition": "label_values(exported_service)", - "hide": 0, - "includeAll": false, - "multi": false, - "name": "service", - "options": [], - "query": { - "query": "label_values(exported_service)", - "refId": "StandardVariableQuery" - }, - "refresh": 1, - "regex": "/(.*)@.*/", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "current": { - "selected": true, - "text": [], - "value": [] - }, - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "definition": "", - "hide": 0, - "includeAll": true, - "multi": true, - "name": "entrypoint", - "options": [], - "query": "label_values(entrypoint)", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-1h", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, - "timezone": "", - "title": "Traefik", - "uid": "O23g2BeWk", - "version": 6, - "weekStart": "" - } -{{- end }} diff --git a/charts/traefik/templates/grafana-dashboard.yaml b/charts/traefik/templates/grafana-dashboard.yaml new file mode 100644 index 0000000..1dbcd78 --- /dev/null +++ b/charts/traefik/templates/grafana-dashboard.yaml @@ -0,0 +1,19 @@ +{{- if .Values.traefik.metrics.prometheus.serviceMonitor }} +{{- $files := .Files.Glob "dashboards/*.json" }} +{{- if $files }} +apiVersion: v1 +kind: ConfigMapList +items: +{{- range $path, $fileContents := $files }} +{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }} +- apiVersion: v1 + kind: ConfigMap + metadata: + name: {{ printf "%s-dashboard-%s" $.Release.Name $dashboardName | trunc 63 | trimSuffix "-" }} + labels: + grafana_dashboard: '1' + data: + {{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }} +{{- end }} +{{- end }} +{{- end }} diff --git a/eks/README.adoc b/eks/README.adoc index 2262ace..2f4c313 100644 --- a/eks/README.adoc +++ b/eks/README.adoc @@ -53,7 +53,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v6.1.0"` +Default: `"v6.1.1"` ==== [[input_enable_service_monitor]] <> @@ -172,7 +172,7 @@ Description: ID to pass other modules in order to refer to this module as a depe |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v6.1.0"` +|`"v6.1.1"` |no |[[input_enable_service_monitor]] <> diff --git a/kind/README.adoc b/kind/README.adoc index d27f299..fdace57 100644 --- a/kind/README.adoc +++ b/kind/README.adoc @@ -65,7 +65,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v6.1.0"` +Default: `"v6.1.1"` ==== [[input_enable_service_monitor]] <> @@ -204,7 +204,7 @@ Description: External IP address of Traefik LB service. |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v6.1.0"` +|`"v6.1.1"` |no |[[input_enable_service_monitor]] <> diff --git a/nodeport/README.adoc b/nodeport/README.adoc index 69fb723..f2bf4e8 100644 --- a/nodeport/README.adoc +++ b/nodeport/README.adoc @@ -53,7 +53,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v6.1.0"` +Default: `"v6.1.1"` ==== [[input_enable_service_monitor]] <> @@ -172,7 +172,7 @@ Description: ID to pass other modules in order to refer to this module as a depe |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v6.1.0"` +|`"v6.1.1"` |no |[[input_enable_service_monitor]] <> diff --git a/scaleway/README.adoc b/scaleway/README.adoc index 2262ace..2f4c313 100644 --- a/scaleway/README.adoc +++ b/scaleway/README.adoc @@ -53,7 +53,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v6.1.0"` +Default: `"v6.1.1"` ==== [[input_enable_service_monitor]] <> @@ -172,7 +172,7 @@ Description: ID to pass other modules in order to refer to this module as a depe |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v6.1.0"` +|`"v6.1.1"` |no |[[input_enable_service_monitor]] <> diff --git a/sks/README.adoc b/sks/README.adoc index 6c87181..5748c40 100644 --- a/sks/README.adoc +++ b/sks/README.adoc @@ -75,7 +75,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v6.1.0"` +Default: `"v6.1.1"` ==== [[input_enable_service_monitor]] <> @@ -212,7 +212,7 @@ Description: ID to pass other modules in order to refer to this module as a depe |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v6.1.0"` +|`"v6.1.1"` |no |[[input_enable_service_monitor]] <>