From c6dafb4811f36895eedb9c72b3c4b16ef0994d97 Mon Sep 17 00:00:00 2001 From: Jason Plum Date: Thu, 8 Aug 2019 15:46:08 -0400 Subject: [PATCH 01/25] Grafana: support for deploying configured grafana Add ability to deployed upstream Grafana Helm chart https://github.com/helm/charts/tree/master/stable/grafana This includes version 3.5.10 of the stable/grafana chart, as a requirement of the gitlab/gitlab-grafana sub-chart. The sub-chart provides configuration, dashboards, and an Ingress for the deployed Grafana instance. Currently: - Grafana username is `root`, to be consistent with GitLab. Future OAuth work may change or disable this. - Grafana `admin` password is set as a static string in the template output. This will need replaced. - Dashboards are those from Omnibus GitLab. These will need to be made specifically for the Charts before "complete" Signed-off-by: Jason Plum Signed-off-by: Gerard Hickey --- .../gitlab/charts/gitlab-grafana/Chart.yaml | 17 + .../charts/gitlab-grafana/requirements.yaml | 4 + .../templates/_import-secret.sh | 16 + .../templates/dashboards/gitaly.yaml | 623 +++++++++ .../templates/dashboards/nginx.yaml | 558 +++++++++ .../templates/dashboards/overview.yaml | 1004 +++++++++++++++ .../templates/dashboards/postgresql.yaml | 917 ++++++++++++++ .../templates/dashboards/rails-app.yaml | 498 ++++++++ .../templates/dashboards/redis.yaml | 1109 +++++++++++++++++ .../templates/dashboards/registry.yaml | 521 ++++++++ .../templates/datasource-configmap.yaml | 24 + .../templates/import-secret.yaml | 12 + .../gitlab-grafana/templates/ingress.yaml | 41 + .../gitlab-grafana/templates/secret.yaml | 12 + .../gitlab/charts/gitlab-grafana/values.yaml | 35 + charts/gitlab/values.yaml | 3 + 16 files changed, 5394 insertions(+) create mode 100644 charts/gitlab/charts/gitlab-grafana/Chart.yaml create mode 100644 charts/gitlab/charts/gitlab-grafana/requirements.yaml create mode 100644 charts/gitlab/charts/gitlab-grafana/templates/_import-secret.sh create mode 100644 charts/gitlab/charts/gitlab-grafana/templates/dashboards/gitaly.yaml create mode 100644 charts/gitlab/charts/gitlab-grafana/templates/dashboards/nginx.yaml create mode 100644 charts/gitlab/charts/gitlab-grafana/templates/dashboards/overview.yaml create mode 100644 charts/gitlab/charts/gitlab-grafana/templates/dashboards/postgresql.yaml create mode 100644 charts/gitlab/charts/gitlab-grafana/templates/dashboards/rails-app.yaml create mode 100644 charts/gitlab/charts/gitlab-grafana/templates/dashboards/redis.yaml create mode 100644 charts/gitlab/charts/gitlab-grafana/templates/dashboards/registry.yaml create mode 100644 charts/gitlab/charts/gitlab-grafana/templates/datasource-configmap.yaml create mode 100644 charts/gitlab/charts/gitlab-grafana/templates/import-secret.yaml create mode 100644 charts/gitlab/charts/gitlab-grafana/templates/ingress.yaml create mode 100644 charts/gitlab/charts/gitlab-grafana/templates/secret.yaml create mode 100644 charts/gitlab/charts/gitlab-grafana/values.yaml diff --git a/charts/gitlab/charts/gitlab-grafana/Chart.yaml b/charts/gitlab/charts/gitlab-grafana/Chart.yaml new file mode 100644 index 0000000000..80699f87ca --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/Chart.yaml @@ -0,0 +1,17 @@ +--- +apiVersion: v1 +name: gitlab-grafana +version: 0.1.0 +appVersion: 3.5.10 +description: Embedded Grafana app for GitLab metrics +keywords: +- gitlab +- grafana +home: https://about.gitlab.com/ +icon: https://gitlab.com/gitlab-com/gitlab-artwork/raw/master/logo/logo-square.svg +sources: +- https://gitlab.com/charts/gitlab/tree/master/charts/gitlab/charts/gitlab-grafana +- https://gitlab.com/gitlab-org/build/CNG/tree/master/gitlab-grafana +maintainers: +- name: GitLab Inc. + email: support@gitlab.com diff --git a/charts/gitlab/charts/gitlab-grafana/requirements.yaml b/charts/gitlab/charts/gitlab-grafana/requirements.yaml new file mode 100644 index 0000000000..45665707bf --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/requirements.yaml @@ -0,0 +1,4 @@ +dependencies: +- name: grafana + version: 3.5.10 + repository: https://kubernetes-charts.storage.googleapis.com/ diff --git a/charts/gitlab/charts/gitlab-grafana/templates/_import-secret.sh b/charts/gitlab/charts/gitlab-grafana/templates/_import-secret.sh new file mode 100644 index 0000000000..5ad8814b66 --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/templates/_import-secret.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +PW_FILE='/tmp/initial/password' + +# If the password file exists, set the admin password using the contents +if [ -r "$PW_FILE" ]; then + echo "GitLab shim: Setting admin username to root" + export GF_SECURITY_ADMIN_USER="root" + + read -r line < "$PW_FILE" + echo "GitLab shim: Setting admin password in environment" + export GF_SECURITY_ADMIN_PASSWORD="$line" +fi + +# Start up the full grafana service +exec /run.sh diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/gitaly.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/gitaly.yaml new file mode 100644 index 0000000000..61715280c5 --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/gitaly.yaml @@ -0,0 +1,623 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "fullname" . }}-gitaly-dashboard + namespace: {{ .Release.Namespace }} + labels: + gitlab_grafana_dashboard: "true" +{{ include "gitlab.standardLabels" . | indent 4 }} +data: + gitaly.json: | + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "iteration": 1556019962975, + "links": [], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "fill": 1, + "gridPos": { + "h": 9, + "w": 11, + "x": 0, + "y": 0 + }, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(process_cpu_seconds_total{job=\"gitaly\",instance=~\"$instance\"}[$__interval])", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "{{"{{instance}}"}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "CPU", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": null, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "GitLab Omnibus", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 11, + "y": 0 + }, + "id": 4, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "version", + "targets": [ + { + "expr": "topk(1, count by (version) (gitlab_build_info{job=\"gitaly\",instance=~\"$instance\"}))", + "format": "table", + "instant": true, + "intervalFactor": 1, + "legendFormat": "{{"{{version}}"}}", + "refId": "A" + } + ], + "thresholds": "", + "title": "Gitaly Version", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "fill": 1, + "gridPos": { + "h": 9, + "w": 10, + "x": 14, + "y": 0 + }, + "id": 8, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "avg(go_goroutines{job=\"gitaly\",instance=~\"$instance\"})", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Go routines", + "refId": "A" + }, + { + "expr": "avg(process_open_fds{job=\"gitaly\",instance=~\"$instance\"})", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Open FDs (file descriptors)", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Resources", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#d44a3a", + "rgba(237, 129, 40, 0.89)", + "#299c46" + ], + "datasource": "GitLab Omnibus", + "format": "percentunit", + "gauge": { + "maxValue": 1, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 3, + "x": 11, + "y": 4 + }, + "id": 12, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "avg(avg_over_time(up{job=\"gitaly\"}[$__interval]))", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "0.8, 0.9", + "title": "Availability", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "fill": 1, + "gridPos": { + "h": 9, + "w": 11, + "x": 0, + "y": 9 + }, + "id": 6, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "avg(process_resident_memory_bytes{job=\"gitaly\",instance=~\"$instance\"})", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "RSS", + "refId": "A" + }, + { + "expr": "avg(go_memstats_next_gc_bytes{job=\"gitaly\",instance=~\"$instance\"})", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Next GC", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Memory", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "fill": 1, + "gridPos": { + "h": 9, + "w": 13, + "x": 11, + "y": 9 + }, + "id": 10, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum without (grpc_method,grpc_service,grpc_type) (\n rate(grpc_server_started_total{job=\"gitaly\",instance=~\"$instance\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "{{"{{instance}}"}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Request Rate", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "reqps", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "1m", + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "text": "All", + "value": "$__all" + }, + "datasource": "GitLab Omnibus", + "definition": "label_values(up{job=\"gitaly\"}, instance)", + "hide": 0, + "includeAll": true, + "label": null, + "multi": false, + "name": "instance", + "options": [], + "query": "label_values(up{job=\"gitaly\"}, instance)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-24h", + "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": "GitLab Omnibus - Gitaly", + "uid": "x6Z50y-iz", + "version": 3 + } diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/nginx.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/nginx.yaml new file mode 100644 index 0000000000..5d10c61176 --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/nginx.yaml @@ -0,0 +1,558 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "fullname" . }}-nginx-dashboard + namespace: {{ .Release.Namespace }} + labels: + gitlab_grafana_dashboard: "true" +{{ include "gitlab.standardLabels" . | indent 4 }} +data: + nginx.json: | + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "fill": 1, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum by (instance) (\n rate(nginx_vts_upstream_request_seconds_total{instance=~\"$instance\"}[$__interval])\n) /\nsum by (instance) (\n rate(nginx_vts_upstream_requests_total{instance=~\"$instance\"}[$__interval])\n)", + "format": "heatmap", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "{{"{{instance}}"}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Latency", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "s", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 11 + }, + "id": 4, + "panels": [], + "title": "Throughput", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "fill": 2, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 12 + }, + "id": 6, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum without (instance) (\n rate(nginx_vts_server_bytes_total{instance=~\"$instance\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "{{"{{direction}}-{{host}}"}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Server - Current total of incoming / outgoing bytes", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "decbytes", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "fill": 1, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 12 + }, + "id": 8, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum without (instance) (\n rate(nginx_vts_upstream_bytes_total{instance=~\"$instance\"}[$__interval])\n)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{"{{direction}}-{{backend}}-{{upstream}}"}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Upstream - Current total of incoming / outgoing bytes", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "decbytes", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 20 + }, + "id": 14, + "panels": [], + "title": "Requests by HTTP code", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "fill": 2, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 21 + }, + "id": 10, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum without (instance) (\n rate(nginx_vts_server_requests_total{instance=~\"$instance\"}[$__interval])\n)", + "format": "time_series", + "instant": false, + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "{{"{{code}} {{host}}"}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Server - Requests by HTTP code", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": null, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "fill": 2, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 21 + }, + "id": 12, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum without (instance) (\n rate(nginx_vts_upstream_requests_total{instance=~\"$instance\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "{{"{{code}} {{backend}} {{upstream }}"}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Upstream - Requests by HTTP code", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "1m", + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "text": "All", + "value": "$__all" + }, + "datasource": "GitLab Omnibus", + "definition": "label_values(up{job=\"nginx\"}, instance)", + "hide": 0, + "includeAll": true, + "label": null, + "multi": false, + "name": "instance", + "options": [], + "query": "label_values(up{job=\"nginx\"}, instance)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-6h", + "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": "GitLab Omnibus - NGINX VTS", + "uid": "SIHl30qik", + "version": 7 + } diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/overview.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/overview.yaml new file mode 100644 index 0000000000..f56f0f4e30 --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/overview.yaml @@ -0,0 +1,1004 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "fullname" . }}-overview-dashboard + namespace: {{ .Release.Namespace }} + labels: + gitlab_grafana_dashboard: "true" +{{ include "gitlab.standardLabels" . | indent 4 }} +data: + overview.json: | + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "GitLab Omnibus Dashboard (>= 10.3)", + "editable": true, + "gnetId": 5774, + "graphTooltip": 0, + "iteration": 1556024863891, + "links": [ + { + "icon": "external link", + "tags": [], + "title": "GitLab Docs", + "tooltip": "", + "type": "link", + "url": "https://docs.gitlab.com/" + } + ], + "panels": [ + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#d44a3a", + "rgba(237, 129, 40, 0.89)", + "#299c46" + ], + "datasource": "GitLab Omnibus", + "format": "percentunit", + "gauge": { + "maxValue": 1, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 0, + "y": 0 + }, + "id": 6, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "avg(\n avg_over_time(up{job=~\"gitlab-(rails|unicorn)\",instance=~\"($node):.*\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": ".95,.99", + "title": "Unicorn Up", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#d44a3a", + "rgba(237, 129, 40, 0.89)", + "#299c46" + ], + "datasource": "GitLab Omnibus", + "format": "percentunit", + "gauge": { + "maxValue": 1, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 4, + "y": 0 + }, + "id": 9, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "avg(\n avg_over_time(pg_up{instance=~\"($node):.*\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": ".95,.99", + "title": "Postgres Up", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#d44a3a", + "rgba(237, 129, 40, 0.89)", + "#299c46" + ], + "datasource": "GitLab Omnibus", + "format": "percentunit", + "gauge": { + "maxValue": 1, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 8, + "y": 0 + }, + "id": 7, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "avg(\n avg_over_time(up{job=\"gitlab-sidekiq\",instance=~\"($node):.*\"}[$__interval])\n) ", + "format": "time_series", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": ".95,.99", + "title": "Sidekiq Up", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#d44a3a", + "rgba(237, 129, 40, 0.89)", + "#299c46" + ], + "datasource": "GitLab Omnibus", + "format": "percentunit", + "gauge": { + "maxValue": 1, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 12, + "y": 0 + }, + "id": 8, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "avg(\n avg_over_time(up{job=\"gitlab-workhorse\",instance=~\"($node):.*\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": ".95,.99", + "title": "Workhorse Up", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#d44a3a", + "rgba(237, 129, 40, 0.89)", + "#299c46" + ], + "datasource": "GitLab Omnibus", + "format": "percentunit", + "gauge": { + "maxValue": 1, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 16, + "y": 0 + }, + "id": 5, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "avg(\n avg_over_time(redis_up{instance=~\"$node:9121\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": ".95,.99", + "title": "Redis Up", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#d44a3a", + "rgba(237, 129, 40, 0.89)", + "#299c46" + ], + "datasource": "GitLab Omnibus", + "format": "percentunit", + "gauge": { + "maxValue": 1, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 20, + "y": 0 + }, + "id": 10, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "avg(\n avg_over_time(up{job=\"gitaly\",instance=~\"($node):.*\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": ".95,.99", + "title": "Gitaly Up", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#d44a3a", + "rgba(237, 129, 40, 0.89)", + "#299c46" + ], + "datasource": "GitLab Omnibus", + "decimals": 1, + "format": "percentunit", + "gauge": { + "maxValue": 1, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 8, + "x": 0, + "y": 4 + }, + "id": 1, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "expr": "(\n node_memory_MemAvailable_bytes{instance=~\"$node:9100\"} or\n (node_memory_MemFree_bytes{instance=~\"$node:9100\"} + node_memory_Buffers_bytes{instance=~\"$node:9100\"} + node_memory_Cached_bytes{instance=~\"$node:9100\"})\n) / node_memory_MemTotal_bytes{instance=~\"$node:9100\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "", + "refId": "B" + } + ], + "thresholds": "0.05, 0.1", + "title": "Node Available Memory", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#d44a3a", + "rgba(237, 129, 40, 0.89)", + "#299c46" + ], + "datasource": "GitLab Omnibus", + "decimals": 1, + "format": "percentunit", + "gauge": { + "maxValue": 1, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 8, + "x": 8, + "y": 4 + }, + "id": 4, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "expr": "sum(node_filesystem_avail_bytes{fstype!~\"tmpfs\",instance=~\"($node):9100\"}) / sum(node_filesystem_size_bytes{fstype!~\"tmpfs\",instance=~\"($node):9100\"})", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "", + "refId": "B" + } + ], + "thresholds": "0.1, 0.2", + "title": "Node Disk Free", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "GitLab Omnibus", + "decimals": 1, + "format": "percentunit", + "gauge": { + "maxValue": 1, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 5, + "w": 8, + "x": 16, + "y": 4 + }, + "id": 11, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "expr": "avg(\n 1 -\n avg without (mode,cpu) (\n rate(node_cpu_seconds_total{mode=\"idle\",instance=~\"($node):9100\"}[$__interval])\n )\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "", + "refId": "B" + } + ], + "thresholds": ".8,.9", + "title": "CPU Load", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "fill": 1, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 12, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(\n avg_over_time(\n sidekiq_queue_size{instance=~\"($node):.*\"}[$__interval]\n )\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "Queued", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Sidekiq Queue", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": null, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "cards": { + "cardPadding": null, + "cardRound": null + }, + "color": { + "cardColor": "#b4ff00", + "colorScale": "sqrt", + "colorScheme": "interpolateOranges", + "exponent": 0.5, + "mode": "opacity" + }, + "dataFormat": "tsbuckets", + "datasource": "GitLab Omnibus", + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 9 + }, + "heatmap": {}, + "highlightCards": true, + "id": 13, + "legend": { + "show": false + }, + "links": [], + "targets": [ + { + "expr": "sum by (le) (\n rate(gitlab_workhorse_http_request_duration_seconds_bucket{instance=~\"($node):9229\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 5, + "legendFormat": "{{"{{le}}"}}", + "refId": "B" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Workhorse Latency", + "tooltip": { + "show": true, + "showHistogram": false + }, + "type": "heatmap", + "xAxis": { + "show": true + }, + "xBucketNumber": null, + "xBucketSize": null, + "yAxis": { + "decimals": 0, + "format": "s", + "logBase": 1, + "max": null, + "min": null, + "show": true, + "splitFactor": null + }, + "yBucketBound": "auto", + "yBucketNumber": null, + "yBucketSize": null + } + ], + "refresh": "1m", + "schemaVersion": 18, + "style": "dark", + "tags": [ + "GitLab" + ], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "tags": [], + "text": "All", + "value": "$__all" + }, + "datasource": "GitLab Omnibus", + "definition": "", + "hide": 0, + "includeAll": true, + "label": null, + "multi": false, + "name": "node", + "options": [], + "query": "label_values(up{job=\"node\"}, instance)", + "refresh": 1, + "regex": "/(.*):9100/", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-3h", + "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": "GitLab Omnibus - Overview", + "uid": "wsSteMemz", + "version": 21 + } diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/postgresql.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/postgresql.yaml new file mode 100644 index 0000000000..6e38998762 --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/postgresql.yaml @@ -0,0 +1,917 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "fullname" . }}-postgresql-dashboard + namespace: {{ .Release.Namespace }} + labels: + gitlab_grafana_dashboard: "true" +{{ include "gitlab.standardLabels" . | indent 4 }} +data: + postgresql.json: | + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "iteration": 1556027304979, + "links": [], + "panels": [ + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#d44a3a", + "rgba(237, 129, 40, 0.89)", + "#299c46" + ], + "datasource": "GitLab Omnibus", + "format": "percentunit", + "gauge": { + "maxValue": 1, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 0, + "y": 0 + }, + "id": 2, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "avg_over_time(pg_up{job=\"postgres\",instance=~\"$instance\"}[$__interval]) or avg_over_time(up{job=\"postgres\",instance=~\"$instance\"}[$__interval]) ", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "0.8, 0.9", + "title": "Availability", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#d44a3a", + "rgba(237, 129, 40, 0.89)", + "#299c46" + ], + "datasource": "GitLab Omnibus", + "format": "dtdurations", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 4, + "y": 0 + }, + "id": 10, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "avg(time() - pg_postmaster_start_time_seconds{instance=~\"$instance\"})", + "format": "time_series", + "instant": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "60, 3600", + "title": "Postmaster Uptime", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "fill": 1, + "gridPos": { + "h": 8, + "w": 8, + "x": 8, + "y": 0 + }, + "id": 8, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum by (mode) (\n avg_over_time(pg_locks_count{instance=~\"$instance\",datname=\"gitlabhq_production\"}[$__interval])\n)", + "format": "time_series", + "interval": "30s", + "intervalFactor": 1, + "legendFormat": "{{"{{mode}}"}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Locks", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "fill": 0, + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 0 + }, + "id": 4, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "Last Week", + "dashes": true + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(\n rate(pg_slow_queries{instance=~\"$instance\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "Current", + "refId": "A" + }, + { + "expr": "sum(\n rate(pg_slow_queries{instance=~\"$instance\"}[$__interval] offset 1w)\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "Last Week", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Slow Queries", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "ops", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "GitLab Omnibus", + "decimals": 1, + "format": "percentunit", + "gauge": { + "maxValue": 1, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 0, + "y": 4 + }, + "id": 13, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "sum(avg_over_time(pg_stat_activity_count{instance=~\"$instance\",state=\"active\"}[$__interval])) /\nsum(pg_settings_max_connections{instance=~\"$instance\"})", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "0.8, 0.9", + "title": "Active Connections", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "GitLab Omnibus", + "format": "percentunit", + "gauge": { + "maxValue": 1, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 4, + "y": 4 + }, + "id": 12, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "sum(avg_over_time(pg_stat_activity_count{instance=~\"$instance\"}[$__interval])) /\nsum(pg_settings_max_connections{instance=~\"$instance\"})", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "0.8, 0.9", + "title": "Connections", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "fill": 1, + "gridPos": { + "h": 9, + "w": 8, + "x": 0, + "y": 8 + }, + "id": 15, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(\n rate(pg_stat_database_xact_commit{instance=~\"$instance\",datname=\"gitlabhq_production\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "Commit", + "refId": "A" + }, + { + "expr": "sum(\n rate(pg_stat_database_xact_rollback{instance=~\"$instance\",datname=\"gitlabhq_production\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "Rollback", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Transactions", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "fill": 1, + "gridPos": { + "h": 9, + "w": 8, + "x": 8, + "y": 8 + }, + "id": 17, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(\n rate(pg_stat_database_blks_hit{instance=~\"$instance\",datname=\"gitlabhq_production\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "Cache Hits", + "refId": "B" + }, + { + "expr": "sum(\n rate(pg_stat_database_blks_read{instance=~\"$instance\",datname=\"gitlabhq_production\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "Reads", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Block IO", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "fill": 1, + "gridPos": { + "h": 9, + "w": 8, + "x": 16, + "y": 8 + }, + "id": 6, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(\n rate(pg_stat_database_tup_fetched{instance=~\"$instance\",datname=\"gitlabhq_production\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "Fetched", + "refId": "A" + }, + { + "expr": "sum(\n rate(pg_stat_database_tup_deleted{instance=~\"$instance\",datname=\"gitlabhq_production\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "Deleted", + "refId": "B" + }, + { + "expr": "sum(\n rate(pg_stat_database_tup_inserted{instance=~\"$instance\",datname=\"gitlabhq_production\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "Inserted", + "refId": "C" + }, + { + "expr": "sum(\n rate(pg_stat_database_tup_updated{instance=~\"$instance\",datname=\"gitlabhq_production\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "Updated", + "refId": "D" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Tuple Stats", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "1m", + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "tags": [], + "text": "All", + "value": "$__all" + }, + "datasource": "GitLab Omnibus", + "definition": "", + "hide": 0, + "includeAll": true, + "label": null, + "multi": false, + "name": "instance", + "options": [], + "query": "label_values(up{job=\"postgres\"}, instance)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-24h", + "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": "GitLab Omnibus - PostgreSQL", + "uid": "c_LJgXfmk", + "version": 10 + } diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/rails-app.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/rails-app.yaml new file mode 100644 index 0000000000..5469a79e06 --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/rails-app.yaml @@ -0,0 +1,498 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "fullname" . }}-rails-app-dashboard + namespace: {{ .Release.Namespace }} + labels: + gitlab_grafana_dashboard: "true" +{{ include "gitlab.standardLabels" . | indent 4 }} +data: + rails-app.json: | + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 10, + "iteration": 1561446858259, + "links": [], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "description": "", + "fill": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 5, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "avg(avg_over_time(ruby_process_resident_memory_bytes{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval])) or \navg(avg_over_time(ruby_memory_bytes{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval]))", + "format": "time_series", + "interval": "30s", + "intervalFactor": 1, + "legendFormat": "Average", + "refId": "A" + }, + { + "expr": "max(max_over_time(ruby_process_resident_memory_bytes{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval])) or\nmax(max_over_time(ruby_memory_bytes{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval]))", + "format": "time_series", + "interval": "30s", + "intervalFactor": 1, + "legendFormat": "Max", + "refId": "B" + }, + { + "expr": "min(min_over_time(ruby_process_resident_memory_bytes{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval])) or\nmin(min_over_time(ruby_memory_bytes{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval]))", + "format": "time_series", + "interval": "30s", + "intervalFactor": 1, + "legendFormat": "Min", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Ruby Memory", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "description": "", + "fill": 1, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(avg_over_time(unicorn_queued_connections{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval])) or\nsum(avg_over_time(puma_queued_connections{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval]))\n", + "format": "time_series", + "interval": "30s", + "intervalFactor": 1, + "legendFormat": "Queued Requests", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Queued Requests", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "fill": 1, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 7, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "avg(rate(ruby_process_cpu_seconds_total{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval]))", + "format": "time_series", + "interval": "30s", + "intervalFactor": 1, + "legendFormat": "Average", + "refId": "A" + }, + { + "expr": "max(rate(ruby_process_cpu_seconds_total{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval]))", + "format": "time_series", + "interval": "30s", + "intervalFactor": 1, + "legendFormat": "Max", + "refId": "B" + }, + { + "expr": "min(rate(ruby_process_cpu_seconds_total{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval]))", + "format": "time_series", + "interval": "30s", + "intervalFactor": 1, + "legendFormat": "Min", + "refId": "D" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Ruby CPU", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "description": "", + "fill": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 9 + }, + "id": 3, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "Available Workers", + "dashes": true, + "linewidth": 2 + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(avg_over_time(unicorn_active_connections{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval])) or\nsum(avg_over_time(puma_active_connections{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval]))", + "format": "time_series", + "interval": "30s", + "intervalFactor": 1, + "legendFormat": "Average", + "refId": "A" + }, + { + "expr": "sum(max_over_time(unicorn_active_connections{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval])) or\nsum(max_over_time(puma_active_connections{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval]))", + "format": "time_series", + "interval": "30s", + "intervalFactor": 1, + "legendFormat": "Max", + "refId": "B" + }, + { + "expr": "count(avg_over_time(ruby_memory_bytes{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval])) or\nsum(avg_over_time(puma_max_threads{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval]))", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "Available Workers", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Active Requests", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "1m", + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "text": "All", + "value": "$__all" + }, + "datasource": "GitLab Omnibus", + "definition": "label_values(unicorn_active_connections, instance)", + "hide": 0, + "includeAll": true, + "label": null, + "multi": false, + "name": "instance", + "options": [], + "query": "label_values(unicorn_active_connections, instance)", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-24h", + "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": "GitLab Omnibus - Rails App", + "uid": "36owr67Wz", + "version": 7 + } diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/redis.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/redis.yaml new file mode 100644 index 0000000000..16f78202e4 --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/redis.yaml @@ -0,0 +1,1109 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "fullname" . }}-redis-dashboard + namespace: {{ .Release.Namespace }} + labels: + gitlab_grafana_dashboard: "true" +{{ include "gitlab.standardLabels" . | indent 4 }} +data: + redis.json: | + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "GitLab Omnibus dashboard for Redis servers", + "editable": true, + "gnetId": 763, + "graphTooltip": 0, + "iteration": 1556027798221, + "links": [], + "panels": [ + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "datasource": "GitLab Omnibus", + "decimals": 0, + "editable": true, + "error": false, + "format": "dtdurations", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 0, + "y": 0 + }, + "id": 9, + "interval": null, + "isNew": true, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "addr", + "targets": [ + { + "expr": "avg(time() - redis_start_time_seconds{instance=~\"$instance\"})", + "format": "time_series", + "instant": true, + "interval": "", + "intervalFactor": 2, + "legendFormat": "", + "metric": "", + "refId": "A", + "step": 1800 + } + ], + "thresholds": "", + "title": "Uptime", + "type": "singlestat", + "valueFontSize": "70%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "datasource": "GitLab Omnibus", + "decimals": 0, + "editable": true, + "error": false, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 4, + "y": 0 + }, + "hideTimeOverride": true, + "id": 12, + "interval": null, + "isNew": true, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true + }, + "tableColumn": "", + "targets": [ + { + "expr": "sum(\n avg_over_time(redis_connected_clients{instance=~\"$instance\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "", + "metric": "", + "refId": "A", + "step": 2 + } + ], + "thresholds": "", + "timeFrom": "1m", + "timeShift": null, + "title": "Clients", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "editable": true, + "error": false, + "fill": 1, + "grid": {}, + "gridPos": { + "h": 6, + "w": 8, + "x": 8, + "y": 0 + }, + "id": 2, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(\n rate(redis_commands_processed_total{instance=~\"$instance\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "", + "metric": "A", + "refId": "A", + "step": 240, + "target": "" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Commands Executed", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "reqps", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "decimals": 2, + "editable": true, + "error": false, + "fill": 1, + "grid": {}, + "gridPos": { + "h": 6, + "w": 8, + "x": 16, + "y": 0 + }, + "id": 1, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "paceLength": 10, + "percentage": true, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(\n rate(redis_keyspace_hits_total{instance=~\"$instance\"}[$__interval])\n)", + "format": "time_series", + "hide": false, + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "hits", + "metric": "", + "refId": "A", + "step": 240, + "target": "" + }, + { + "expr": "sum(\n rate(redis_keyspace_misses_total{instance=~\"$instance\"}[$__interval])\n)", + "format": "time_series", + "hide": false, + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "misses", + "metric": "", + "refId": "B", + "step": 240, + "target": "" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Hits, Misses per Second", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "", + "logBase": 1, + "max": null, + "min": 0, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": { + "max": "#BF1B00" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "editable": true, + "error": false, + "fill": 1, + "grid": {}, + "gridPos": { + "h": 10, + "w": 8, + "x": 0, + "y": 3 + }, + "id": 7, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "hideEmpty": false, + "hideZero": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "null as zero", + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "/max - .*/", + "dashes": true + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "redis_memory_used_bytes{instance=~\"$instance\"}", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{"used - {{instance}}"}}", + "metric": "", + "refId": "A", + "step": 240, + "target": "" + }, + { + "expr": "redis_config_maxmemory{instance=~\"$instance\"} > 0", + "format": "time_series", + "hide": false, + "intervalFactor": 2, + "legendFormat": "{{"max - {{instance}}"}}", + "refId": "B", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Memory Usage", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "label": null, + "logBase": 1, + "max": null, + "min": 0, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": { + "evicts": "#890F02", + "memcached_items_evicted_total{instance=\"172.17.0.1:9150\",job=\"prometheus\"}": "#890F02", + "reclaims": "#3F6833" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "editable": true, + "error": false, + "fill": 1, + "grid": {}, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 6 + }, + "id": 8, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "reclaims", + "yaxis": 2 + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(redis_expired_keys_total{instance=~\"$instance\"}[$__interval]))", + "format": "time_series", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "expired", + "metric": "", + "refId": "A", + "step": 240, + "target": "" + }, + { + "expr": "sum(rate(redis_evicted_keys_total{instance=~\"$instance\"}[$__interval]))", + "format": "time_series", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "evicted", + "refId": "B", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Expired / Evicted", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "editable": true, + "error": false, + "fill": 1, + "grid": {}, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 6 + }, + "id": 10, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(\n rate(redis_net_input_bytes_total{instance=~\"$instance\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "In", + "refId": "A", + "step": 240 + }, + { + "expr": "sum(\n rate(redis_net_output_bytes_total{instance=~\"$instance\"}[$__interval])\n)", + "format": "time_series", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "Out", + "refId": "B", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Network I/O", + "tooltip": { + "msResolution": true, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "Bps", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "editable": true, + "error": false, + "fill": 8, + "grid": {}, + "gridPos": { + "h": 7, + "w": 16, + "x": 0, + "y": 13 + }, + "id": 14, + "isNew": true, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "expr": "sum without (instance) (\n rate(redis_commands_total{instance=~\"$instance\"}[$__interval])\n) > 0", + "format": "time_series", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "{{"{{ cmd }}"}}", + "metric": "redis_command_calls_total", + "refId": "A", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Command Calls / sec", + "tooltip": { + "msResolution": true, + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "editable": true, + "error": false, + "fill": 7, + "grid": {}, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 13 + }, + "id": 13, + "isNew": true, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "expr": "sum(redis_db_keys{instance=~\"$instance\"} - redis_db_keys_expiring{instance=~\"$instance\"}) ", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "not expiring", + "refId": "A", + "step": 240, + "target": "" + }, + { + "expr": "sum(redis_db_keys_expiring{instance=~\"$instance\"})", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "expiring", + "metric": "", + "refId": "B", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Expiring vs Not-Expiring Keys", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "editable": true, + "error": false, + "fill": 7, + "grid": {}, + "gridPos": { + "h": 7, + "w": 16, + "x": 0, + "y": 20 + }, + "id": 5, + "isNew": true, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "paceLength": 10, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": false, + "targets": [ + { + "expr": "sum by (db) (\n redis_db_keys{instance=~\"$instance\"}\n)", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{"{{ db }}"}}", + "refId": "A", + "step": 240, + "target": "" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Items per DB", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "1m", + "schemaVersion": 18, + "style": "dark", + "tags": [ + "redis" + ], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "tags": [], + "text": "All", + "value": "$__all" + }, + "datasource": "GitLab Omnibus", + "definition": "", + "hide": 0, + "includeAll": true, + "label": null, + "multi": false, + "name": "instance", + "options": [], + "query": "label_values(up{job=\"redis\"}, instance)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-24h", + "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": "GitLab Omnibus - Redis", + "uid": "XDaNK6amz", + "version": 7 + } diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/registry.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/registry.yaml new file mode 100644 index 0000000000..5c5d896256 --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/registry.yaml @@ -0,0 +1,521 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "fullname" . }}-registry-dashboard + namespace: {{ .Release.Namespace }} + labels: + gitlab_grafana_dashboard: "true" +{{ include "gitlab.standardLabels" . | indent 4 }} +data: + registry.json: | + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "fill": 1, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 5, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum by (handler) (\n rate(registry_http_requests_total{instance=\"$instance\",handler=~\"$handler\"}[$__interval])\n)", + "format": "time_series", + "interval": "30s", + "intervalFactor": 1, + "legendFormat": "{{"{{handler}}"}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Requests", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "cards": { + "cardPadding": null, + "cardRound": null + }, + "color": { + "cardColor": "#b4ff00", + "colorScale": "sqrt", + "colorScheme": "interpolateOranges", + "exponent": 0.5, + "mode": "opacity" + }, + "dataFormat": "tsbuckets", + "datasource": "GitLab Omnibus", + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 0 + }, + "heatmap": {}, + "hideZeroBuckets": false, + "highlightCards": true, + "id": 8, + "legend": { + "show": false + }, + "links": [], + "reverseYBuckets": false, + "targets": [ + { + "expr": "sum by (le) (\n rate(registry_http_request_duration_seconds_bucket{instance=\"$instance\",handler=~\"$handler\"}[$__interval])\n) > 0", + "format": "heatmap", + "interval": "30s", + "intervalFactor": 10, + "legendFormat": "{{"{{le}}"}}", + "refId": "A" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Latency", + "tooltip": { + "show": true, + "showHistogram": false + }, + "type": "heatmap", + "xAxis": { + "show": true + }, + "xBucketNumber": null, + "xBucketSize": null, + "yAxis": { + "decimals": 0, + "format": "s", + "logBase": 1, + "max": null, + "min": null, + "show": true, + "splitFactor": null + }, + "yBucketBound": "auto", + "yBucketNumber": null, + "yBucketSize": null + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "fill": 1, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 10 + }, + "id": 6, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum by (code) (\n rate(registry_http_requests_total{instance=\"$instance\"}[$__interval])\n)", + "format": "time_series", + "interval": "30s", + "intervalFactor": 1, + "legendFormat": "{{"{{code}}"}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Requests", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": ["#d44a3a", "rgba(237, 129, 40, 0.89)", "#299c46"], + "datasource": "GitLab Omnibus", + "format": "percentunit", + "gauge": { + "maxValue": 1, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 12, + "y": 10 + }, + "id": 3, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "sum(rate(registry_storage_cache_total{instance=\"$instance\",type=\"Hit\"}[$__interval])) / sum(rate(registry_storage_cache_total{instance=\"$instance\",type=\"Request\"}[$__interval]))", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "Ratio", + "refId": "A" + } + ], + "thresholds": "0.5, 0.75", + "timeFrom": null, + "timeShift": null, + "title": "Cache Hit Ratio", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "GitLab Omnibus", + "fill": 1, + "gridPos": { + "h": 10, + "w": 9, + "x": 15, + "y": 10 + }, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "paceLength": 10, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(registry_storage_cache_total{instance=\"$instance\",type=\"Request\"}[$__interval]))", + "format": "time_series", + "interval": "30s", + "intervalFactor": 1, + "legendFormat": "Requests", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Cache Requests", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "1m", + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "isNone": true, + "text": "None", + "value": "" + }, + "datasource": "GitLab Omnibus", + "definition": "label_values(up{job=\"registry\"}, instance)", + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "instance", + "options": [], + "query": "label_values(up{job=\"registry\"}, instance)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": { + "text": "All", + "value": ["$__all"] + }, + "datasource": "GitLab Omnibus", + "definition": "label_values(registry_http_requests_total{instance=\"$instance\"}, handler)", + "hide": 0, + "includeAll": true, + "label": null, + "multi": true, + "name": "handler", + "options": [], + "query": "label_values(registry_http_requests_total{instance=\"$instance\"}, handler)", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "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": "GitLab Omnibus - Registry", + "uid": "k7-rFGGZk", + "version": 8 + } + + diff --git a/charts/gitlab/charts/gitlab-grafana/templates/datasource-configmap.yaml b/charts/gitlab/charts/gitlab-grafana/templates/datasource-configmap.yaml new file mode 100644 index 0000000000..78f15a46c7 --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/templates/datasource-configmap.yaml @@ -0,0 +1,24 @@ +{{- if .Values.enabled -}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "fullname" . }}-datasource + namespace: {{ .Release.Namespace }} + labels: + gitlab_grafana_datasource: "true" +{{ include "gitlab.standardLabels" . | indent 4 }} +data: + gitlab.yaml: | + apiVersion: 1 + deleteDatasources: + - name: GitLab Omnibus + orgId: 1 + datasources: + - name: GitLab Omnibus + type: prometheus + orgId: 1 + url: "http://{{ .Release.Name }}-prometheus-server" + access: proxy + isDefault: true + editable: false +{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/import-secret.yaml b/charts/gitlab/charts/gitlab-grafana/templates/import-secret.yaml new file mode 100644 index 0000000000..7d4acaaecb --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/templates/import-secret.yaml @@ -0,0 +1,12 @@ +{{- if .Values.enabled -}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: gitlab-grafana-import-secret + namespace: {{ .Release.Namespace }} + labels: +{{ include "gitlab.standardLabels" . | indent 4 }} +data: + import-secret.sh: |- +{{ include (print $.Template.BasePath "/_import-secret.sh") . | indent 4 }} +{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/ingress.yaml b/charts/gitlab/charts/gitlab-grafana/templates/ingress.yaml new file mode 100644 index 0000000000..d55e35f023 --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/templates/ingress.yaml @@ -0,0 +1,41 @@ +{{- if .Values.enabled -}} +{{/* {{- if eq (include "gitlab.ingress.enabled" $) "true" -}} */}} +{{- $gitlabHostname := include "gitlab.gitlab.hostname" . -}} +{{- $tlsSecret := include "unicorn.tlsSecret" . -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-grafana + namespace: {{ $.Release.Namespace }} + labels: +{{ include "gitlab.standardLabels" . | indent 4 }} + annotations: + kubernetes.io/ingress.class: "{{ template "gitlab.ingressclass" . }}" + kubernetes.io/ingress.provider: nginx + nginx.ingress.kubernetes.io/proxy-body-size: {{ .Values.ingress.proxyBodySize | quote }} + nginx.ingress.kubernetes.io/proxy-read-timeout: {{ .Values.ingress.proxyReadTimeout | quote }} + nginx.ingress.kubernetes.io/proxy-connect-timeout: {{ .Values.ingress.proxyConnectTimeout | quote }} + nginx.ingress.kubernetes.io/rewrite-target: / + {{ include "gitlab.certmanager_annotations" . }} + {{- range $key, $value := merge .Values.ingress.annotations .Values.global.ingress.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} +spec: + rules: + - host: {{ $gitlabHostname }} + http: + paths: + - backend: + serviceName: {{ .Release.Name }}-grafana + servicePort: 80 + path: /-/grafana + {{- if (and $tlsSecret (eq (include "gitlab.ingress.tls.enabled" $) "true" )) }} + tls: + - hosts: + - {{ $gitlabHostname }} + secretName: {{ $tlsSecret }} + {{- else }} + tls: [] + {{- end }} +{{/* {{- end -}} */}} +{{- end -}} \ No newline at end of file diff --git a/charts/gitlab/charts/gitlab-grafana/templates/secret.yaml b/charts/gitlab/charts/gitlab-grafana/templates/secret.yaml new file mode 100644 index 0000000000..d680ae00a5 --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/templates/secret.yaml @@ -0,0 +1,12 @@ +{{- if .Values.enabled -}} +apiVersion: v1 +kind: Secret +metadata: + name: gitlab-grafana-initial-password + namespace: {{ $.Release.Namespace }} + labels: + secretType: initial-password +{{ include "gitlab.standardLabels" . | indent 4 }} +data: + password: {{ "foobar" | b64enc }} +{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/values.yaml b/charts/gitlab/charts/gitlab-grafana/values.yaml new file mode 100644 index 0000000000..cce92d35f8 --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/values.yaml @@ -0,0 +1,35 @@ + +enabled: true + +ingress: + tls: {} + annotations: {} + +grafana: + adminUser: admin + adminPassword: admin + ## The following settings allow Grafana to dynamically create + ## dashboards and datasources from configmaps. See + ## https://github.com/helm/charts/tree/master/stable/grafana#sidecar-for-dashboards + sidecar: + dashboards: + enabled: true + label: gitlab_grafana_dashboard + datasources: + enabled: true + label: gitlab_grafana_datasource + grafana.ini: + server: + root_url: http://localhost/-/grafana/ + extraSecretMounts: + - name: initial-password + mountPath: /tmp/initial + readOnly: true + secretName: gitlab-grafana-initial-password + defaultMode: 400 + extraConfigmapMounts: + - name: import-secret + mountPath: /tmp/scripts + configMap: gitlab-grafana-import-secret + readOnly: true + command: [ "sh", "-x", "/tmp/scripts/import-secret.sh" ] \ No newline at end of file diff --git a/charts/gitlab/values.yaml b/charts/gitlab/values.yaml index 72d12591f2..7299365ca6 100644 --- a/charts/gitlab/values.yaml +++ b/charts/gitlab/values.yaml @@ -35,3 +35,6 @@ global: gitlab-runner: enabled: false + +gitlab-grafana: + enabled: true -- GitLab From e1d45e1377e35369b76234f6fa0eeccda0d24bd0 Mon Sep 17 00:00:00 2001 From: Gerard Hickey Date: Fri, 9 Aug 2019 14:30:59 -0700 Subject: [PATCH 02/25] Made Grafana chart conditional on gitlab.gitlab-grafana.enabled setting --- charts/gitlab/charts/gitlab-grafana/requirements.yaml | 4 ---- requirements.yaml | 4 ++++ values.yaml | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) delete mode 100644 charts/gitlab/charts/gitlab-grafana/requirements.yaml diff --git a/charts/gitlab/charts/gitlab-grafana/requirements.yaml b/charts/gitlab/charts/gitlab-grafana/requirements.yaml deleted file mode 100644 index 45665707bf..0000000000 --- a/charts/gitlab/charts/gitlab-grafana/requirements.yaml +++ /dev/null @@ -1,4 +0,0 @@ -dependencies: -- name: grafana - version: 3.5.10 - repository: https://kubernetes-charts.storage.googleapis.com/ diff --git a/requirements.yaml b/requirements.yaml index 3618835926..b91c70d6b5 100644 --- a/requirements.yaml +++ b/requirements.yaml @@ -16,3 +16,7 @@ dependencies: version: 0.7.0 repository: https://charts.gitlab.io/ condition: gitlab-runner.install +- name: grafana + version: 3.5.12 + repository: https://kubernetes-charts.storage.googleapis.com/ + condition: gitlab.gitlab-grafana.enabled \ No newline at end of file diff --git a/values.yaml b/values.yaml index 41d1eeb7d8..3f0b80e0f5 100644 --- a/values.yaml +++ b/values.yaml @@ -481,3 +481,6 @@ gitlab-runner: ## doc/charts/gitlab/gitlab-shell # gitlab-shell: # enabled: false +## doc/charts/gitlab/gitlab-grafana +# gitlab-grafana: +# enabled: false -- GitLab From 9eb568860a8adbb0ca7ad9eae1cc2c287354e018 Mon Sep 17 00:00:00 2001 From: Gerard Hickey Date: Fri, 9 Aug 2019 14:32:55 -0700 Subject: [PATCH 03/25] Grafana dashboards are installed only when Grafana enabled --- .../charts/gitlab-grafana/templates/dashboards/gitaly.yaml | 2 ++ .../charts/gitlab-grafana/templates/dashboards/nginx.yaml | 2 ++ .../charts/gitlab-grafana/templates/dashboards/overview.yaml | 2 ++ .../gitlab-grafana/templates/dashboards/postgresql.yaml | 2 ++ .../charts/gitlab-grafana/templates/dashboards/rails-app.yaml | 2 ++ .../charts/gitlab-grafana/templates/dashboards/redis.yaml | 2 ++ .../charts/gitlab-grafana/templates/dashboards/registry.yaml | 4 ++-- 7 files changed, 14 insertions(+), 2 deletions(-) diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/gitaly.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/gitaly.yaml index 61715280c5..307ad1e933 100644 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/gitaly.yaml +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/gitaly.yaml @@ -1,3 +1,4 @@ +{{- if .Values.enabled -}} apiVersion: v1 kind: ConfigMap metadata: @@ -621,3 +622,4 @@ data: "uid": "x6Z50y-iz", "version": 3 } +{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/nginx.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/nginx.yaml index 5d10c61176..6de4949c1d 100644 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/nginx.yaml +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/nginx.yaml @@ -1,3 +1,4 @@ +{{- if .Values.enabled -}} apiVersion: v1 kind: ConfigMap metadata: @@ -556,3 +557,4 @@ data: "uid": "SIHl30qik", "version": 7 } +{{- end }} \ No newline at end of file diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/overview.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/overview.yaml index f56f0f4e30..8259e3d2f2 100644 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/overview.yaml +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/overview.yaml @@ -1,3 +1,4 @@ +{{- if .Values.enabled -}} apiVersion: v1 kind: ConfigMap metadata: @@ -1002,3 +1003,4 @@ data: "uid": "wsSteMemz", "version": 21 } +{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/postgresql.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/postgresql.yaml index 6e38998762..5012c6d459 100644 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/postgresql.yaml +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/postgresql.yaml @@ -1,3 +1,4 @@ +{{- if .Values.enabled -}} apiVersion: v1 kind: ConfigMap metadata: @@ -915,3 +916,4 @@ data: "uid": "c_LJgXfmk", "version": 10 } +{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/rails-app.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/rails-app.yaml index 5469a79e06..021154f51e 100644 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/rails-app.yaml +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/rails-app.yaml @@ -1,3 +1,4 @@ +{{- if .Values.enabled -}} apiVersion: v1 kind: ConfigMap metadata: @@ -496,3 +497,4 @@ data: "uid": "36owr67Wz", "version": 7 } +{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/redis.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/redis.yaml index 16f78202e4..8ee5c11c0a 100644 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/redis.yaml +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/redis.yaml @@ -1,3 +1,4 @@ +{{- if .Values.enabled -}} apiVersion: v1 kind: ConfigMap metadata: @@ -1107,3 +1108,4 @@ data: "uid": "XDaNK6amz", "version": 7 } +{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/registry.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/registry.yaml index 5c5d896256..2ea6287b90 100644 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/registry.yaml +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/registry.yaml @@ -1,3 +1,4 @@ +{{- if .Values.enabled -}} apiVersion: v1 kind: ConfigMap metadata: @@ -517,5 +518,4 @@ data: "uid": "k7-rFGGZk", "version": 8 } - - +{{- end }} -- GitLab From c5b4fc27f7307414d26a10e6de39ffbe0161d28f Mon Sep 17 00:00:00 2001 From: Gerard Hickey Date: Mon, 12 Aug 2019 16:02:06 -0700 Subject: [PATCH 04/25] Removed Grafana chart references from gitlab-grafana --- charts/gitlab/charts/gitlab-grafana/Chart.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/charts/gitlab/charts/gitlab-grafana/Chart.yaml b/charts/gitlab/charts/gitlab-grafana/Chart.yaml index 80699f87ca..68529444c0 100644 --- a/charts/gitlab/charts/gitlab-grafana/Chart.yaml +++ b/charts/gitlab/charts/gitlab-grafana/Chart.yaml @@ -2,8 +2,7 @@ apiVersion: v1 name: gitlab-grafana version: 0.1.0 -appVersion: 3.5.10 -description: Embedded Grafana app for GitLab metrics +description: Adapt the Grafana chart to interface to the GitLab App keywords: - gitlab - grafana -- GitLab From d1b5ffc595093f66a21dae6c9f001163b865882c Mon Sep 17 00:00:00 2001 From: Gerard Hickey Date: Tue, 13 Aug 2019 16:37:36 -0700 Subject: [PATCH 05/25] WIP: Added random secrets generation for Grafana --- .../templates/_generate-secret.sh | 40 ++++++++++++++++ .../gitlab-grafana/templates/_helpers.tpl | 39 +++++++++++++++ .../gitlab-grafana/templates/_rbac-role.yaml | 19 ++++++++ .../templates/_rbac-rolebinding.yaml | 23 +++++++++ .../templates/_rbac-serviceaccount.yaml | 15 ++++++ .../templates/generate-secret-configmap.yaml | 18 +++++++ ...cret.yaml => import-secret-configmap.yaml} | 0 .../gitlab-grafana/templates/secret.yaml | 12 ----- .../templates/shared-secret-job.yaml | 47 +++++++++++++++++++ .../gitlab/charts/gitlab-grafana/values.yaml | 18 +++++++ 10 files changed, 219 insertions(+), 12 deletions(-) create mode 100644 charts/gitlab/charts/gitlab-grafana/templates/_generate-secret.sh create mode 100644 charts/gitlab/charts/gitlab-grafana/templates/_helpers.tpl create mode 100644 charts/gitlab/charts/gitlab-grafana/templates/_rbac-role.yaml create mode 100644 charts/gitlab/charts/gitlab-grafana/templates/_rbac-rolebinding.yaml create mode 100644 charts/gitlab/charts/gitlab-grafana/templates/_rbac-serviceaccount.yaml create mode 100644 charts/gitlab/charts/gitlab-grafana/templates/generate-secret-configmap.yaml rename charts/gitlab/charts/gitlab-grafana/templates/{import-secret.yaml => import-secret-configmap.yaml} (100%) delete mode 100644 charts/gitlab/charts/gitlab-grafana/templates/secret.yaml create mode 100644 charts/gitlab/charts/gitlab-grafana/templates/shared-secret-job.yaml diff --git a/charts/gitlab/charts/gitlab-grafana/templates/_generate-secret.sh b/charts/gitlab/charts/gitlab-grafana/templates/_generate-secret.sh new file mode 100644 index 0000000000..ee0071e1c3 --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/templates/_generate-secret.sh @@ -0,0 +1,40 @@ +namespace={{ .Release.Namespace }} +release={{ .Release.Name }} +env={{ .Values.env }} + +pushd $(mktemp -d) + +# Args pattern, length +function gen_random(){ + head -c 4096 /dev/urandom | LC_CTYPE=C tr -cd $1 | head -c $2 +} + +# Args: secretname +function label_secret(){ + local secret_name=$1 +{{ if not .Values.global.application.create -}} + # Remove application labels if they exist + kubectl --namespace=$namespace label \ + secret $secret_name $(echo '{{ include "gitlab.application.labels" . | replace ": " "=" | replace "\n" " " }}' | sed -E 's/=[^ ]*/-/g') +{{ end }} + kubectl --namespace=$namespace label \ + --overwrite \ + secret $secret_name {{ include "gitlab.standardLabels" . | replace ": " "=" | replace "\n" " " }} +} + +# Args: secretname, args +function generate_secret_if_needed(){ + local secret_args=( "${@:2}") + local secret_name=$1 + if ! $(kubectl --namespace=$namespace get secret $secret_name > /dev/null 2>&1); then + kubectl --namespace=$namespace create secret generic $secret_name ${secret_args[@]} + else + echo "secret \"$secret_name\" already exists" + fi; + label_secret $secret_name +} + +{{ if .Values.enabled -}} +# Grafana password +generate_secret_if_needed "gitlab-grafana-initial-password" --from-literal=password=$(gen_random 'a-zA-Z0-9' 64) +{{ end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/_helpers.tpl b/charts/gitlab/charts/gitlab-grafana/templates/_helpers.tpl new file mode 100644 index 0000000000..96f44bb6b9 --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/templates/_helpers.tpl @@ -0,0 +1,39 @@ + +{{- define "gitlab.application.labels" -}} +app.kubernetes.io/name: {{ .Release.Name }} +{{- end -}} + + +{{- define "gitlab.standardLabels" -}} +app: {{ template "name" . }} +chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} +release: {{ .Release.Name }} +heritage: {{ .Release.Service }} +{{ if .Values.global.application.create -}} +{{ include "gitlab.application.labels" . }} +{{- end -}} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "gitlab-grafana.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default "some-gitlab-grafana" .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} + +{{/* +Create a default fully qualified job name. +Due to the job only being allowed to run once, we add the chart revision so helm +upgrades don't cause errors trying to create the already ran job. +Due to the helm delete not cleaning up these jobs, we add a randome value to +reduce collision +*/}} +{{- define "gitlab-grafana.jobname" -}} +{{- $name := include "fullname" . | trunc 55 | trimSuffix "-" -}} +{{- $rand := randAlphaNum 3 | lower }} +{{- printf "%s.%d-%s" $name .Release.Revision $rand | trunc 63 | trimSuffix "-" -}} +{{- end -}} \ No newline at end of file diff --git a/charts/gitlab/charts/gitlab-grafana/templates/_rbac-role.yaml b/charts/gitlab/charts/gitlab-grafana/templates/_rbac-role.yaml new file mode 100644 index 0000000000..abbf78b589 --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/templates/_rbac-role.yaml @@ -0,0 +1,19 @@ +{{- if and .Values.enabled .Values.rbac.create }} +kind: Role +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: {{ .Release.Name }}-gitlab-grafana + namespace: {{ .Release.Namespace }} + labels: +{{ include "gitlab.standardLabels" . | indent 4 }} +{{- if not .Values.global.operator.enabled }} + annotations: + "helm.sh/hook": pre-install,pre-upgrade + "helm.sh/hook-weight": "-8" + "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation +{{- end }} +rules: +- apiGroups: [""] + resources: ["secrets"] + verbs: ["get", "list", "create", "patch"] +{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/_rbac-rolebinding.yaml b/charts/gitlab/charts/gitlab-grafana/templates/_rbac-rolebinding.yaml new file mode 100644 index 0000000000..ee1c557c9c --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/templates/_rbac-rolebinding.yaml @@ -0,0 +1,23 @@ +{{- if and .Values.enabled .Values.rbac.create }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ .Release.Name }}-gitlab-grafana + namespace: {{ .Release.Namespace }} + labels: +{{ include "gitlab.standardLabels" . | indent 4 }} +{{- if not .Values.global.operator.enabled }} + annotations: + "helm.sh/hook": pre-install,pre-upgrade + "helm.sh/hook-weight": "-8" + "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation +{{- end }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ .Release.Name }}-gitlab-grafana +subjects: + - kind: ServiceAccount + name: {{ template "gitlab-grafana.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/_rbac-serviceaccount.yaml b/charts/gitlab/charts/gitlab-grafana/templates/_rbac-serviceaccount.yaml new file mode 100644 index 0000000000..204ed2266c --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/templates/_rbac-serviceaccount.yaml @@ -0,0 +1,15 @@ +{{- if and .Values.enabled .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ template "gitlab-grafana.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} + labels: +{{ include "gitlab.standardLabels" . | indent 4 }} +{{- if not .Values.global.operator.enabled }} + annotations: + "helm.sh/hook": pre-install,pre-upgrade + "helm.sh/hook-weight": "-8" + "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation +{{- end }} +{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/generate-secret-configmap.yaml b/charts/gitlab/charts/gitlab-grafana/templates/generate-secret-configmap.yaml new file mode 100644 index 0000000000..d3c9415744 --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/templates/generate-secret-configmap.yaml @@ -0,0 +1,18 @@ +{{- if .Values.enabled -}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-grafana-generate-secret + namespace: {{ .Release.Namespace }} + labels: +{{ include "gitlab.standardLabels" . | indent 4 }} +{{- if not .Values.global.operator.enabled }} + annotations: + "helm.sh/hook": pre-install,pre-upgrade + "helm.sh/hook-weight": "-8" + "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation +{{- end }} +data: + generate-secret.sh: |- +{{ include (print $.Template.BasePath "/_generate-secret.sh") . | indent 4 }} +{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/import-secret.yaml b/charts/gitlab/charts/gitlab-grafana/templates/import-secret-configmap.yaml similarity index 100% rename from charts/gitlab/charts/gitlab-grafana/templates/import-secret.yaml rename to charts/gitlab/charts/gitlab-grafana/templates/import-secret-configmap.yaml diff --git a/charts/gitlab/charts/gitlab-grafana/templates/secret.yaml b/charts/gitlab/charts/gitlab-grafana/templates/secret.yaml deleted file mode 100644 index d680ae00a5..0000000000 --- a/charts/gitlab/charts/gitlab-grafana/templates/secret.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- if .Values.enabled -}} -apiVersion: v1 -kind: Secret -metadata: - name: gitlab-grafana-initial-password - namespace: {{ $.Release.Namespace }} - labels: - secretType: initial-password -{{ include "gitlab.standardLabels" . | indent 4 }} -data: - password: {{ "foobar" | b64enc }} -{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/shared-secret-job.yaml b/charts/gitlab/charts/gitlab-grafana/templates/shared-secret-job.yaml new file mode 100644 index 0000000000..bd2b43cc56 --- /dev/null +++ b/charts/gitlab/charts/gitlab-grafana/templates/shared-secret-job.yaml @@ -0,0 +1,47 @@ +{{- if .Values.enabled }} +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ include "gitlab-grafana.jobname" . }} + namespace: {{ .Release.Namespace }} + labels: +{{ include "gitlab.standardLabels" . | indent 4 }} +{{- if not .Values.global.operator.enabled }} + annotations: + "helm.sh/hook": pre-install,pre-upgrade + "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation +{{- end }} +spec: + template: + metadata: + labels: + app: {{ template "name" . }} + release: {{ .Release.Name }} + spec: + {{- if .Values.tolerations }} + tolerations: +{{ toYaml .Values.tolerations | indent 8 }} + {{- end }} + securityContext: + runAsUser: {{ .Values.securityContext.runAsUser }} + fsGroup: {{ .Values.securityContext.fsGroup }} + {{- if .Values.rbac.create }} + serviceAccountName: {{ template "gitlab-grafana.serviceAccountName" . }} + {{- end }} + restartPolicy: Never +{{- include "pullsecrets" .Values.global.kubectl.image | indent 6}} + containers: + - name: {{ .Chart.Name }} + image: {{ include "gitlab.kubectl.image" . | quote }} + command: ['/bin/bash', '/scripts/generate-secret.sh'] + {{ template "gitlab.imagePullPolicy" . }} + volumeMounts: + - name: scripts + mountPath: /scripts + resources: +{{ toYaml .Values.resources | indent 12 }} + volumes: + - name: scripts + configMap: + name: {{ .Release.Name }}-grafana-generate-secret +{{- end }} \ No newline at end of file diff --git a/charts/gitlab/charts/gitlab-grafana/values.yaml b/charts/gitlab/charts/gitlab-grafana/values.yaml index cce92d35f8..331ef1a3b1 100644 --- a/charts/gitlab/charts/gitlab-grafana/values.yaml +++ b/charts/gitlab/charts/gitlab-grafana/values.yaml @@ -5,6 +5,24 @@ ingress: tls: {} annotations: {} +## Support for tolerations for pod scheduling +tolerations: [] + +serviceAccount: + create: true + name: my-gitlab-grafana # Specify a pre-existing ServiceAccount name +rbac: + create: true + +resources: + requests: + cpu: 50m +securityContext: + # in debian/alpine based images, this is `nobody:nogroup` + runAsUser: 65534 + fsGroup: 65534 + + grafana: adminUser: admin adminPassword: admin -- GitLab From 873e7becc47db887eb6b70ffd3dd11f97867d2ad Mon Sep 17 00:00:00 2001 From: Jason Plum Date: Fri, 16 Aug 2019 16:09:34 -0400 Subject: [PATCH 06/25] Grafana: move values to main & globalize enabled - Move the properties of the Grafana chart to /values.yaml - Use `global.grafana.enabled` for enabling deployment and integration --- .../templates/dashboards/gitaly.yaml | 2 +- .../templates/dashboards/nginx.yaml | 2 +- .../templates/dashboards/overview.yaml | 2 +- .../templates/dashboards/postgresql.yaml | 2 +- .../templates/dashboards/rails-app.yaml | 2 +- .../templates/dashboards/redis.yaml | 2 +- .../templates/dashboards/registry.yaml | 2 +- .../templates/datasource-configmap.yaml | 2 +- .../templates/import-secret-configmap.yaml | 2 +- .../gitlab-grafana/templates/ingress.yaml | 2 +- .../gitlab/charts/gitlab-grafana/values.yaml | 53 +++---------------- requirements.yaml | 2 +- values.yaml | 39 +++++++++++++- 13 files changed, 55 insertions(+), 59 deletions(-) diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/gitaly.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/gitaly.yaml index 307ad1e933..e6ced9dfb4 100644 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/gitaly.yaml +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/gitaly.yaml @@ -1,4 +1,4 @@ -{{- if .Values.enabled -}} +{{- if .Values.global.grafana.enabled -}} apiVersion: v1 kind: ConfigMap metadata: diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/nginx.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/nginx.yaml index 6de4949c1d..0922e6baff 100644 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/nginx.yaml +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/nginx.yaml @@ -1,4 +1,4 @@ -{{- if .Values.enabled -}} +{{- if .Values.global.grafana.enabled -}} apiVersion: v1 kind: ConfigMap metadata: diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/overview.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/overview.yaml index 8259e3d2f2..7c7d04d8a0 100644 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/overview.yaml +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/overview.yaml @@ -1,4 +1,4 @@ -{{- if .Values.enabled -}} +{{- if .Values.global.grafana.enabled -}} apiVersion: v1 kind: ConfigMap metadata: diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/postgresql.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/postgresql.yaml index 5012c6d459..5bbcb0dede 100644 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/postgresql.yaml +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/postgresql.yaml @@ -1,4 +1,4 @@ -{{- if .Values.enabled -}} +{{- if .Values.global.grafana.enabled -}} apiVersion: v1 kind: ConfigMap metadata: diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/rails-app.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/rails-app.yaml index 021154f51e..6b8c6458ef 100644 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/rails-app.yaml +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/rails-app.yaml @@ -1,4 +1,4 @@ -{{- if .Values.enabled -}} +{{- if .Values.global.grafana.enabled -}} apiVersion: v1 kind: ConfigMap metadata: diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/redis.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/redis.yaml index 8ee5c11c0a..56f412ffce 100644 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/redis.yaml +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/redis.yaml @@ -1,4 +1,4 @@ -{{- if .Values.enabled -}} +{{- if .Values.global.grafana.enabled -}} apiVersion: v1 kind: ConfigMap metadata: diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/registry.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/registry.yaml index 2ea6287b90..952a71685d 100644 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/registry.yaml +++ b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/registry.yaml @@ -1,4 +1,4 @@ -{{- if .Values.enabled -}} +{{- if .Values.global.grafana.enabled -}} apiVersion: v1 kind: ConfigMap metadata: diff --git a/charts/gitlab/charts/gitlab-grafana/templates/datasource-configmap.yaml b/charts/gitlab/charts/gitlab-grafana/templates/datasource-configmap.yaml index 78f15a46c7..dfbdcfd15f 100644 --- a/charts/gitlab/charts/gitlab-grafana/templates/datasource-configmap.yaml +++ b/charts/gitlab/charts/gitlab-grafana/templates/datasource-configmap.yaml @@ -1,4 +1,4 @@ -{{- if .Values.enabled -}} +{{- if .Values.global.grafana.enabled -}} apiVersion: v1 kind: ConfigMap metadata: diff --git a/charts/gitlab/charts/gitlab-grafana/templates/import-secret-configmap.yaml b/charts/gitlab/charts/gitlab-grafana/templates/import-secret-configmap.yaml index 7d4acaaecb..e8b9fbc3da 100644 --- a/charts/gitlab/charts/gitlab-grafana/templates/import-secret-configmap.yaml +++ b/charts/gitlab/charts/gitlab-grafana/templates/import-secret-configmap.yaml @@ -1,4 +1,4 @@ -{{- if .Values.enabled -}} +{{- if .Values.global.grafana.enabled -}} apiVersion: v1 kind: ConfigMap metadata: diff --git a/charts/gitlab/charts/gitlab-grafana/templates/ingress.yaml b/charts/gitlab/charts/gitlab-grafana/templates/ingress.yaml index d55e35f023..5d06f37af3 100644 --- a/charts/gitlab/charts/gitlab-grafana/templates/ingress.yaml +++ b/charts/gitlab/charts/gitlab-grafana/templates/ingress.yaml @@ -1,4 +1,4 @@ -{{- if .Values.enabled -}} +{{- if .Values.global.grafana.enabled -}} {{/* {{- if eq (include "gitlab.ingress.enabled" $) "true" -}} */}} {{- $gitlabHostname := include "gitlab.gitlab.hostname" . -}} {{- $tlsSecret := include "unicorn.tlsSecret" . -}} diff --git a/charts/gitlab/charts/gitlab-grafana/values.yaml b/charts/gitlab/charts/gitlab-grafana/values.yaml index 331ef1a3b1..2fd38007f2 100644 --- a/charts/gitlab/charts/gitlab-grafana/values.yaml +++ b/charts/gitlab/charts/gitlab-grafana/values.yaml @@ -1,53 +1,12 @@ +## GitLab Grafana configuration +## If enabled, we will deploy a secured Grafana -enabled: true +# This chart is controlled by `global.grafana.enabled` +global: {} +# We supply an Ingress resource that locates Grafana under /-/grafana +# NOTE: these values are placeholders for template functionality. ingress: tls: {} annotations: {} -## Support for tolerations for pod scheduling -tolerations: [] - -serviceAccount: - create: true - name: my-gitlab-grafana # Specify a pre-existing ServiceAccount name -rbac: - create: true - -resources: - requests: - cpu: 50m -securityContext: - # in debian/alpine based images, this is `nobody:nogroup` - runAsUser: 65534 - fsGroup: 65534 - - -grafana: - adminUser: admin - adminPassword: admin - ## The following settings allow Grafana to dynamically create - ## dashboards and datasources from configmaps. See - ## https://github.com/helm/charts/tree/master/stable/grafana#sidecar-for-dashboards - sidecar: - dashboards: - enabled: true - label: gitlab_grafana_dashboard - datasources: - enabled: true - label: gitlab_grafana_datasource - grafana.ini: - server: - root_url: http://localhost/-/grafana/ - extraSecretMounts: - - name: initial-password - mountPath: /tmp/initial - readOnly: true - secretName: gitlab-grafana-initial-password - defaultMode: 400 - extraConfigmapMounts: - - name: import-secret - mountPath: /tmp/scripts - configMap: gitlab-grafana-import-secret - readOnly: true - command: [ "sh", "-x", "/tmp/scripts/import-secret.sh" ] \ No newline at end of file diff --git a/requirements.yaml b/requirements.yaml index b91c70d6b5..e39d01da40 100644 --- a/requirements.yaml +++ b/requirements.yaml @@ -19,4 +19,4 @@ dependencies: - name: grafana version: 3.5.12 repository: https://kubernetes-charts.storage.googleapis.com/ - condition: gitlab.gitlab-grafana.enabled \ No newline at end of file + condition: global.grafana.enabled diff --git a/values.yaml b/values.yaml index 3f0b80e0f5..5a9629ce3b 100644 --- a/values.yaml +++ b/values.yaml @@ -96,6 +96,10 @@ global: credentials: {} # secret: + ## doc/charts/globals.md#configure-grafana-integration + grafana: + enabled: false + ## doc/charts/globals.md#configure-appconfig-settings ## Rails based portions of this chart share many settings appConfig: @@ -463,6 +467,40 @@ gitlab-runner: s3CachePath: gitlab-runner s3CacheInsecure: false + +## Installation & configuration of stable/grafana +## See requirements.yaml for current version +## Controlled by `global.grafana.enabled` +grafana: + ## The following settings allow Grafana to dynamically create + ## dashboards and datasources from configmaps. See + ## https://github.com/helm/charts/tree/master/stable/grafana#sidecar-for-dashboards + sidecar: + dashboards: + enabled: true + label: gitlab_grafana_dashboard + datasources: + enabled: true + label: gitlab_grafana_datasource + ## We host Grafana as a sub-url of GitLab + grafana.ini: + server: + root_url: http://localhost/-/grafana/ + ## We generatd and provide random passwords + ## NOTE: the Secret & ConfigMap names are hard coded! + extraSecretMounts: + - name: initial-password + mountPath: /tmp/initial + readOnly: true + secretName: gitlab-grafana-initial-password + defaultMode: 400 + extraConfigmapMounts: + - name: import-secret + mountPath: /tmp/scripts + configMap: gitlab-grafana-import-secret + readOnly: true + command: [ "sh", "-x", "/tmp/scripts/import-secret.sh" ] + ## Settings for individual sub-charts under GitLab ## Note: Many of these settings are configurable via globals # gitlab: @@ -483,4 +521,3 @@ gitlab-runner: # enabled: false ## doc/charts/gitlab/gitlab-grafana # gitlab-grafana: -# enabled: false -- GitLab From 0459f8c3722b6b861a09192413f0dd7b846e92c0 Mon Sep 17 00:00:00 2001 From: Jason Plum Date: Fri, 16 Aug 2019 16:13:40 -0400 Subject: [PATCH 07/25] Grafana: move secret generation to shared-secrets Move the generation of the `gitlab-grafana-initial-root-password` secret to the `shared-secrets` chart. --- .../templates/_generate-secret.sh | 40 ---------------- .../gitlab-grafana/templates/_helpers.tpl | 39 --------------- .../gitlab-grafana/templates/_rbac-role.yaml | 19 -------- .../templates/_rbac-rolebinding.yaml | 23 --------- .../templates/_rbac-serviceaccount.yaml | 15 ------ .../templates/generate-secret-configmap.yaml | 18 ------- .../templates/shared-secret-job.yaml | 47 ------------------- .../templates/_generate_secrets.sh | 6 +++ 8 files changed, 6 insertions(+), 201 deletions(-) delete mode 100644 charts/gitlab/charts/gitlab-grafana/templates/_generate-secret.sh delete mode 100644 charts/gitlab/charts/gitlab-grafana/templates/_helpers.tpl delete mode 100644 charts/gitlab/charts/gitlab-grafana/templates/_rbac-role.yaml delete mode 100644 charts/gitlab/charts/gitlab-grafana/templates/_rbac-rolebinding.yaml delete mode 100644 charts/gitlab/charts/gitlab-grafana/templates/_rbac-serviceaccount.yaml delete mode 100644 charts/gitlab/charts/gitlab-grafana/templates/generate-secret-configmap.yaml delete mode 100644 charts/gitlab/charts/gitlab-grafana/templates/shared-secret-job.yaml diff --git a/charts/gitlab/charts/gitlab-grafana/templates/_generate-secret.sh b/charts/gitlab/charts/gitlab-grafana/templates/_generate-secret.sh deleted file mode 100644 index ee0071e1c3..0000000000 --- a/charts/gitlab/charts/gitlab-grafana/templates/_generate-secret.sh +++ /dev/null @@ -1,40 +0,0 @@ -namespace={{ .Release.Namespace }} -release={{ .Release.Name }} -env={{ .Values.env }} - -pushd $(mktemp -d) - -# Args pattern, length -function gen_random(){ - head -c 4096 /dev/urandom | LC_CTYPE=C tr -cd $1 | head -c $2 -} - -# Args: secretname -function label_secret(){ - local secret_name=$1 -{{ if not .Values.global.application.create -}} - # Remove application labels if they exist - kubectl --namespace=$namespace label \ - secret $secret_name $(echo '{{ include "gitlab.application.labels" . | replace ": " "=" | replace "\n" " " }}' | sed -E 's/=[^ ]*/-/g') -{{ end }} - kubectl --namespace=$namespace label \ - --overwrite \ - secret $secret_name {{ include "gitlab.standardLabels" . | replace ": " "=" | replace "\n" " " }} -} - -# Args: secretname, args -function generate_secret_if_needed(){ - local secret_args=( "${@:2}") - local secret_name=$1 - if ! $(kubectl --namespace=$namespace get secret $secret_name > /dev/null 2>&1); then - kubectl --namespace=$namespace create secret generic $secret_name ${secret_args[@]} - else - echo "secret \"$secret_name\" already exists" - fi; - label_secret $secret_name -} - -{{ if .Values.enabled -}} -# Grafana password -generate_secret_if_needed "gitlab-grafana-initial-password" --from-literal=password=$(gen_random 'a-zA-Z0-9' 64) -{{ end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/_helpers.tpl b/charts/gitlab/charts/gitlab-grafana/templates/_helpers.tpl deleted file mode 100644 index 96f44bb6b9..0000000000 --- a/charts/gitlab/charts/gitlab-grafana/templates/_helpers.tpl +++ /dev/null @@ -1,39 +0,0 @@ - -{{- define "gitlab.application.labels" -}} -app.kubernetes.io/name: {{ .Release.Name }} -{{- end -}} - - -{{- define "gitlab.standardLabels" -}} -app: {{ template "name" . }} -chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} -release: {{ .Release.Name }} -heritage: {{ .Release.Service }} -{{ if .Values.global.application.create -}} -{{ include "gitlab.application.labels" . }} -{{- end -}} -{{- end -}} - -{{/* -Create the name of the service account to use -*/}} -{{- define "gitlab-grafana.serviceAccountName" -}} -{{- if .Values.serviceAccount.create -}} - {{ default "some-gitlab-grafana" .Values.serviceAccount.name }} -{{- else -}} - {{ default "default" .Values.serviceAccount.name }} -{{- end -}} -{{- end -}} - -{{/* -Create a default fully qualified job name. -Due to the job only being allowed to run once, we add the chart revision so helm -upgrades don't cause errors trying to create the already ran job. -Due to the helm delete not cleaning up these jobs, we add a randome value to -reduce collision -*/}} -{{- define "gitlab-grafana.jobname" -}} -{{- $name := include "fullname" . | trunc 55 | trimSuffix "-" -}} -{{- $rand := randAlphaNum 3 | lower }} -{{- printf "%s.%d-%s" $name .Release.Revision $rand | trunc 63 | trimSuffix "-" -}} -{{- end -}} \ No newline at end of file diff --git a/charts/gitlab/charts/gitlab-grafana/templates/_rbac-role.yaml b/charts/gitlab/charts/gitlab-grafana/templates/_rbac-role.yaml deleted file mode 100644 index abbf78b589..0000000000 --- a/charts/gitlab/charts/gitlab-grafana/templates/_rbac-role.yaml +++ /dev/null @@ -1,19 +0,0 @@ -{{- if and .Values.enabled .Values.rbac.create }} -kind: Role -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: {{ .Release.Name }}-gitlab-grafana - namespace: {{ .Release.Namespace }} - labels: -{{ include "gitlab.standardLabels" . | indent 4 }} -{{- if not .Values.global.operator.enabled }} - annotations: - "helm.sh/hook": pre-install,pre-upgrade - "helm.sh/hook-weight": "-8" - "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation -{{- end }} -rules: -- apiGroups: [""] - resources: ["secrets"] - verbs: ["get", "list", "create", "patch"] -{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/_rbac-rolebinding.yaml b/charts/gitlab/charts/gitlab-grafana/templates/_rbac-rolebinding.yaml deleted file mode 100644 index ee1c557c9c..0000000000 --- a/charts/gitlab/charts/gitlab-grafana/templates/_rbac-rolebinding.yaml +++ /dev/null @@ -1,23 +0,0 @@ -{{- if and .Values.enabled .Values.rbac.create }} -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: {{ .Release.Name }}-gitlab-grafana - namespace: {{ .Release.Namespace }} - labels: -{{ include "gitlab.standardLabels" . | indent 4 }} -{{- if not .Values.global.operator.enabled }} - annotations: - "helm.sh/hook": pre-install,pre-upgrade - "helm.sh/hook-weight": "-8" - "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation -{{- end }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: {{ .Release.Name }}-gitlab-grafana -subjects: - - kind: ServiceAccount - name: {{ template "gitlab-grafana.serviceAccountName" . }} - namespace: {{ .Release.Namespace }} -{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/_rbac-serviceaccount.yaml b/charts/gitlab/charts/gitlab-grafana/templates/_rbac-serviceaccount.yaml deleted file mode 100644 index 204ed2266c..0000000000 --- a/charts/gitlab/charts/gitlab-grafana/templates/_rbac-serviceaccount.yaml +++ /dev/null @@ -1,15 +0,0 @@ -{{- if and .Values.enabled .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ template "gitlab-grafana.serviceAccountName" . }} - namespace: {{ .Release.Namespace }} - labels: -{{ include "gitlab.standardLabels" . | indent 4 }} -{{- if not .Values.global.operator.enabled }} - annotations: - "helm.sh/hook": pre-install,pre-upgrade - "helm.sh/hook-weight": "-8" - "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation -{{- end }} -{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/generate-secret-configmap.yaml b/charts/gitlab/charts/gitlab-grafana/templates/generate-secret-configmap.yaml deleted file mode 100644 index d3c9415744..0000000000 --- a/charts/gitlab/charts/gitlab-grafana/templates/generate-secret-configmap.yaml +++ /dev/null @@ -1,18 +0,0 @@ -{{- if .Values.enabled -}} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ .Release.Name }}-grafana-generate-secret - namespace: {{ .Release.Namespace }} - labels: -{{ include "gitlab.standardLabels" . | indent 4 }} -{{- if not .Values.global.operator.enabled }} - annotations: - "helm.sh/hook": pre-install,pre-upgrade - "helm.sh/hook-weight": "-8" - "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation -{{- end }} -data: - generate-secret.sh: |- -{{ include (print $.Template.BasePath "/_generate-secret.sh") . | indent 4 }} -{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/shared-secret-job.yaml b/charts/gitlab/charts/gitlab-grafana/templates/shared-secret-job.yaml deleted file mode 100644 index bd2b43cc56..0000000000 --- a/charts/gitlab/charts/gitlab-grafana/templates/shared-secret-job.yaml +++ /dev/null @@ -1,47 +0,0 @@ -{{- if .Values.enabled }} -apiVersion: batch/v1 -kind: Job -metadata: - name: {{ include "gitlab-grafana.jobname" . }} - namespace: {{ .Release.Namespace }} - labels: -{{ include "gitlab.standardLabels" . | indent 4 }} -{{- if not .Values.global.operator.enabled }} - annotations: - "helm.sh/hook": pre-install,pre-upgrade - "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation -{{- end }} -spec: - template: - metadata: - labels: - app: {{ template "name" . }} - release: {{ .Release.Name }} - spec: - {{- if .Values.tolerations }} - tolerations: -{{ toYaml .Values.tolerations | indent 8 }} - {{- end }} - securityContext: - runAsUser: {{ .Values.securityContext.runAsUser }} - fsGroup: {{ .Values.securityContext.fsGroup }} - {{- if .Values.rbac.create }} - serviceAccountName: {{ template "gitlab-grafana.serviceAccountName" . }} - {{- end }} - restartPolicy: Never -{{- include "pullsecrets" .Values.global.kubectl.image | indent 6}} - containers: - - name: {{ .Chart.Name }} - image: {{ include "gitlab.kubectl.image" . | quote }} - command: ['/bin/bash', '/scripts/generate-secret.sh'] - {{ template "gitlab.imagePullPolicy" . }} - volumeMounts: - - name: scripts - mountPath: /scripts - resources: -{{ toYaml .Values.resources | indent 12 }} - volumes: - - name: scripts - configMap: - name: {{ .Release.Name }}-grafana-generate-secret -{{- end }} \ No newline at end of file diff --git a/charts/shared-secrets/templates/_generate_secrets.sh b/charts/shared-secrets/templates/_generate_secrets.sh index 591c68b618..84efedd921 100644 --- a/charts/shared-secrets/templates/_generate_secrets.sh +++ b/charts/shared-secrets/templates/_generate_secrets.sh @@ -123,3 +123,9 @@ generate_secret_if_needed {{ template "gitlab.workhorse.secret" . }} --from-lite # Registry http.secret secret generate_secret_if_needed {{ template "gitlab.registry.httpSecret.secret" . }} --from-literal={{ template "gitlab.registry.httpSecret.key" . }}=$(gen_random 'a-z0-9' 128 | base64 -w 0) + +{{ if .Values.global.grafana.enabled -}} +# Grafana password +generate_secret_if_needed "gitlab-grafana-initial-password" --from-literal=password=$(gen_random 'a-zA-Z0-9' 64) +{{ end }} + -- GitLab From d11eae219713af6f66cc04c04370a868e506e702 Mon Sep 17 00:00:00 2001 From: Jason Plum Date: Fri, 16 Aug 2019 16:14:36 -0400 Subject: [PATCH 08/25] Grafana: document global.grafana.enabled Add documentation paragraph to Globals for enabling Grafana integration --- doc/charts/globals.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/charts/globals.md b/doc/charts/globals.md index b23632276e..413fa79384 100644 --- a/doc/charts/globals.md +++ b/doc/charts/globals.md @@ -11,6 +11,7 @@ for more information on how the global variables work. - [GitLab Version](#gitlab-version) - [PostgreSQL](#configure-postgresql-settings) - [Redis](#configure-redis-settings) +- [Grafana](#configure-grafana-integration) - [Registry](#configure-registry-settings) - [Gitaly](#configure-gitaly-settings) - [Minio](#configure-minio-settings) @@ -165,6 +166,14 @@ global: key: redis-password ``` +## Configure Grafana integration + +The GitLab global grafana settings are located under the `global.grafana`. At this time, the only setting available is `global.grafana.enabled`. + +When set to `true`, the GitLab chart will deploy the [Grafana chart](https://github.com/helm/helm/tree/master/stable/grafana), expose it under `/-/grafana` of the GitLab Ingress, and pre-configure it with a secure random password. The generated password can be found in `gitlab-grafana-initial-root-password`. + +The GitLab chart also preloads dashboards, and connects to the deployed Prometheus instance. + ## Configure Registry settings The global Registry settings are located under the `global.registry` key. For more -- GitLab From 5c30ab3b895aa99bb1dee4172b4428c21b741cc4 Mon Sep 17 00:00:00 2001 From: Jason Plum Date: Fri, 16 Aug 2019 16:19:33 -0400 Subject: [PATCH 09/25] Grafana: add doc for manual secret generation Add documentation for manually generating the Grafana intial password secret --- doc/installation/secrets.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/installation/secrets.md b/doc/installation/secrets.md index baab5731d2..ef0b789fae 100644 --- a/doc/installation/secrets.md +++ b/doc/installation/secrets.md @@ -40,6 +40,7 @@ documentation. - [Postgres password](#postgresql-password) - [Minio secret](#minio-secret) - [Registry HTTP secret](#registry-http-secret) + - [Grafana password](#grafana-password) - [External Services](#external-services) - [Unicorn Omniauth](#unicorn-omniauth) - [LDAP Password](#ldap-password) @@ -191,6 +192,14 @@ the name of the release. kubectl create secret generic -postgresql-password --from-literal=postgres-password=$(head -c 512 /dev/urandom | LC_CTYPE=C tr -cd 'a-zA-Z0-9' | head -c 64) ``` +### Grafana password + +If configuring [Grafana integration](../charts/globals.md#configure-grafana-integration), generate a random 64 character alpha-numeric password. + +``` +generate_secret_if_needed "gitlab-grafana-initial-password" --from-literal=password=$(gen_random 'a-zA-Z0-9' 64) +``` + ### Registry HTTP secret Generate a random 64 character alpha-numeric key shared by all registry pods. -- GitLab From 7738fef4e52892f2eb0599b784b5fac8e4ca18df Mon Sep 17 00:00:00 2001 From: Gerard Hickey Date: Fri, 16 Aug 2019 14:59:27 -0700 Subject: [PATCH 10/25] Removed obsolete gitlab-grafana setting --- charts/gitlab/values.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/charts/gitlab/values.yaml b/charts/gitlab/values.yaml index 7299365ca6..890462588d 100644 --- a/charts/gitlab/values.yaml +++ b/charts/gitlab/values.yaml @@ -36,5 +36,3 @@ global: gitlab-runner: enabled: false -gitlab-grafana: - enabled: true -- GitLab From 83dffa4948780d38db17324a2feb9ad08873f6f4 Mon Sep 17 00:00:00 2001 From: Gerard Hickey Date: Fri, 16 Aug 2019 16:09:55 -0700 Subject: [PATCH 11/25] Added documenation for gitlab-grafana chart --- doc/charts/gitlab/gitlab-grafana/index.md | 64 +++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 doc/charts/gitlab/gitlab-grafana/index.md diff --git a/doc/charts/gitlab/gitlab-grafana/index.md b/doc/charts/gitlab/gitlab-grafana/index.md new file mode 100644 index 0000000000..1d6258e403 --- /dev/null +++ b/doc/charts/gitlab/gitlab-grafana/index.md @@ -0,0 +1,64 @@ +# Using the gitlab-grafana chart + +The `gitlab-grafana` subchart adapts the `stable/grafana` chart operate +correctly with the same level of configuration on par with the Omnibus +GitLab install. In addition, the installation of Grafana allows additional +dashboards to be installed by the end user and be incorporated with the +GitLab supplied dashboards. + +## Requirements + +This chart depends on the `stable/grafana` chart which is usually installed +by the `GitLab` meta chart. In addition, Kubernetes ingress support is +needed to properly route the Grafana requests using the `/-/grafana` path. + +## Design Choices + +Because of Helm limitations it is not possible to configure the Grafana +chart with knowledge of a dynamic name for the initial password Secret. +As a result a statically named Secret is created to contain the initial +password. This Secret is named `gitlab-grafana-initial-password`. + +The same issue exists for the ConfigMap that contains the script that +is used to inject the initial password into the Grafana container. That +ConfigMap is named `gitlab-grafana-import-secret`. + +Both the initial password Secret and the import script ConfigMap are +mounted into the Grafana container (`/tmp/initial` and `/tmp/scripts` +respectively) and the container command line is augmented to use both +of these objects to securely expose the initial password to the +Grafana server. Modification of the container command line will +generally prevent the initial password from being injected into the +Grafana server environment. + +## Configuration + +There are no required settings, it should work out of the box if you deploy +all of the charts together. The administrator credentials are created by +the `shared-secrets` chart and the administrator username is set to `root`. + +## Installation command line options + +| Parameter | Default | Description | +|---------------------|---------|----------------------------------------------------------------------| +| ingress.tls | `{}` | Hash of Ingress TLS settings if GitLab cert manager is not installed | +| ingress.annotations | `{}` | Additional annotations to add to Grafana Ingress resource | + +## Dashboard Support + +Grafana dashboards are automatically discovered from the ConfigMaps in +the deployed namespace. If a ConfigMap has been created with the +`gitlab_grafana_dashboard` label set to `true`, then the JSON encoded +dashboard in the ConfigMap will be imported into Grafana. This mechanism +does not allow any updates to the dashboard to be written back to the +ConfigMap containing the JSON encoded dashboard. + +The end user may supply their own dashboards utilizing the same mechanism +by supplying the `gitlab_grafana_dashboard` label and managing the +ConfigMap themselves. + +## Datasource Support + +Datasources may be created in the same manner as the dashboards by adding +the `gitlab_grafana_datasource` label. This chart will add a ConfigMap +to direct Grafana to use the embedded Prometheus metrics. -- GitLab From 716bb77d6dc76bdb2e64afcc707c6a2fb9c61a8d Mon Sep 17 00:00:00 2001 From: Gerard Hickey Date: Fri, 16 Aug 2019 16:26:23 -0700 Subject: [PATCH 12/25] Removed unused continational in Ingress resource --- charts/gitlab/charts/gitlab-grafana/templates/ingress.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/charts/gitlab/charts/gitlab-grafana/templates/ingress.yaml b/charts/gitlab/charts/gitlab-grafana/templates/ingress.yaml index 5d06f37af3..dbabf73f69 100644 --- a/charts/gitlab/charts/gitlab-grafana/templates/ingress.yaml +++ b/charts/gitlab/charts/gitlab-grafana/templates/ingress.yaml @@ -1,5 +1,4 @@ {{- if .Values.global.grafana.enabled -}} -{{/* {{- if eq (include "gitlab.ingress.enabled" $) "true" -}} */}} {{- $gitlabHostname := include "gitlab.gitlab.hostname" . -}} {{- $tlsSecret := include "unicorn.tlsSecret" . -}} apiVersion: extensions/v1beta1 @@ -37,5 +36,4 @@ spec: {{- else }} tls: [] {{- end }} -{{/* {{- end -}} */}} {{- end -}} \ No newline at end of file -- GitLab From 2ed092de8080172422e6bbcc82ef9f77ac47a5b1 Mon Sep 17 00:00:00 2001 From: Gerard Hickey Date: Fri, 16 Aug 2019 16:32:11 -0700 Subject: [PATCH 13/25] Moved dashboards to features/grafana-dashboards branch --- .../templates/dashboards/gitaly.yaml | 625 ---------- .../templates/dashboards/nginx.yaml | 560 --------- .../templates/dashboards/overview.yaml | 1006 --------------- .../templates/dashboards/postgresql.yaml | 919 -------------- .../templates/dashboards/rails-app.yaml | 500 -------- .../templates/dashboards/redis.yaml | 1111 ----------------- .../templates/dashboards/registry.yaml | 521 -------- 7 files changed, 5242 deletions(-) delete mode 100644 charts/gitlab/charts/gitlab-grafana/templates/dashboards/gitaly.yaml delete mode 100644 charts/gitlab/charts/gitlab-grafana/templates/dashboards/nginx.yaml delete mode 100644 charts/gitlab/charts/gitlab-grafana/templates/dashboards/overview.yaml delete mode 100644 charts/gitlab/charts/gitlab-grafana/templates/dashboards/postgresql.yaml delete mode 100644 charts/gitlab/charts/gitlab-grafana/templates/dashboards/rails-app.yaml delete mode 100644 charts/gitlab/charts/gitlab-grafana/templates/dashboards/redis.yaml delete mode 100644 charts/gitlab/charts/gitlab-grafana/templates/dashboards/registry.yaml diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/gitaly.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/gitaly.yaml deleted file mode 100644 index e6ced9dfb4..0000000000 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/gitaly.yaml +++ /dev/null @@ -1,625 +0,0 @@ -{{- if .Values.global.grafana.enabled -}} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "fullname" . }}-gitaly-dashboard - namespace: {{ .Release.Namespace }} - labels: - gitlab_grafana_dashboard: "true" -{{ include "gitlab.standardLabels" . | indent 4 }} -data: - gitaly.json: | - { - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "iteration": 1556019962975, - "links": [], - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "fill": 1, - "gridPos": { - "h": 9, - "w": 11, - "x": 0, - "y": 0 - }, - "id": 2, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(process_cpu_seconds_total{job=\"gitaly\",instance=~\"$instance\"}[$__interval])", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "{{"{{instance}}"}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "CPU", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": null, - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "GitLab Omnibus", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 3, - "x": 11, - "y": 0 - }, - "id": 4, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "version", - "targets": [ - { - "expr": "topk(1, count by (version) (gitlab_build_info{job=\"gitaly\",instance=~\"$instance\"}))", - "format": "table", - "instant": true, - "intervalFactor": 1, - "legendFormat": "{{"{{version}}"}}", - "refId": "A" - } - ], - "thresholds": "", - "title": "Gitaly Version", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "fill": 1, - "gridPos": { - "h": 9, - "w": 10, - "x": 14, - "y": 0 - }, - "id": 8, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "avg(go_goroutines{job=\"gitaly\",instance=~\"$instance\"})", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Go routines", - "refId": "A" - }, - { - "expr": "avg(process_open_fds{job=\"gitaly\",instance=~\"$instance\"})", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Open FDs (file descriptors)", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Resources", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#d44a3a", - "rgba(237, 129, 40, 0.89)", - "#299c46" - ], - "datasource": "GitLab Omnibus", - "format": "percentunit", - "gauge": { - "maxValue": 1, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 5, - "w": 3, - "x": 11, - "y": 4 - }, - "id": 12, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "avg(avg_over_time(up{job=\"gitaly\"}[$__interval]))", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": "0.8, 0.9", - "title": "Availability", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "fill": 1, - "gridPos": { - "h": 9, - "w": 11, - "x": 0, - "y": 9 - }, - "id": 6, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "avg(process_resident_memory_bytes{job=\"gitaly\",instance=~\"$instance\"})", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "RSS", - "refId": "A" - }, - { - "expr": "avg(go_memstats_next_gc_bytes{job=\"gitaly\",instance=~\"$instance\"})", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Next GC", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Memory", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "fill": 1, - "gridPos": { - "h": 9, - "w": 13, - "x": 11, - "y": 9 - }, - "id": 10, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum without (grpc_method,grpc_service,grpc_type) (\n rate(grpc_server_started_total{job=\"gitaly\",instance=~\"$instance\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "{{"{{instance}}"}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Request Rate", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "reqps", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "refresh": "1m", - "schemaVersion": 18, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "allValue": null, - "current": { - "text": "All", - "value": "$__all" - }, - "datasource": "GitLab Omnibus", - "definition": "label_values(up{job=\"gitaly\"}, instance)", - "hide": 0, - "includeAll": true, - "label": null, - "multi": false, - "name": "instance", - "options": [], - "query": "label_values(up{job=\"gitaly\"}, instance)", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-24h", - "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": "GitLab Omnibus - Gitaly", - "uid": "x6Z50y-iz", - "version": 3 - } -{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/nginx.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/nginx.yaml deleted file mode 100644 index 0922e6baff..0000000000 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/nginx.yaml +++ /dev/null @@ -1,560 +0,0 @@ -{{- if .Values.global.grafana.enabled -}} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "fullname" . }}-nginx-dashboard - namespace: {{ .Release.Namespace }} - labels: - gitlab_grafana_dashboard: "true" -{{ include "gitlab.standardLabels" . | indent 4 }} -data: - nginx.json: | - { - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "links": [], - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "fill": 1, - "gridPos": { - "h": 11, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 2, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum by (instance) (\n rate(nginx_vts_upstream_request_seconds_total{instance=~\"$instance\"}[$__interval])\n) /\nsum by (instance) (\n rate(nginx_vts_upstream_requests_total{instance=~\"$instance\"}[$__interval])\n)", - "format": "heatmap", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "{{"{{instance}}"}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Latency", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "s", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 11 - }, - "id": 4, - "panels": [], - "title": "Throughput", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "fill": 2, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 12 - }, - "id": 6, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum without (instance) (\n rate(nginx_vts_server_bytes_total{instance=~\"$instance\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "{{"{{direction}}-{{host}}"}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Server - Current total of incoming / outgoing bytes", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "decbytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": false - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "fill": 1, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 12 - }, - "id": 8, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum without (instance) (\n rate(nginx_vts_upstream_bytes_total{instance=~\"$instance\"}[$__interval])\n)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "{{"{{direction}}-{{backend}}-{{upstream}}"}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Upstream - Current total of incoming / outgoing bytes", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "decbytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": false - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 20 - }, - "id": 14, - "panels": [], - "title": "Requests by HTTP code", - "type": "row" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "fill": 2, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 21 - }, - "id": 10, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum without (instance) (\n rate(nginx_vts_server_requests_total{instance=~\"$instance\"}[$__interval])\n)", - "format": "time_series", - "instant": false, - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "{{"{{code}} {{host}}"}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Server - Requests by HTTP code", - "tooltip": { - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": null, - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": false - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "fill": 2, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 21 - }, - "id": 12, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum without (instance) (\n rate(nginx_vts_upstream_requests_total{instance=~\"$instance\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "{{"{{code}} {{backend}} {{upstream }}"}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Upstream - Requests by HTTP code", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": false - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "refresh": "1m", - "schemaVersion": 18, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "allValue": null, - "current": { - "text": "All", - "value": "$__all" - }, - "datasource": "GitLab Omnibus", - "definition": "label_values(up{job=\"nginx\"}, instance)", - "hide": 0, - "includeAll": true, - "label": null, - "multi": false, - "name": "instance", - "options": [], - "query": "label_values(up{job=\"nginx\"}, instance)", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-6h", - "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": "GitLab Omnibus - NGINX VTS", - "uid": "SIHl30qik", - "version": 7 - } -{{- end }} \ No newline at end of file diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/overview.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/overview.yaml deleted file mode 100644 index 7c7d04d8a0..0000000000 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/overview.yaml +++ /dev/null @@ -1,1006 +0,0 @@ -{{- if .Values.global.grafana.enabled -}} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "fullname" . }}-overview-dashboard - namespace: {{ .Release.Namespace }} - labels: - gitlab_grafana_dashboard: "true" -{{ include "gitlab.standardLabels" . | indent 4 }} -data: - overview.json: | - { - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "description": "GitLab Omnibus Dashboard (>= 10.3)", - "editable": true, - "gnetId": 5774, - "graphTooltip": 0, - "iteration": 1556024863891, - "links": [ - { - "icon": "external link", - "tags": [], - "title": "GitLab Docs", - "tooltip": "", - "type": "link", - "url": "https://docs.gitlab.com/" - } - ], - "panels": [ - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#d44a3a", - "rgba(237, 129, 40, 0.89)", - "#299c46" - ], - "datasource": "GitLab Omnibus", - "format": "percentunit", - "gauge": { - "maxValue": 1, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 0, - "y": 0 - }, - "id": 6, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "avg(\n avg_over_time(up{job=~\"gitlab-(rails|unicorn)\",instance=~\"($node):.*\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": ".95,.99", - "title": "Unicorn Up", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#d44a3a", - "rgba(237, 129, 40, 0.89)", - "#299c46" - ], - "datasource": "GitLab Omnibus", - "format": "percentunit", - "gauge": { - "maxValue": 1, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 4, - "y": 0 - }, - "id": 9, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "avg(\n avg_over_time(pg_up{instance=~\"($node):.*\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": ".95,.99", - "title": "Postgres Up", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#d44a3a", - "rgba(237, 129, 40, 0.89)", - "#299c46" - ], - "datasource": "GitLab Omnibus", - "format": "percentunit", - "gauge": { - "maxValue": 1, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 8, - "y": 0 - }, - "id": 7, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "avg(\n avg_over_time(up{job=\"gitlab-sidekiq\",instance=~\"($node):.*\"}[$__interval])\n) ", - "format": "time_series", - "interval": "1m", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": ".95,.99", - "title": "Sidekiq Up", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#d44a3a", - "rgba(237, 129, 40, 0.89)", - "#299c46" - ], - "datasource": "GitLab Omnibus", - "format": "percentunit", - "gauge": { - "maxValue": 1, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 12, - "y": 0 - }, - "id": 8, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "avg(\n avg_over_time(up{job=\"gitlab-workhorse\",instance=~\"($node):.*\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": ".95,.99", - "title": "Workhorse Up", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#d44a3a", - "rgba(237, 129, 40, 0.89)", - "#299c46" - ], - "datasource": "GitLab Omnibus", - "format": "percentunit", - "gauge": { - "maxValue": 1, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 16, - "y": 0 - }, - "id": 5, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "avg(\n avg_over_time(redis_up{instance=~\"$node:9121\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": ".95,.99", - "title": "Redis Up", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#d44a3a", - "rgba(237, 129, 40, 0.89)", - "#299c46" - ], - "datasource": "GitLab Omnibus", - "format": "percentunit", - "gauge": { - "maxValue": 1, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 20, - "y": 0 - }, - "id": 10, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "avg(\n avg_over_time(up{job=\"gitaly\",instance=~\"($node):.*\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": ".95,.99", - "title": "Gitaly Up", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#d44a3a", - "rgba(237, 129, 40, 0.89)", - "#299c46" - ], - "datasource": "GitLab Omnibus", - "decimals": 1, - "format": "percentunit", - "gauge": { - "maxValue": 1, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 5, - "w": 8, - "x": 0, - "y": 4 - }, - "id": 1, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true - }, - "tableColumn": "", - "targets": [ - { - "expr": "(\n node_memory_MemAvailable_bytes{instance=~\"$node:9100\"} or\n (node_memory_MemFree_bytes{instance=~\"$node:9100\"} + node_memory_Buffers_bytes{instance=~\"$node:9100\"} + node_memory_Cached_bytes{instance=~\"$node:9100\"})\n) / node_memory_MemTotal_bytes{instance=~\"$node:9100\"}", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "", - "refId": "B" - } - ], - "thresholds": "0.05, 0.1", - "title": "Node Available Memory", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#d44a3a", - "rgba(237, 129, 40, 0.89)", - "#299c46" - ], - "datasource": "GitLab Omnibus", - "decimals": 1, - "format": "percentunit", - "gauge": { - "maxValue": 1, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 5, - "w": 8, - "x": 8, - "y": 4 - }, - "id": 4, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(node_filesystem_avail_bytes{fstype!~\"tmpfs\",instance=~\"($node):9100\"}) / sum(node_filesystem_size_bytes{fstype!~\"tmpfs\",instance=~\"($node):9100\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "refId": "B" - } - ], - "thresholds": "0.1, 0.2", - "title": "Node Disk Free", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "GitLab Omnibus", - "decimals": 1, - "format": "percentunit", - "gauge": { - "maxValue": 1, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 5, - "w": 8, - "x": 16, - "y": 4 - }, - "id": 11, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true - }, - "tableColumn": "", - "targets": [ - { - "expr": "avg(\n 1 -\n avg without (mode,cpu) (\n rate(node_cpu_seconds_total{mode=\"idle\",instance=~\"($node):9100\"}[$__interval])\n )\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "", - "refId": "B" - } - ], - "thresholds": ".8,.9", - "title": "CPU Load", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "fill": 1, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 9 - }, - "id": 12, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(\n avg_over_time(\n sidekiq_queue_size{instance=~\"($node):.*\"}[$__interval]\n )\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 2, - "legendFormat": "Queued", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Sidekiq Queue", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": null, - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "cards": { - "cardPadding": null, - "cardRound": null - }, - "color": { - "cardColor": "#b4ff00", - "colorScale": "sqrt", - "colorScheme": "interpolateOranges", - "exponent": 0.5, - "mode": "opacity" - }, - "dataFormat": "tsbuckets", - "datasource": "GitLab Omnibus", - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 9 - }, - "heatmap": {}, - "highlightCards": true, - "id": 13, - "legend": { - "show": false - }, - "links": [], - "targets": [ - { - "expr": "sum by (le) (\n rate(gitlab_workhorse_http_request_duration_seconds_bucket{instance=~\"($node):9229\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 5, - "legendFormat": "{{"{{le}}"}}", - "refId": "B" - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Workhorse Latency", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": 0, - "format": "s", - "logBase": 1, - "max": null, - "min": null, - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null - } - ], - "refresh": "1m", - "schemaVersion": 18, - "style": "dark", - "tags": [ - "GitLab" - ], - "templating": { - "list": [ - { - "allValue": null, - "current": { - "tags": [], - "text": "All", - "value": "$__all" - }, - "datasource": "GitLab Omnibus", - "definition": "", - "hide": 0, - "includeAll": true, - "label": null, - "multi": false, - "name": "node", - "options": [], - "query": "label_values(up{job=\"node\"}, instance)", - "refresh": 1, - "regex": "/(.*):9100/", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-3h", - "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": "GitLab Omnibus - Overview", - "uid": "wsSteMemz", - "version": 21 - } -{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/postgresql.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/postgresql.yaml deleted file mode 100644 index 5bbcb0dede..0000000000 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/postgresql.yaml +++ /dev/null @@ -1,919 +0,0 @@ -{{- if .Values.global.grafana.enabled -}} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "fullname" . }}-postgresql-dashboard - namespace: {{ .Release.Namespace }} - labels: - gitlab_grafana_dashboard: "true" -{{ include "gitlab.standardLabels" . | indent 4 }} -data: - postgresql.json: | - { - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "iteration": 1556027304979, - "links": [], - "panels": [ - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#d44a3a", - "rgba(237, 129, 40, 0.89)", - "#299c46" - ], - "datasource": "GitLab Omnibus", - "format": "percentunit", - "gauge": { - "maxValue": 1, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 0, - "y": 0 - }, - "id": 2, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "avg_over_time(pg_up{job=\"postgres\",instance=~\"$instance\"}[$__interval]) or avg_over_time(up{job=\"postgres\",instance=~\"$instance\"}[$__interval]) ", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": "0.8, 0.9", - "title": "Availability", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": true, - "colors": [ - "#d44a3a", - "rgba(237, 129, 40, 0.89)", - "#299c46" - ], - "datasource": "GitLab Omnibus", - "format": "dtdurations", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 4, - "y": 0 - }, - "id": 10, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "avg(time() - pg_postmaster_start_time_seconds{instance=~\"$instance\"})", - "format": "time_series", - "instant": true, - "interval": "", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": "60, 3600", - "title": "Postmaster Uptime", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "fill": 1, - "gridPos": { - "h": 8, - "w": 8, - "x": 8, - "y": 0 - }, - "id": 8, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum by (mode) (\n avg_over_time(pg_locks_count{instance=~\"$instance\",datname=\"gitlabhq_production\"}[$__interval])\n)", - "format": "time_series", - "interval": "30s", - "intervalFactor": 1, - "legendFormat": "{{"{{mode}}"}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Locks", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "fill": 0, - "gridPos": { - "h": 8, - "w": 8, - "x": 16, - "y": 0 - }, - "id": 4, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Last Week", - "dashes": true - } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(\n rate(pg_slow_queries{instance=~\"$instance\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "Current", - "refId": "A" - }, - { - "expr": "sum(\n rate(pg_slow_queries{instance=~\"$instance\"}[$__interval] offset 1w)\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "Last Week", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Slow Queries", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "ops", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "GitLab Omnibus", - "decimals": 1, - "format": "percentunit", - "gauge": { - "maxValue": 1, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 0, - "y": 4 - }, - "id": 13, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(avg_over_time(pg_stat_activity_count{instance=~\"$instance\",state=\"active\"}[$__interval])) /\nsum(pg_settings_max_connections{instance=~\"$instance\"})", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": "0.8, 0.9", - "title": "Active Connections", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": "GitLab Omnibus", - "format": "percentunit", - "gauge": { - "maxValue": 1, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 4, - "y": 4 - }, - "id": 12, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(avg_over_time(pg_stat_activity_count{instance=~\"$instance\"}[$__interval])) /\nsum(pg_settings_max_connections{instance=~\"$instance\"})", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "thresholds": "0.8, 0.9", - "title": "Connections", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "fill": 1, - "gridPos": { - "h": 9, - "w": 8, - "x": 0, - "y": 8 - }, - "id": 15, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(\n rate(pg_stat_database_xact_commit{instance=~\"$instance\",datname=\"gitlabhq_production\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "Commit", - "refId": "A" - }, - { - "expr": "sum(\n rate(pg_stat_database_xact_rollback{instance=~\"$instance\",datname=\"gitlabhq_production\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "Rollback", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Transactions", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "fill": 1, - "gridPos": { - "h": 9, - "w": 8, - "x": 8, - "y": 8 - }, - "id": 17, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(\n rate(pg_stat_database_blks_hit{instance=~\"$instance\",datname=\"gitlabhq_production\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "Cache Hits", - "refId": "B" - }, - { - "expr": "sum(\n rate(pg_stat_database_blks_read{instance=~\"$instance\",datname=\"gitlabhq_production\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "Reads", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Block IO", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "fill": 1, - "gridPos": { - "h": 9, - "w": 8, - "x": 16, - "y": 8 - }, - "id": 6, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(\n rate(pg_stat_database_tup_fetched{instance=~\"$instance\",datname=\"gitlabhq_production\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "Fetched", - "refId": "A" - }, - { - "expr": "sum(\n rate(pg_stat_database_tup_deleted{instance=~\"$instance\",datname=\"gitlabhq_production\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "Deleted", - "refId": "B" - }, - { - "expr": "sum(\n rate(pg_stat_database_tup_inserted{instance=~\"$instance\",datname=\"gitlabhq_production\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "Inserted", - "refId": "C" - }, - { - "expr": "sum(\n rate(pg_stat_database_tup_updated{instance=~\"$instance\",datname=\"gitlabhq_production\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "Updated", - "refId": "D" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Tuple Stats", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "refresh": "1m", - "schemaVersion": 18, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "allValue": null, - "current": { - "tags": [], - "text": "All", - "value": "$__all" - }, - "datasource": "GitLab Omnibus", - "definition": "", - "hide": 0, - "includeAll": true, - "label": null, - "multi": false, - "name": "instance", - "options": [], - "query": "label_values(up{job=\"postgres\"}, instance)", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-24h", - "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": "GitLab Omnibus - PostgreSQL", - "uid": "c_LJgXfmk", - "version": 10 - } -{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/rails-app.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/rails-app.yaml deleted file mode 100644 index 6b8c6458ef..0000000000 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/rails-app.yaml +++ /dev/null @@ -1,500 +0,0 @@ -{{- if .Values.global.grafana.enabled -}} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "fullname" . }}-rails-app-dashboard - namespace: {{ .Release.Namespace }} - labels: - gitlab_grafana_dashboard: "true" -{{ include "gitlab.standardLabels" . | indent 4 }} -data: - rails-app.json: | - { - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "id": 10, - "iteration": 1561446858259, - "links": [], - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "description": "", - "fill": 0, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 5, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "avg(avg_over_time(ruby_process_resident_memory_bytes{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval])) or \navg(avg_over_time(ruby_memory_bytes{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval]))", - "format": "time_series", - "interval": "30s", - "intervalFactor": 1, - "legendFormat": "Average", - "refId": "A" - }, - { - "expr": "max(max_over_time(ruby_process_resident_memory_bytes{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval])) or\nmax(max_over_time(ruby_memory_bytes{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval]))", - "format": "time_series", - "interval": "30s", - "intervalFactor": 1, - "legendFormat": "Max", - "refId": "B" - }, - { - "expr": "min(min_over_time(ruby_process_resident_memory_bytes{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval])) or\nmin(min_over_time(ruby_memory_bytes{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval]))", - "format": "time_series", - "interval": "30s", - "intervalFactor": 1, - "legendFormat": "Min", - "refId": "C" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Ruby Memory", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "description": "", - "fill": 1, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 0 - }, - "id": 2, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(avg_over_time(unicorn_queued_connections{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval])) or\nsum(avg_over_time(puma_queued_connections{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval]))\n", - "format": "time_series", - "interval": "30s", - "intervalFactor": 1, - "legendFormat": "Queued Requests", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Queued Requests", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "fill": 1, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 9 - }, - "id": 7, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "avg(rate(ruby_process_cpu_seconds_total{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval]))", - "format": "time_series", - "interval": "30s", - "intervalFactor": 1, - "legendFormat": "Average", - "refId": "A" - }, - { - "expr": "max(rate(ruby_process_cpu_seconds_total{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval]))", - "format": "time_series", - "interval": "30s", - "intervalFactor": 1, - "legendFormat": "Max", - "refId": "B" - }, - { - "expr": "min(rate(ruby_process_cpu_seconds_total{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval]))", - "format": "time_series", - "interval": "30s", - "intervalFactor": 1, - "legendFormat": "Min", - "refId": "D" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Ruby CPU", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "description": "", - "fill": 0, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 9 - }, - "id": 3, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Available Workers", - "dashes": true, - "linewidth": 2 - } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(avg_over_time(unicorn_active_connections{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval])) or\nsum(avg_over_time(puma_active_connections{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval]))", - "format": "time_series", - "interval": "30s", - "intervalFactor": 1, - "legendFormat": "Average", - "refId": "A" - }, - { - "expr": "sum(max_over_time(unicorn_active_connections{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval])) or\nsum(max_over_time(puma_active_connections{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval]))", - "format": "time_series", - "interval": "30s", - "intervalFactor": 1, - "legendFormat": "Max", - "refId": "B" - }, - { - "expr": "count(avg_over_time(ruby_memory_bytes{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval])) or\nsum(avg_over_time(puma_max_threads{job=\"gitlab-rails\",instance=~\"$instance\"}[$__interval]))", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "Available Workers", - "refId": "C" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Active Requests", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "refresh": "1m", - "schemaVersion": 18, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "allValue": null, - "current": { - "text": "All", - "value": "$__all" - }, - "datasource": "GitLab Omnibus", - "definition": "label_values(unicorn_active_connections, instance)", - "hide": 0, - "includeAll": true, - "label": null, - "multi": false, - "name": "instance", - "options": [], - "query": "label_values(unicorn_active_connections, instance)", - "refresh": 2, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-24h", - "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": "GitLab Omnibus - Rails App", - "uid": "36owr67Wz", - "version": 7 - } -{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/redis.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/redis.yaml deleted file mode 100644 index 56f412ffce..0000000000 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/redis.yaml +++ /dev/null @@ -1,1111 +0,0 @@ -{{- if .Values.global.grafana.enabled -}} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "fullname" . }}-redis-dashboard - namespace: {{ .Release.Namespace }} - labels: - gitlab_grafana_dashboard: "true" -{{ include "gitlab.standardLabels" . | indent 4 }} -data: - redis.json: | - { - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "description": "GitLab Omnibus dashboard for Redis servers", - "editable": true, - "gnetId": 763, - "graphTooltip": 0, - "iteration": 1556027798221, - "links": [], - "panels": [ - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "datasource": "GitLab Omnibus", - "decimals": 0, - "editable": true, - "error": false, - "format": "dtdurations", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 0, - "y": 0 - }, - "id": 9, - "interval": null, - "isNew": true, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "addr", - "targets": [ - { - "expr": "avg(time() - redis_start_time_seconds{instance=~\"$instance\"})", - "format": "time_series", - "instant": true, - "interval": "", - "intervalFactor": 2, - "legendFormat": "", - "metric": "", - "refId": "A", - "step": 1800 - } - ], - "thresholds": "", - "title": "Uptime", - "type": "singlestat", - "valueFontSize": "70%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "current" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "datasource": "GitLab Omnibus", - "decimals": 0, - "editable": true, - "error": false, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 4, - "y": 0 - }, - "hideTimeOverride": true, - "id": 12, - "interval": null, - "isNew": true, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": true - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(\n avg_over_time(redis_connected_clients{instance=~\"$instance\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 2, - "legendFormat": "", - "metric": "", - "refId": "A", - "step": 2 - } - ], - "thresholds": "", - "timeFrom": "1m", - "timeShift": null, - "title": "Clients", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "gridPos": { - "h": 6, - "w": 8, - "x": 8, - "y": 0 - }, - "id": 2, - "isNew": true, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": false, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "paceLength": 10, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(\n rate(redis_commands_processed_total{instance=~\"$instance\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 2, - "legendFormat": "", - "metric": "A", - "refId": "A", - "step": 240, - "target": "" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Commands Executed", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "reqps", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "decimals": 2, - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "gridPos": { - "h": 6, - "w": 8, - "x": 16, - "y": 0 - }, - "id": 1, - "isNew": true, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": false, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "paceLength": 10, - "percentage": true, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(\n rate(redis_keyspace_hits_total{instance=~\"$instance\"}[$__interval])\n)", - "format": "time_series", - "hide": false, - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "hits", - "metric": "", - "refId": "A", - "step": 240, - "target": "" - }, - { - "expr": "sum(\n rate(redis_keyspace_misses_total{instance=~\"$instance\"}[$__interval])\n)", - "format": "time_series", - "hide": false, - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "misses", - "metric": "", - "refId": "B", - "step": 240, - "target": "" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Hits, Misses per Second", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": { - "max": "#BF1B00" - }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "gridPos": { - "h": 10, - "w": 8, - "x": 0, - "y": 3 - }, - "id": 7, - "isNew": true, - "legend": { - "avg": false, - "current": false, - "hideEmpty": false, - "hideZero": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "null as zero", - "paceLength": 10, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "/max - .*/", - "dashes": true - } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "redis_memory_used_bytes{instance=~\"$instance\"}", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "{{"used - {{instance}}"}}", - "metric": "", - "refId": "A", - "step": 240, - "target": "" - }, - { - "expr": "redis_config_maxmemory{instance=~\"$instance\"} > 0", - "format": "time_series", - "hide": false, - "intervalFactor": 2, - "legendFormat": "{{"max - {{instance}}"}}", - "refId": "B", - "step": 240 - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Memory Usage", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "bytes", - "label": null, - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": { - "evicts": "#890F02", - "memcached_items_evicted_total{instance=\"172.17.0.1:9150\",job=\"prometheus\"}": "#890F02", - "reclaims": "#3F6833" - }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "gridPos": { - "h": 7, - "w": 8, - "x": 8, - "y": 6 - }, - "id": 8, - "isNew": true, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "paceLength": 10, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "reclaims", - "yaxis": 2 - } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(rate(redis_expired_keys_total{instance=~\"$instance\"}[$__interval]))", - "format": "time_series", - "interval": "1m", - "intervalFactor": 2, - "legendFormat": "expired", - "metric": "", - "refId": "A", - "step": 240, - "target": "" - }, - { - "expr": "sum(rate(redis_evicted_keys_total{instance=~\"$instance\"}[$__interval]))", - "format": "time_series", - "interval": "1m", - "intervalFactor": 2, - "legendFormat": "evicted", - "refId": "B", - "step": 240 - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Expired / Evicted", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "editable": true, - "error": false, - "fill": 1, - "grid": {}, - "gridPos": { - "h": 7, - "w": 8, - "x": 16, - "y": 6 - }, - "id": 10, - "isNew": true, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "paceLength": 10, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(\n rate(redis_net_input_bytes_total{instance=~\"$instance\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 2, - "legendFormat": "In", - "refId": "A", - "step": 240 - }, - { - "expr": "sum(\n rate(redis_net_output_bytes_total{instance=~\"$instance\"}[$__interval])\n)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 2, - "legendFormat": "Out", - "refId": "B", - "step": 240 - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Network I/O", - "tooltip": { - "msResolution": true, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "editable": true, - "error": false, - "fill": 8, - "grid": {}, - "gridPos": { - "h": 7, - "w": 16, - "x": 0, - "y": 13 - }, - "id": 14, - "isNew": true, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "connected", - "paceLength": 10, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "expr": "sum without (instance) (\n rate(redis_commands_total{instance=~\"$instance\"}[$__interval])\n) > 0", - "format": "time_series", - "interval": "1m", - "intervalFactor": 2, - "legendFormat": "{{"{{ cmd }}"}}", - "metric": "redis_command_calls_total", - "refId": "A", - "step": 240 - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Command Calls / sec", - "tooltip": { - "msResolution": true, - "shared": true, - "sort": 2, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "editable": true, - "error": false, - "fill": 7, - "grid": {}, - "gridPos": { - "h": 7, - "w": 8, - "x": 16, - "y": 13 - }, - "id": 13, - "isNew": true, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "paceLength": 10, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "expr": "sum(redis_db_keys{instance=~\"$instance\"} - redis_db_keys_expiring{instance=~\"$instance\"}) ", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "not expiring", - "refId": "A", - "step": 240, - "target": "" - }, - { - "expr": "sum(redis_db_keys_expiring{instance=~\"$instance\"})", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "expiring", - "metric": "", - "refId": "B", - "step": 240 - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Expiring vs Not-Expiring Keys", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "editable": true, - "error": false, - "fill": 7, - "grid": {}, - "gridPos": { - "h": 7, - "w": 16, - "x": 0, - "y": 20 - }, - "id": 5, - "isNew": true, - "legend": { - "alignAsTable": true, - "avg": false, - "current": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "paceLength": 10, - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": false, - "targets": [ - { - "expr": "sum by (db) (\n redis_db_keys{instance=~\"$instance\"}\n)", - "format": "time_series", - "interval": "", - "intervalFactor": 2, - "legendFormat": "{{"{{ db }}"}}", - "refId": "A", - "step": 240, - "target": "" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Items per DB", - "tooltip": { - "msResolution": false, - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "none", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "refresh": "1m", - "schemaVersion": 18, - "style": "dark", - "tags": [ - "redis" - ], - "templating": { - "list": [ - { - "allValue": null, - "current": { - "tags": [], - "text": "All", - "value": "$__all" - }, - "datasource": "GitLab Omnibus", - "definition": "", - "hide": 0, - "includeAll": true, - "label": null, - "multi": false, - "name": "instance", - "options": [], - "query": "label_values(up{job=\"redis\"}, instance)", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-24h", - "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": "GitLab Omnibus - Redis", - "uid": "XDaNK6amz", - "version": 7 - } -{{- end }} diff --git a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/registry.yaml b/charts/gitlab/charts/gitlab-grafana/templates/dashboards/registry.yaml deleted file mode 100644 index 952a71685d..0000000000 --- a/charts/gitlab/charts/gitlab-grafana/templates/dashboards/registry.yaml +++ /dev/null @@ -1,521 +0,0 @@ -{{- if .Values.global.grafana.enabled -}} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "fullname" . }}-registry-dashboard - namespace: {{ .Release.Namespace }} - labels: - gitlab_grafana_dashboard: "true" -{{ include "gitlab.standardLabels" . | indent 4 }} -data: - registry.json: | - { - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "links": [], - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "fill": 1, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 5, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum by (handler) (\n rate(registry_http_requests_total{instance=\"$instance\",handler=~\"$handler\"}[$__interval])\n)", - "format": "time_series", - "interval": "30s", - "intervalFactor": 1, - "legendFormat": "{{"{{handler}}"}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Requests", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "cards": { - "cardPadding": null, - "cardRound": null - }, - "color": { - "cardColor": "#b4ff00", - "colorScale": "sqrt", - "colorScheme": "interpolateOranges", - "exponent": 0.5, - "mode": "opacity" - }, - "dataFormat": "tsbuckets", - "datasource": "GitLab Omnibus", - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 0 - }, - "heatmap": {}, - "hideZeroBuckets": false, - "highlightCards": true, - "id": 8, - "legend": { - "show": false - }, - "links": [], - "reverseYBuckets": false, - "targets": [ - { - "expr": "sum by (le) (\n rate(registry_http_request_duration_seconds_bucket{instance=\"$instance\",handler=~\"$handler\"}[$__interval])\n) > 0", - "format": "heatmap", - "interval": "30s", - "intervalFactor": 10, - "legendFormat": "{{"{{le}}"}}", - "refId": "A" - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Latency", - "tooltip": { - "show": true, - "showHistogram": false - }, - "type": "heatmap", - "xAxis": { - "show": true - }, - "xBucketNumber": null, - "xBucketSize": null, - "yAxis": { - "decimals": 0, - "format": "s", - "logBase": 1, - "max": null, - "min": null, - "show": true, - "splitFactor": null - }, - "yBucketBound": "auto", - "yBucketNumber": null, - "yBucketSize": null - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "fill": 1, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 10 - }, - "id": 6, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum by (code) (\n rate(registry_http_requests_total{instance=\"$instance\"}[$__interval])\n)", - "format": "time_series", - "interval": "30s", - "intervalFactor": 1, - "legendFormat": "{{"{{code}}"}}", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Requests", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": ["#d44a3a", "rgba(237, 129, 40, 0.89)", "#299c46"], - "datasource": "GitLab Omnibus", - "format": "percentunit", - "gauge": { - "maxValue": 1, - "minValue": 0, - "show": true, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 4, - "w": 3, - "x": 12, - "y": 10 - }, - "id": 3, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "sum(rate(registry_storage_cache_total{instance=\"$instance\",type=\"Hit\"}[$__interval])) / sum(rate(registry_storage_cache_total{instance=\"$instance\",type=\"Request\"}[$__interval]))", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "Ratio", - "refId": "A" - } - ], - "thresholds": "0.5, 0.75", - "timeFrom": null, - "timeShift": null, - "title": "Cache Hit Ratio", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "GitLab Omnibus", - "fill": 1, - "gridPos": { - "h": 10, - "w": 9, - "x": 15, - "y": 10 - }, - "id": 2, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "paceLength": 10, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "sum(rate(registry_storage_cache_total{instance=\"$instance\",type=\"Request\"}[$__interval]))", - "format": "time_series", - "interval": "30s", - "intervalFactor": 1, - "legendFormat": "Requests", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Cache Requests", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "refresh": "1m", - "schemaVersion": 18, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "allValue": null, - "current": { - "isNone": true, - "text": "None", - "value": "" - }, - "datasource": "GitLab Omnibus", - "definition": "label_values(up{job=\"registry\"}, instance)", - "hide": 0, - "includeAll": false, - "label": null, - "multi": false, - "name": "instance", - "options": [], - "query": "label_values(up{job=\"registry\"}, instance)", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": null, - "current": { - "text": "All", - "value": ["$__all"] - }, - "datasource": "GitLab Omnibus", - "definition": "label_values(registry_http_requests_total{instance=\"$instance\"}, handler)", - "hide": 0, - "includeAll": true, - "label": null, - "multi": true, - "name": "handler", - "options": [], - "query": "label_values(registry_http_requests_total{instance=\"$instance\"}, handler)", - "refresh": 2, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "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": "GitLab Omnibus - Registry", - "uid": "k7-rFGGZk", - "version": 8 - } -{{- end }} -- GitLab From 1d06c19ee5d70d788bc21854158895ac0b5d4048 Mon Sep 17 00:00:00 2001 From: Gerard Hickey Date: Thu, 22 Aug 2019 22:06:07 +0000 Subject: [PATCH 14/25] Apply suggestion to doc/charts/gitlab/gitlab-grafana/index.md --- doc/charts/gitlab/gitlab-grafana/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/charts/gitlab/gitlab-grafana/index.md b/doc/charts/gitlab/gitlab-grafana/index.md index 1d6258e403..a6744ae84b 100644 --- a/doc/charts/gitlab/gitlab-grafana/index.md +++ b/doc/charts/gitlab/gitlab-grafana/index.md @@ -1,6 +1,6 @@ # Using the gitlab-grafana chart -The `gitlab-grafana` subchart adapts the `stable/grafana` chart operate +The `gitlab-grafana` subchart adapts the `stable/grafana` chart to operate correctly with the same level of configuration on par with the Omnibus GitLab install. In addition, the installation of Grafana allows additional dashboards to be installed by the end user and be incorporated with the -- GitLab From dd38792b4f5a13db7f0dc398c10300ea192cfc24 Mon Sep 17 00:00:00 2001 From: Gerard Hickey Date: Thu, 22 Aug 2019 22:06:54 +0000 Subject: [PATCH 15/25] Apply suggestion to doc/charts/gitlab/gitlab-grafana/index.md --- doc/charts/gitlab/gitlab-grafana/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/charts/gitlab/gitlab-grafana/index.md b/doc/charts/gitlab/gitlab-grafana/index.md index a6744ae84b..a9d8c2b692 100644 --- a/doc/charts/gitlab/gitlab-grafana/index.md +++ b/doc/charts/gitlab/gitlab-grafana/index.md @@ -1,7 +1,7 @@ # Using the gitlab-grafana chart The `gitlab-grafana` subchart adapts the `stable/grafana` chart to operate -correctly with the same level of configuration on par with the Omnibus +correctly with the same level of configuration as the Omnibus GitLab install. In addition, the installation of Grafana allows additional dashboards to be installed by the end user and be incorporated with the GitLab supplied dashboards. -- GitLab From 7afe1897e9724f2cd4c6bc8ef237f81867a4d45d Mon Sep 17 00:00:00 2001 From: Gerard Hickey Date: Thu, 22 Aug 2019 22:08:50 +0000 Subject: [PATCH 16/25] Apply suggestion to values.yaml --- values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/values.yaml b/values.yaml index 5a9629ce3b..43591d0294 100644 --- a/values.yaml +++ b/values.yaml @@ -486,7 +486,7 @@ grafana: grafana.ini: server: root_url: http://localhost/-/grafana/ - ## We generatd and provide random passwords + ## We generate and provide random passwords ## NOTE: the Secret & ConfigMap names are hard coded! extraSecretMounts: - name: initial-password -- GitLab From 87d84abf1a343e5ad4dcde38b748bc614a76686c Mon Sep 17 00:00:00 2001 From: Gerard Hickey Date: Thu, 22 Aug 2019 22:18:19 +0000 Subject: [PATCH 17/25] Apply suggestion to doc/charts/globals.md --- doc/charts/globals.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/charts/globals.md b/doc/charts/globals.md index 413fa79384..907c98ea38 100644 --- a/doc/charts/globals.md +++ b/doc/charts/globals.md @@ -168,7 +168,7 @@ global: ## Configure Grafana integration -The GitLab global grafana settings are located under the `global.grafana`. At this time, the only setting available is `global.grafana.enabled`. +The GitLab global grafana settings are located under `global.grafana`. At this time, the only setting available is `global.grafana.enabled`. When set to `true`, the GitLab chart will deploy the [Grafana chart](https://github.com/helm/helm/tree/master/stable/grafana), expose it under `/-/grafana` of the GitLab Ingress, and pre-configure it with a secure random password. The generated password can be found in `gitlab-grafana-initial-root-password`. -- GitLab From 380a4058fe720f61d753865d66b5e7d3c039b7bf Mon Sep 17 00:00:00 2001 From: Gerard Hickey Date: Thu, 22 Aug 2019 12:37:40 -1000 Subject: [PATCH 18/25] Added reference to stable/grafana chart --- doc/charts/gitlab/gitlab-grafana/index.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/charts/gitlab/gitlab-grafana/index.md b/doc/charts/gitlab/gitlab-grafana/index.md index a9d8c2b692..bf2769dd13 100644 --- a/doc/charts/gitlab/gitlab-grafana/index.md +++ b/doc/charts/gitlab/gitlab-grafana/index.md @@ -1,11 +1,13 @@ # Using the gitlab-grafana chart -The `gitlab-grafana` subchart adapts the `stable/grafana` chart to operate +The `gitlab-grafana` subchart adapts the [stable/grafana][] chart to operate correctly with the same level of configuration as the Omnibus GitLab install. In addition, the installation of Grafana allows additional dashboards to be installed by the end user and be incorporated with the GitLab supplied dashboards. +[stable/grafana]: https://github.com/helm/charts/tree/master/stable/grafana + ## Requirements This chart depends on the `stable/grafana` chart which is usually installed -- GitLab From e293f9ffe534cfbbbaa4861faaf76cf0a9e47602 Mon Sep 17 00:00:00 2001 From: Gerard Hickey Date: Thu, 22 Aug 2019 12:38:15 -1000 Subject: [PATCH 19/25] Removed reference that GitLab chart installs Grafana dashbaords --- doc/charts/globals.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/charts/globals.md b/doc/charts/globals.md index 907c98ea38..75eb210ea7 100644 --- a/doc/charts/globals.md +++ b/doc/charts/globals.md @@ -170,9 +170,9 @@ global: The GitLab global grafana settings are located under `global.grafana`. At this time, the only setting available is `global.grafana.enabled`. -When set to `true`, the GitLab chart will deploy the [Grafana chart](https://github.com/helm/helm/tree/master/stable/grafana), expose it under `/-/grafana` of the GitLab Ingress, and pre-configure it with a secure random password. The generated password can be found in `gitlab-grafana-initial-root-password`. +When set to `true`, the GitLab chart will deploy the [Grafana chart](https://github.com/helm/helm/tree/master/stable/grafana), expose it under `/-/grafana` of the GitLab Ingress, and pre-configure it with a secure random password. The generated password can be found in the Secret named `gitlab-grafana-initial-root-password`. -The GitLab chart also preloads dashboards, and connects to the deployed Prometheus instance. +The GitLab chart connects to the deployed Prometheus instance. ## Configure Registry settings -- GitLab From 6a2f764408a549491c5e3b99f340ee0d4d8653d9 Mon Sep 17 00:00:00 2001 From: Gerard Hickey Date: Thu, 22 Aug 2019 12:42:22 -1000 Subject: [PATCH 20/25] Renamed Grafana datasource to reference installed Prometheus --- .../charts/gitlab-grafana/templates/datasource-configmap.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/gitlab/charts/gitlab-grafana/templates/datasource-configmap.yaml b/charts/gitlab/charts/gitlab-grafana/templates/datasource-configmap.yaml index dfbdcfd15f..6b13e75938 100644 --- a/charts/gitlab/charts/gitlab-grafana/templates/datasource-configmap.yaml +++ b/charts/gitlab/charts/gitlab-grafana/templates/datasource-configmap.yaml @@ -11,10 +11,10 @@ data: gitlab.yaml: | apiVersion: 1 deleteDatasources: - - name: GitLab Omnibus + - name: GitLab installed Prometheus orgId: 1 datasources: - - name: GitLab Omnibus + - name: GitLab installed Prometheus type: prometheus orgId: 1 url: "http://{{ .Release.Name }}-prometheus-server" -- GitLab From c1ff1b80a3bc0b0ee29642ec2b53e0c72748be5f Mon Sep 17 00:00:00 2001 From: Gerard Hickey Date: Thu, 22 Aug 2019 13:03:05 -1000 Subject: [PATCH 21/25] Grafana chart no longer creates its secret --- values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/values.yaml b/values.yaml index 43591d0294..c6f2c7924d 100644 --- a/values.yaml +++ b/values.yaml @@ -472,6 +472,7 @@ gitlab-runner: ## See requirements.yaml for current version ## Controlled by `global.grafana.enabled` grafana: + admin.existingSecret: true ## The following settings allow Grafana to dynamically create ## dashboards and datasources from configmaps. See ## https://github.com/helm/charts/tree/master/stable/grafana#sidecar-for-dashboards -- GitLab From a5972cc99ccefb6f67f4329c596c8ea226900ada Mon Sep 17 00:00:00 2001 From: Gerard Hickey Date: Sun, 25 Aug 2019 20:49:07 -1000 Subject: [PATCH 22/25] Changed Grafana setting to be consistent with other settings --- values.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/values.yaml b/values.yaml index c6f2c7924d..750eb1a078 100644 --- a/values.yaml +++ b/values.yaml @@ -472,7 +472,8 @@ gitlab-runner: ## See requirements.yaml for current version ## Controlled by `global.grafana.enabled` grafana: - admin.existingSecret: true + admin: + existingSecret: true ## The following settings allow Grafana to dynamically create ## dashboards and datasources from configmaps. See ## https://github.com/helm/charts/tree/master/stable/grafana#sidecar-for-dashboards -- GitLab From 68cf0d1a35756053983038887fcc176e6e17adf1 Mon Sep 17 00:00:00 2001 From: Gerard Hickey Date: Mon, 26 Aug 2019 09:26:14 -1000 Subject: [PATCH 23/25] Added Changelog entry --- changelogs/unreleased/sh-support-grafana.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelogs/unreleased/sh-support-grafana.yml diff --git a/changelogs/unreleased/sh-support-grafana.yml b/changelogs/unreleased/sh-support-grafana.yml new file mode 100644 index 0000000000..096a4ad5ae --- /dev/null +++ b/changelogs/unreleased/sh-support-grafana.yml @@ -0,0 +1,5 @@ +--- +title: Added Grafana support into chart install +merge_request: 789 +author: Gerard Hickey +type: added -- GitLab From 0a91d282d51d6ece2609b4dc24bb4cdcf2485eac Mon Sep 17 00:00:00 2001 From: Jason Plum Date: Wed, 28 Aug 2019 16:03:30 -0400 Subject: [PATCH 24/25] grafana: override all secret handling in upstream Update the properties to entirely skip / override upstream chart secret handling. This skips the secret creation, and negates the need configuration of the secret in any way. Signed-off-by: Jason Plum Signed-off-by: Gerard Hickey --- values.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/values.yaml b/values.yaml index 750eb1a078..e3348cc54d 100644 --- a/values.yaml +++ b/values.yaml @@ -472,8 +472,16 @@ gitlab-runner: ## See requirements.yaml for current version ## Controlled by `global.grafana.enabled` grafana: + ## Override and provide "bogus" administation secrets + ## gitlab/gitlab-grafana provides overrides via shared-secrets admin: - existingSecret: true + existingSecret: bogus + env: + GF_SECURITY_ADMIN_USER: bogus + GF_SECURITY_ADMIN_PASSWORD: bogus + ## This override allows gitlab/gitlab-grafana to completely override the secret + ## handling behavior of the upstream chart in combination with the above. + command: [ "sh", "-x", "/tmp/scripts/import-secret.sh" ] ## The following settings allow Grafana to dynamically create ## dashboards and datasources from configmaps. See ## https://github.com/helm/charts/tree/master/stable/grafana#sidecar-for-dashboards @@ -501,7 +509,6 @@ grafana: mountPath: /tmp/scripts configMap: gitlab-grafana-import-secret readOnly: true - command: [ "sh", "-x", "/tmp/scripts/import-secret.sh" ] ## Settings for individual sub-charts under GitLab ## Note: Many of these settings are configurable via globals -- GitLab From 39e5243f629c2c7eb224f1b726ee153d6d0b8291 Mon Sep 17 00:00:00 2001 From: Gerard Hickey Date: Wed, 28 Aug 2019 14:26:29 -1000 Subject: [PATCH 25/25] Set default values for NGINX proxy settings --- charts/gitlab/charts/gitlab-grafana/values.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charts/gitlab/charts/gitlab-grafana/values.yaml b/charts/gitlab/charts/gitlab-grafana/values.yaml index 2fd38007f2..81a92724e2 100644 --- a/charts/gitlab/charts/gitlab-grafana/values.yaml +++ b/charts/gitlab/charts/gitlab-grafana/values.yaml @@ -9,4 +9,8 @@ global: {} ingress: tls: {} annotations: {} + proxyBodySize: "0" + # Setting longer read timeout in case there is a lot of data coming back + proxyReadTimeout: 180 + proxyConnectTimeout: 15 -- GitLab