diff --git a/README.md b/README.md index 37a92bb..c20a5ee 100644 --- a/README.md +++ b/README.md @@ -187,10 +187,13 @@ replaced: ### Grafana -| Name | Description | Value | -| ------------------------------------ | --------------------------------------------------------- | ------- | -| `grafana.enabled` | Enable integration into Grafana. | `false` | -| `grafana.dashboards.businessMetrics` | Enable deployment of Grafana dashboard `businessMetrics`. | `true` | +| Name | Description | Value | +| ------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | ----------- | +| `grafana.enabled` | Enable integration into Grafana. Require the Prometheus operator deployment. | `false` | +| `grafana.dashboardDiscoveryLabels` | Labels that Grafana uses to discover resources. The labels may vary depending on the Grafana deployment. | `undefined` | +| `grafana.dashboards.postgresExporter.enabled` | Enable deployment of Grafana dashboard `postgresExporter`. | `true` | +| `grafana.dashboards.postgresExporter.annotations` | Additional configmap annotations. | `{}` | +| `grafana.dashboards.postgresExporter.labels` | Additional configmap labels. | `{}` | ### Ingress diff --git a/templates/prometheus-postgres-exporter/_configMap.tpl b/templates/prometheus-postgres-exporter/_configMap.tpl new file mode 100644 index 0000000..46bb373 --- /dev/null +++ b/templates/prometheus-postgres-exporter/_configMap.tpl @@ -0,0 +1,20 @@ +{{/* vim: set filetype=mustache: */}} + +{{/* annotations */}} + +{{- define "prometheus-postgres-exporter.configMap.grafanaDashboards.postgresExporter.annotations" -}} +{{ include "prometheus-postgres-exporter.annotations" . }} +{{- if .Values.grafana.dashboards.postgresExporter.annotations }} +{{ toYaml .Values.grafana.dashboards.postgresExporter.annotations }} +{{- end }} +{{- end }} + +{{/* labels */}} + +{{- define "prometheus-postgres-exporter.configMap.grafanaDashboards.postgresExporter.labels" -}} +{{ include "prometheus-postgres-exporter.labels" . }} +{{- if .Values.grafana.dashboards.postgresExporter.labels }} +{{ toYaml .Values.grafana.dashboards.postgresExporter.labels }} +{{- end }} +{{ toYaml .Values.grafana.dashboardDiscoveryLabels }} +{{- end }} \ No newline at end of file diff --git a/templates/prometheus-postgres-exporter/configMapGrafanaDashboardPostgresExporter.yaml b/templates/prometheus-postgres-exporter/configMapGrafanaDashboardPostgresExporter.yaml new file mode 100644 index 0000000..c7c77f2 --- /dev/null +++ b/templates/prometheus-postgres-exporter/configMapGrafanaDashboardPostgresExporter.yaml @@ -0,0 +1,3185 @@ +{{- if and .Values.grafana.enabled .Values.grafana.dashboards.postgresExporter }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + {{- with (include "prometheus-postgres-exporter.configMap.grafanaDashboards.postgresExporter.annotations" . | fromYaml) }} + annotations: + {{- tpl (. | toYaml) $ | nindent 4 }} + {{- end }} + {{- with (include "prometheus-postgres-exporter.configMap.grafanaDashboards.postgresExporter.labels" . | fromYaml) }} + labels: + {{- toYaml . | nindent 4 }} + {{- end }} + name: {{ include "prometheus-postgres-exporter.fullname" . }}-grafana-dashboard-postgres-exporter + namespace: {{ .Release.Namespace }} +data: + postgresExporter.yaml: |- + {{`{ + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "DS_PROMETHEUS", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "6.3.5" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "singlestat", + "name": "Singlestat", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "This dashboard works with postgres_exporter for prometheus", + "editable": true, + "gnetId": 9628, + "graphTooltip": 0, + "id": null, + "iteration": 1568751813814, + "links": [], + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 34, + "panels": [], + "title": "General Counters, CPU, Memory and File Descriptor Stats", + "type": "row" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#299c46", + "#7eb26d", + "#d44a3a" + ], + "datasource": "${DS_PROMETHEUS}", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 0, + "y": 1 + }, + "id": 36, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "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": "pg_static{release=\"$release\", instance=\"$instance\"}", + "format": "time_series", + "instant": true, + "intervalFactor": 1, + "legendFormat": "{{short_version}}", + "refId": "A" + } + ], + "thresholds": "", + "title": "Version", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "name" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "${DS_PROMETHEUS}", + "description": "start time of the process", + "format": "dateTimeFromNow", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 4, + "y": 1 + }, + "id": 28, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "postfix": "", + "postfixFontSize": "110%", + "prefix": "", + "prefixFontSize": "110%", + "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": "pg_postmaster_start_time_seconds{release=\"$release\", instance=\"$instance\"} * 1000", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "", + "title": "Start Time", + "type": "singlestat", + "valueFontSize": "70%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "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": "${DS_PROMETHEUS}", + "format": "decbytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 8, + "y": 1 + }, + "height": "200px", + "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, + "options": {}, + "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(pg_stat_database_tup_fetched{datname=~\"$datname\", instance=~\"$instance\"})", + "format": "time_series", + "intervalFactor": 2, + "refId": "A", + "step": 4 + } + ], + "thresholds": "", + "title": "Current fetch data", + "type": "singlestat", + "valueFontSize": "80%", + "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": "${DS_PROMETHEUS}", + "format": "decbytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 12, + "y": 1 + }, + "height": "200px", + "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, + "options": {}, + "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(pg_stat_database_tup_inserted{release=\"$release\", datname=~\"$datname\", instance=~\"$instance\"})", + "format": "time_series", + "intervalFactor": 2, + "refId": "A", + "step": 4 + } + ], + "thresholds": "", + "title": "Current insert data", + "type": "singlestat", + "valueFontSize": "80%", + "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": "${DS_PROMETHEUS}", + "format": "decbytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 16, + "y": 1 + }, + "height": "200px", + "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, + "options": {}, + "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(pg_stat_database_tup_updated{datname=~\"$datname\", instance=~\"$instance\"})", + "format": "time_series", + "intervalFactor": 2, + "refId": "A", + "step": 4 + } + ], + "thresholds": "", + "title": "Current update data", + "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": "${DS_PROMETHEUS}", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 20, + "y": 1 + }, + "id": 38, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "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": "pg_settings_max_connections{release=\"$release\", instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "Max Connections", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "description": "Average user and system CPU time spent in seconds.", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 3 + }, + "id": 22, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "avg(rate(process_cpu_seconds_total{release=\"$release\", instance=\"$instance\"}[5m]) * 1000)", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "CPU Time", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Average CPU Usage", + "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": 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": "${DS_PROMETHEUS}", + "description": "Virtual and Resident memory size in bytes, averages over 5 min interval", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 3 + }, + "id": 24, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "avg(rate(process_resident_memory_bytes{release=\"$release\", instance=\"$instance\"}[5m]))", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "Resident Mem", + "refId": "A" + }, + { + "expr": "avg(rate(process_virtual_memory_bytes{release=\"$release\", instance=\"$instance\"}[5m]))", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "Virtual Mem", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Average Memory Usage", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": null, + "format": "decbytes", + "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": "${DS_PROMETHEUS}", + "description": "Number of open file descriptors", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 3 + }, + "id": 26, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "process_open_fds{release=\"$release\", instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "Open FD", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Open File Descriptors", + "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": null, + "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": 10 + }, + "id": 32, + "panels": [], + "title": "Settings", + "type": "row" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "${DS_PROMETHEUS}", + "format": "bytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 0, + "y": 11 + }, + "id": 40, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "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": "pg_settings_shared_buffers_bytes{instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "Shared Buffers", + "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": "${DS_PROMETHEUS}", + "format": "bytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 3, + "y": 11 + }, + "id": 42, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "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": "pg_settings_effective_cache_size_bytes{instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "Effective Cache", + "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": "${DS_PROMETHEUS}", + "format": "bytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 6, + "y": 11 + }, + "id": 44, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "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": "pg_settings_maintenance_work_mem_bytes{instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "Maintenance Work Mem", + "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": "${DS_PROMETHEUS}", + "format": "bytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 9, + "y": 11 + }, + "id": 46, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "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": "pg_settings_work_mem_bytes{instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A" + } + ], + "thresholds": "", + "title": "Work Mem", + "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": "${DS_PROMETHEUS}", + "decimals": 1, + "format": "bytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 12, + "y": 11 + }, + "id": 48, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "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": "pg_settings_max_wal_size_bytes{instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "Max WAL Size", + "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": "${DS_PROMETHEUS}", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 15, + "y": 11 + }, + "id": 50, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "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": "pg_settings_random_page_cost{instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "Random Page Cost", + "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": "${DS_PROMETHEUS}", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 18, + "y": 11 + }, + "id": 52, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "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": "pg_settings_seq_page_cost", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "Seq Page Cost", + "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": "${DS_PROMETHEUS}", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 20, + "y": 11 + }, + "id": 54, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "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": "pg_settings_max_worker_processes{instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "Max Worker Processes", + "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": "${DS_PROMETHEUS}", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 22, + "y": 11 + }, + "id": 56, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "options": {}, + "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": "pg_settings_max_parallel_workers{instance=\"$instance\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": "", + "title": "Max Parallel Workers", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 14 + }, + "id": 30, + "panels": [], + "title": "Database Stats", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 15 + }, + "id": 1, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 3, + "points": true, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "pg_stat_activity_count{datname=~\"$datname\", instance=~\"$instance\", state=\"active\"} !=0", + "format": "time_series", + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{datname}}, s: {{state}}", + "refId": "A", + "step": 2 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Active sessions", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "none", + "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": "${DS_PROMETHEUS}", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 15 + }, + "id": 60, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(pg_stat_database_xact_commit{instance=\"$instance\", datname=~\"$datname\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{datname}} commits", + "refId": "A" + }, + { + "expr": "irate(pg_stat_database_xact_rollback{instance=\"$instance\", datname=~\"$datname\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{datname}} rollbacks", + "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": 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": "${DS_PROMETHEUS}", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 15 + }, + "id": 8, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sideWidth": null, + "sort": "current", + "sortDesc": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "pg_stat_database_tup_updated{datname=~\"$datname\", instance=~\"$instance\"} != 0", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{datname}}", + "refId": "A", + "step": 2 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Update data", + "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": 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": "${DS_PROMETHEUS}", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 22 + }, + "id": 5, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "pg_stat_database_tup_fetched{datname=~\"$datname\", instance=~\"$instance\"} != 0", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{datname}}", + "refId": "A", + "step": 2 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Fetch data (SELECT)", + "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": 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": "${DS_PROMETHEUS}", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 22 + }, + "id": 6, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "pg_stat_database_tup_inserted{datname=~\"$datname\", instance=~\"$instance\"} != 0", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{datname}}", + "refId": "A", + "step": 2 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Insert data", + "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": 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": "${DS_PROMETHEUS}", + "decimals": 0, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 22 + }, + "id": 3, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "hideEmpty": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "pg_locks_count{datname=~\"$datname\", instance=~\"$instance\", mode=~\"$mode\"} != 0", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{datname}},{{mode}}", + "refId": "A", + "step": 2 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Lock tables", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "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": "${DS_PROMETHEUS}", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 29 + }, + "id": 14, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "total", + "sortDesc": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "pg_stat_database_tup_returned{datname=~\"$datname\", instance=~\"$instance\"} != 0", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{datname}}", + "refId": "A", + "step": 2 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Return data", + "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": 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": "${DS_PROMETHEUS}", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 29 + }, + "id": 4, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": true, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": false, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "pg_stat_activity_count{datname=~\"$datname\", instance=~\"$instance\", state=~\"idle|idle in transaction|idle in transaction (aborted)\"}", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{datname}}, s: {{state}}", + "refId": "A", + "step": 2 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Idle sessions", + "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": "${DS_PROMETHEUS}", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 29 + }, + "id": 7, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "sort": "current", + "sortDesc": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "pg_stat_database_tup_deleted{datname=~\"$datname\", instance=~\"$instance\"} != 0", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "{{datname}}", + "refId": "A", + "step": 2 + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Delete data", + "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": 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": "${DS_PROMETHEUS}", + "decimals": 2, + "fill": 1, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 36 + }, + "id": 62, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": {}, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "pg_stat_database_blks_hit{instance=\"$instance\", datname=~\"$datname\"} / (pg_stat_database_blks_read{instance=\"$instance\", datname=~\"$datname\"} + pg_stat_database_blks_hit{instance=\"$instance\", datname=~\"$datname\"})", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{ datname }}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Cache Hit Rate", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 4, + "format": "percentunit", + "label": "", + "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": "${DS_PROMETHEUS}", + "fill": 1, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 36 + }, + "id": 64, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": {}, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(pg_stat_bgwriter_buffers_backend{instance=\"$instance\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "buffers_backend", + "refId": "A" + }, + { + "expr": "irate(pg_stat_bgwriter_buffers_alloc{instance=\"$instance\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "buffers_alloc", + "refId": "B" + }, + { + "expr": "irate(pg_stat_bgwriter_buffers_backend_fsync{instance=\"$instance\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "backend_fsync", + "refId": "C" + }, + { + "expr": "irate(pg_stat_bgwriter_buffers_checkpoint{instance=\"$instance\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "buffers_checkpoint", + "refId": "D" + }, + { + "expr": "irate(pg_stat_bgwriter_buffers_clean{instance=\"$instance\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "buffers_clean", + "refId": "E" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Buffers (bgwriter)", + "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": "${DS_PROMETHEUS}", + "decimals": 0, + "fill": 1, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 36 + }, + "id": 66, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": {}, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(pg_stat_database_conflicts{instance=\"$instance\", datname=~\"$datname\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{datname}} conflicts", + "refId": "B" + }, + { + "expr": "irate(pg_stat_database_deadlocks{instance=\"$instance\", datname=~\"$datname\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{datname}} deadlocks", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Conflicts/Deadlocks", + "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": "${DS_PROMETHEUS}", + "description": "Total amount of data written to temporary files by queries in this database. All temporary files are counted, regardless of why the temporary file was created, and regardless of the log_temp_files setting.", + "fill": 1, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 43 + }, + "id": 68, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": {}, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(pg_stat_database_temp_bytes{instance=\"$instance\", datname=~\"$datname\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{datname}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Temp File (Bytes)", + "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": "${DS_PROMETHEUS}", + "fill": 1, + "gridPos": { + "h": 7, + "w": 16, + "x": 8, + "y": 43 + }, + "id": 70, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": {}, + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(pg_stat_bgwriter_checkpoint_write_time{instance=\"$instance\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "write_time - Total amount of time that has been spent in the portion of checkpoint processing where files are written to disk.", + "refId": "B" + }, + { + "expr": "irate(pg_stat_bgwriter_checkpoint_sync_time{instance=\"$instance\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "sync_time - Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk.", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Checkpoint Stats", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "ms", + "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": "10s", + "schemaVersion": 19, + "style": "dark", + "tags": [ + "postgres", + "db", + "stats" + ], + "templating": { + "list": [ + { + "hide": 0, + "label": "datasource", + "name": "DS_PROMETHEUS", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "type": "datasource" + }, + { + "auto": true, + "auto_count": 200, + "auto_min": "1s", + "current": { + "text": "auto", + "value": "$__auto_interval_interval" + }, + "hide": 0, + "label": "Interval", + "name": "interval", + "options": [ + { + "selected": true, + "text": "auto", + "value": "$__auto_interval_interval" + }, + { + "selected": false, + "text": "1s", + "value": "1s" + }, + { + "selected": false, + "text": "5s", + "value": "5s" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "5m", + "value": "5m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "6h", + "value": "6h" + }, + { + "selected": false, + "text": "1d", + "value": "1d" + } + ], + "query": "1s,5s,1m,5m,1h,6h,1d", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "definition": "", + "hide": 0, + "includeAll": false, + "label": "Namespace", + "multi": false, + "name": "namespace", + "options": [], + "query": "query_result(pg_exporter_last_scrape_duration_seconds)", + "refresh": 2, + "regex": "/.*kubernetes_namespace=\"([^\"]+).*/", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "definition": "", + "hide": 0, + "includeAll": false, + "label": "Release", + "multi": false, + "name": "release", + "options": [], + "query": "query_result(pg_exporter_last_scrape_duration_seconds{kubernetes_namespace=\"$namespace\"})", + "refresh": 2, + "regex": "/.*release=\"([^\"]+)/", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "definition": "", + "hide": 0, + "includeAll": false, + "label": "Instance", + "multi": false, + "name": "instance", + "options": [], + "query": "query_result(pg_up{release=\"$release\"})", + "refresh": 1, + "regex": "/.*instance=\"([^\"]+).*/", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "definition": "", + "hide": 0, + "includeAll": true, + "label": "Database", + "multi": true, + "name": "datname", + "options": [], + "query": "label_values(datname)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "definition": "", + "hide": 0, + "includeAll": true, + "label": "Lock table", + "multi": true, + "name": "mode", + "options": [], + "query": "label_values({mode=~\"accessexclusivelock|accesssharelock|exclusivelock|rowexclusivelock|rowsharelock|sharelock|sharerowexclusivelock|shareupdateexclusivelock\"}, mode)", + "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": "PostgreSQL Database", + "uid": "000000039", + "version": 1 + }`}} +{{- end }} \ No newline at end of file diff --git a/unittests/configMaps/grafanaDashboardPostgresExporter.yaml b/unittests/configMaps/grafanaDashboardPostgresExporter.yaml new file mode 100644 index 0000000..63bcf2d --- /dev/null +++ b/unittests/configMaps/grafanaDashboardPostgresExporter.yaml @@ -0,0 +1,79 @@ +chart: + appVersion: 0.1.0 + version: 0.1.0 +suite: ConfigMap template (Grafana Dashboard PostgresExporter) +release: + name: prometheus-postgres-exporter-unittest + namespace: testing +templates: +- templates/prometheus-postgres-exporter/configMapGrafanaDashboardPostgresExporter.yaml +tests: +- it: Rendering postgresExporter + asserts: + - hasDocuments: + count: 0 + +- it: Rendering + set: + grafana.enabled: true + asserts: + - hasDocuments: + count: 1 + - containsDocument: + apiVersion: v1 + kind: ConfigMap + name: prometheus-postgres-exporter-unittest-grafana-dashboard-postgres-exporter + namespace: testing + - notExists: + path: metadata.annotations + - equal: + path: metadata.labels + value: + app.kubernetes.io/instance: prometheus-postgres-exporter-unittest + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: prometheus-postgres-exporter + app.kubernetes.io/version: 0.1.0 + grafana_dashboard: "1" + helm.sh/chart: prometheus-postgres-exporter-0.1.0 + - exists: + path: data["postgresExporter.yaml"] + +- it: Test custom annotations and labels + set: + grafana.enabled: true + grafana.dashboards.postgresExporter.annotations: + foo: bar + grafana.dashboards.postgresExporter.labels: + bar: foo + asserts: + - equal: + path: metadata.annotations + value: + foo: bar + - equal: + path: metadata.labels + value: + app.kubernetes.io/instance: prometheus-postgres-exporter-unittest + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: prometheus-postgres-exporter + app.kubernetes.io/version: 0.1.0 + grafana_dashboard: "1" + helm.sh/chart: prometheus-postgres-exporter-0.1.0 + bar: foo + +- it: Test custom grafana discovery labels + set: + grafana.enabled: true + grafana.dashboardDiscoveryLabels: + grafana_dashboard: null + my-custom-discovery-label: my-value + asserts: + - equal: + path: metadata.labels + value: + app.kubernetes.io/instance: prometheus-postgres-exporter-unittest + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: prometheus-postgres-exporter + app.kubernetes.io/version: 0.1.0 + my-custom-discovery-label: my-value + helm.sh/chart: prometheus-postgres-exporter-0.1.0 diff --git a/values.schema.json b/values.schema.json index 65e8815..5ca9c16 100644 --- a/values.schema.json +++ b/values.schema.json @@ -1,1790 +1,700 @@ { - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "http://example.com/example.json", - "type": "object", - "default": {}, - "title": "Root Schema", - "required": [ - "nameOverride", - "fullnameOverride", - "config", - "deployment", - "grafana", - "ingress", - "podDisruptionBudget", - "networkPolicies", - "prometheus", - "services", - "serviceAccount" - ], - "properties": { - "nameOverride": { - "type": "string", - "default": "", - "title": "The nameOverride Schema", - "examples": [ - "" - ] - }, - "fullnameOverride": { - "type": "string", - "default": "", - "title": "The fullnameOverride Schema", - "examples": [ - "" - ] - }, - "config": { - "type": "object", - "default": {}, - "title": "The config Schema", - "required": [ - "database", - "exporterConfig", - "webConfig" - ], - "properties": { - "database": { - "type": "object", - "default": {}, - "title": "The database Schema", - "required": [ - "existingSecret", - "secret" - ], - "properties": { - "existingSecret": { - "type": "object", - "default": {}, - "title": "The existingSecret Schema", - "required": [ - "enabled", - "secretName" - ], - "properties": { - "enabled": { - "type": "boolean", - "default": false, - "title": "The enabled Schema", - "examples": [ - false - ] - }, - "secretName": { - "type": "string", - "default": "", - "title": "The secretName Schema", - "examples": [ - "" - ] - } - }, - "examples": [{ - "enabled": false, - "secretName": "" - }] - }, - "secret": { - "type": "object", - "default": {}, - "title": "The secret Schema", - "required": [ - "annotations", - "labels", - "databaseUsername", - "databasePassword", - "databaseConnectionUrl" - ], - "properties": { - "annotations": { - "type": "object", - "default": {}, - "title": "The annotations Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "labels": { - "type": "object", - "default": {}, - "title": "The labels Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "databaseUsername": { - "type": "string", - "default": "", - "title": "The databaseUsername Schema", - "examples": [ - "" - ] - }, - "databasePassword": { - "type": "string", - "default": "", - "title": "The databasePassword Schema", - "examples": [ - "" - ] - }, - "databaseConnectionUrl": { - "type": "string", - "default": "", - "title": "The databaseConnectionUrl Schema", - "examples": [ - "" - ] - } - }, - "examples": [{ - "annotations": {}, - "labels": {}, - "databaseUsername": "", - "databasePassword": "", - "databaseConnectionUrl": "" - }] - } - }, - "examples": [{ - "existingSecret": { - "enabled": false, - "secretName": "" - }, - "secret": { - "annotations": {}, - "labels": {}, - "databaseUsername": "", - "databasePassword": "", - "databaseConnectionUrl": "" - } - }] - }, - "exporterConfig": { - "type": "object", - "default": {}, - "title": "The exporterConfig Schema", - "required": [ - "existingSecret", - "secret" - ], - "properties": { - "existingSecret": { - "type": "object", - "default": {}, - "title": "The existingSecret Schema", - "required": [ - "enabled", - "secretName" - ], - "properties": { - "enabled": { - "type": "boolean", - "default": false, - "title": "The enabled Schema", - "examples": [ - false - ] - }, - "secretName": { - "type": "string", - "default": "", - "title": "The secretName Schema", - "examples": [ - "" - ] - } - }, - "examples": [{ - "enabled": false, - "secretName": "" - }] - }, - "secret": { - "type": "object", - "default": {}, - "title": "The secret Schema", - "required": [ - "annotations", - "labels", - "exporterConfig" - ], - "properties": { - "annotations": { - "type": "object", - "default": {}, - "title": "The annotations Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "labels": { - "type": "object", - "default": {}, - "title": "The labels Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "exporterConfig": { - "type": "object", - "default": {}, - "title": "The exporterConfig Schema", - "required": [], - "properties": {}, - "examples": [{}] - } - }, - "examples": [{ - "annotations": {}, - "labels": {}, - "exporterConfig": {} - }] - } - }, - "examples": [{ - "existingSecret": { - "enabled": false, - "secretName": "" - }, - "secret": { - "annotations": {}, - "labels": {}, - "exporterConfig": {} - } - }] - }, - "webConfig": { - "type": "object", - "default": {}, - "title": "The webConfig Schema", - "required": [ - "existingSecret", - "secret" - ], - "properties": { - "existingSecret": { - "type": "object", - "default": {}, - "title": "The existingSecret Schema", - "required": [ - "enabled", - "secretName" - ], - "properties": { - "enabled": { - "type": "boolean", - "default": false, - "title": "The enabled Schema", - "examples": [ - false - ] - }, - "secretName": { - "type": "string", - "default": "", - "title": "The secretName Schema", - "examples": [ - "" - ] - } - }, - "examples": [{ - "enabled": false, - "secretName": "" - }] - }, - "secret": { - "type": "object", - "default": {}, - "title": "The secret Schema", - "required": [ - "annotations", - "labels", - "webConfig" - ], - "properties": { - "annotations": { - "type": "object", - "default": {}, - "title": "The annotations Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "labels": { - "type": "object", - "default": {}, - "title": "The labels Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "webConfig": { - "type": "object", - "default": {}, - "title": "The webConfig Schema", - "required": [], - "properties": {}, - "examples": [{}] - } - }, - "examples": [{ - "annotations": {}, - "labels": {}, - "webConfig": {} - }] - } - }, - "examples": [{ - "existingSecret": { - "enabled": false, - "secretName": "" - }, - "secret": { - "annotations": {}, - "labels": {}, - "webConfig": {} - } - }] - } - }, - "examples": [{ - "database": { - "existingSecret": { - "enabled": false, - "secretName": "" - }, - "secret": { - "annotations": {}, - "labels": {}, - "databaseUsername": "", - "databasePassword": "", - "databaseConnectionUrl": "" - } - }, - "exporterConfig": { - "existingSecret": { - "enabled": false, - "secretName": "" - }, - "secret": { - "annotations": {}, - "labels": {}, - "exporterConfig": {} - } - }, - "webConfig": { - "existingSecret": { - "enabled": false, - "secretName": "" - }, - "secret": { - "annotations": {}, - "labels": {}, - "webConfig": {} - } - } - }] - }, - "deployment": { - "type": "object", - "default": {}, - "title": "The deployment Schema", - "required": [ - "annotations", - "labels", - "additionalContainers", - "affinity", - "initContainers", - "dnsConfig", - "dnsPolicy", - "hostname", - "subdomain", - "hostNetwork", - "imagePullSecrets", - "postgresExporter", - "nodeSelector", - "priorityClassName", - "replicaCount", - "restartPolicy", - "securityContext", - "strategy", - "terminationGracePeriodSeconds", - "tolerations", - "topologySpreadConstraints", - "volumes" - ], - "properties": { - "annotations": { - "type": "object", - "default": {}, - "title": "The annotations Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "labels": { - "type": "object", - "default": {}, - "title": "The labels Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "additionalContainers": { - "type": "array", - "default": [], - "title": "The additionalContainers Schema", - "items": {}, - "examples": [ - [] - ] - }, - "affinity": { - "type": "object", - "default": {}, - "title": "The affinity Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "initContainers": { - "type": "array", - "default": [], - "title": "The initContainers Schema", - "items": {}, - "examples": [ - [] - ] - }, - "dnsConfig": { - "type": "object", - "default": {}, - "title": "The dnsConfig Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "dnsPolicy": { - "type": "string", - "default": "", - "title": "The dnsPolicy Schema", - "examples": [ - "" - ] - }, - "hostname": { - "type": "string", - "default": "", - "title": "The hostname Schema", - "examples": [ - "" - ] - }, - "subdomain": { - "type": "string", - "default": "", - "title": "The subdomain Schema", - "examples": [ - "" - ] - }, - "hostNetwork": { - "type": "boolean", - "default": false, - "title": "The hostNetwork Schema", - "examples": [ - false - ] - }, - "imagePullSecrets": { - "type": "array", - "default": [], - "title": "The imagePullSecrets Schema", - "items": {}, - "examples": [ - [] - ] - }, - "postgresExporter": { - "type": "object", - "default": {}, - "title": "The postgresExporter Schema", - "required": [ - "args", - "env", - "envFrom", - "image", - "resources", - "securityContext", - "volumeMounts" - ], - "properties": { - "args": { - "type": "array", - "default": [], - "title": "The args Schema", - "items": {}, - "examples": [ - [] - ] - }, - "env": { - "type": "array", - "default": [], - "title": "The env Schema", - "items": {}, - "examples": [ - [] - ] - }, - "envFrom": { - "type": "array", - "default": [], - "title": "The envFrom Schema", - "items": {}, - "examples": [ - [] - ] - }, - "image": { - "type": "object", - "default": {}, - "title": "The image Schema", - "required": [ - "registry", - "repository", - "tag", - "pullPolicy" - ], - "properties": { - "registry": { - "type": "string", - "default": "", - "title": "The registry Schema", - "examples": [ - "quay.io" - ] - }, - "repository": { - "type": "string", - "default": "", - "title": "The repository Schema", - "examples": [ - "prometheuscommunity/postgres-exporter" - ] - }, - "tag": { - "type": "string", - "default": "", - "title": "The tag Schema", - "examples": [ - "" - ] - }, - "pullPolicy": { - "type": "string", - "default": "", - "title": "The pullPolicy Schema", - "examples": [ - "IfNotPresent" - ] - } - }, - "examples": [{ - "registry": "quay.io", - "repository": "prometheuscommunity/postgres-exporter", - "tag": "", - "pullPolicy": "IfNotPresent" - }] - }, - "resources": { - "type": "object", - "default": {}, - "title": "The resources Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "securityContext": { - "type": "object", - "default": {}, - "title": "The securityContext Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "volumeMounts": { - "type": "array", - "default": [], - "title": "The volumeMounts Schema", - "items": {}, - "examples": [ - [] - ] - } - }, - "examples": [{ - "args": [], - "env": [], - "envFrom": [], - "image": { - "registry": "quay.io", - "repository": "prometheuscommunity/postgres-exporter", - "tag": "", - "pullPolicy": "IfNotPresent" - }, - "resources": {}, - "securityContext": {}, - "volumeMounts": [] - }] - }, - "nodeSelector": { - "type": "object", - "default": {}, - "title": "The nodeSelector Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "priorityClassName": { - "type": "string", - "default": "", - "title": "The priorityClassName Schema", - "examples": [ - "" - ] - }, - "replicaCount": { - "type": "integer", - "default": 0, - "title": "The replicaCount Schema", - "examples": [ - 1 - ] - }, - "restartPolicy": { - "type": "string", - "default": "", - "title": "The restartPolicy Schema", - "examples": [ - "" - ] - }, - "securityContext": { - "type": "object", - "default": {}, - "title": "The securityContext Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "strategy": { - "type": "object", - "default": {}, - "title": "The strategy Schema", - "required": [ - "type", - "rollingUpdate" - ], - "properties": { - "type": { - "type": "string", - "default": "", - "title": "The type Schema", - "examples": [ - "Recreate" - ] - }, - "rollingUpdate": { - "type": "object", - "default": {}, - "title": "The rollingUpdate Schema", - "required": [ - "maxSurge", - "maxUnavailable" - ], - "properties": { - "maxSurge": { - "type": "integer", - "default": 0, - "title": "The maxSurge Schema", - "examples": [ - 1 - ] - }, - "maxUnavailable": { - "type": "integer", - "default": 0, - "title": "The maxUnavailable Schema", - "examples": [ - 1 - ] - } - }, - "examples": [{ - "maxSurge": 1, - "maxUnavailable": 1 - }] - } - }, - "examples": [{ - "type": "Recreate", - "rollingUpdate": { - "maxSurge": 1, - "maxUnavailable": 1 - } - }] - }, - "terminationGracePeriodSeconds": { - "type": "integer", - "default": 0, - "title": "The terminationGracePeriodSeconds Schema", - "examples": [ - 60 - ] - }, - "tolerations": { - "type": "array", - "default": [], - "title": "The tolerations Schema", - "items": {}, - "examples": [ - [] - ] - }, - "topologySpreadConstraints": { - "type": "array", - "default": [], - "title": "The topologySpreadConstraints Schema", - "items": {}, - "examples": [ - [] - ] - }, - "volumes": { - "type": "array", - "default": [], - "title": "The volumes Schema", - "items": {}, - "examples": [ - [] - ] - } - }, - "examples": [{ - "annotations": {}, - "labels": {}, - "additionalContainers": [], - "affinity": {}, - "initContainers": [], - "dnsConfig": {}, - "dnsPolicy": "", - "hostname": "", - "subdomain": "", - "hostNetwork": false, - "imagePullSecrets": [], - "postgresExporter": { - "args": [], - "env": [], - "envFrom": [], - "image": { - "registry": "quay.io", - "repository": "prometheuscommunity/postgres-exporter", - "tag": "", - "pullPolicy": "IfNotPresent" - }, - "resources": {}, - "securityContext": {}, - "volumeMounts": [] - }, - "nodeSelector": {}, - "priorityClassName": "", - "replicaCount": 1, - "restartPolicy": "", - "securityContext": {}, - "strategy": { - "type": "Recreate", - "rollingUpdate": { - "maxSurge": 1, - "maxUnavailable": 1 - } - }, - "terminationGracePeriodSeconds": 60, - "tolerations": [], - "topologySpreadConstraints": [], - "volumes": [] - }] - }, - "grafana": { - "type": "object", - "default": {}, - "title": "The grafana Schema", - "required": [ - "enabled", - "dashboards" - ], - "properties": { - "enabled": { - "type": "boolean", - "default": false, - "title": "The enabled Schema", - "examples": [ - false - ] - }, - "dashboards": { - "type": "object", - "default": {}, - "title": "The dashboards Schema", - "required": [ - "businessMetrics" - ], - "properties": { - "businessMetrics": { - "type": "boolean", - "default": false, - "title": "The businessMetrics Schema", - "examples": [ - true - ] - } - }, - "examples": [{ - "businessMetrics": true - }] - } - }, - "examples": [{ - "enabled": false, - "dashboards": { - "businessMetrics": true - } - }] - }, - "ingress": { - "type": "object", - "default": {}, - "title": "The ingress Schema", - "required": [ - "enabled", - "className", - "annotations", - "labels", - "hosts", - "tls" - ], - "properties": { - "enabled": { - "type": "boolean", - "default": false, - "title": "The enabled Schema", - "examples": [ - false - ] - }, - "className": { - "type": "string", - "default": "", - "title": "The className Schema", - "examples": [ - "nginx" - ] - }, - "annotations": { - "type": "object", - "default": {}, - "title": "The annotations Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "labels": { - "type": "object", - "default": {}, - "title": "The labels Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "hosts": { - "type": "array", - "default": [], - "title": "The hosts Schema", - "items": {}, - "examples": [ - [] - ] - }, - "tls": { - "type": "array", - "default": [], - "title": "The tls Schema", - "items": {}, - "examples": [ - [] - ] - } - }, - "examples": [{ - "enabled": false, - "className": "nginx", - "annotations": {}, - "labels": {}, - "hosts": [], - "tls": [] - }] - }, - "podDisruptionBudget": { - "type": "object", - "default": {}, - "title": "The podDisruptionBudget Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "networkPolicies": { - "type": "object", - "default": {}, - "title": "The networkPolicies Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "prometheus": { - "type": "object", - "default": {}, - "title": "The prometheus Schema", - "required": [ - "metrics", - "rules" - ], - "properties": { - "metrics": { - "type": "object", - "default": {}, - "title": "The metrics Schema", - "required": [ - "enabled", - "podMonitor", - "serviceMonitor" - ], - "properties": { - "enabled": { - "type": "boolean", - "default": false, - "title": "The enabled Schema", - "examples": [ - true - ] - }, - "podMonitor": { - "type": "object", - "default": {}, - "title": "The podMonitor Schema", - "required": [ - "enabled", - "annotations", - "enableHttp2", - "followRedirects", - "honorLabels", - "labels", - "interval", - "path", - "relabelings", - "scrapeTimeout", - "scheme", - "tlsConfig" - ], - "properties": { - "enabled": { - "type": "boolean", - "default": false, - "title": "The enabled Schema", - "examples": [ - false - ] - }, - "annotations": { - "type": "object", - "default": {}, - "title": "The annotations Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "enableHttp2": { - "type": "boolean", - "default": false, - "title": "The enableHttp2 Schema", - "examples": [ - true - ] - }, - "followRedirects": { - "type": "boolean", - "default": false, - "title": "The followRedirects Schema", - "examples": [ - false - ] - }, - "honorLabels": { - "type": "boolean", - "default": false, - "title": "The honorLabels Schema", - "examples": [ - false - ] - }, - "labels": { - "type": "object", - "default": {}, - "title": "The labels Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "interval": { - "type": "string", - "default": "", - "title": "The interval Schema", - "examples": [ - "60s" - ] - }, - "path": { - "type": "string", - "default": "", - "title": "The path Schema", - "examples": [ - "/metrics" - ] - }, - "relabelings": { - "type": "array", - "default": [], - "title": "The relabelings Schema", - "items": {}, - "examples": [ - [] - ] - }, - "scrapeTimeout": { - "type": "string", - "default": "", - "title": "The scrapeTimeout Schema", - "examples": [ - "30s" - ] - }, - "scheme": { - "type": "string", - "default": "", - "title": "The scheme Schema", - "examples": [ - "http" - ] - }, - "tlsConfig": { - "type": "object", - "default": {}, - "title": "The tlsConfig Schema", - "required": [], - "properties": {}, - "examples": [{}] - } - }, - "examples": [{ - "enabled": false, - "annotations": {}, - "enableHttp2": true, - "followRedirects": false, - "honorLabels": false, - "labels": {}, - "interval": "60s", - "path": "/metrics", - "relabelings": [], - "scrapeTimeout": "30s", - "scheme": "http", - "tlsConfig": {} - }] - }, - "serviceMonitor": { - "type": "object", - "default": {}, - "title": "The serviceMonitor Schema", - "required": [ - "enabled", - "annotations", - "labels", - "enableHttp2", - "followRedirects", - "honorLabels", - "interval", - "path", - "relabelings", - "scrapeTimeout", - "scheme", - "tlsConfig" - ], - "properties": { - "enabled": { - "type": "boolean", - "default": false, - "title": "The enabled Schema", - "examples": [ - false - ] - }, - "annotations": { - "type": "object", - "default": {}, - "title": "The annotations Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "labels": { - "type": "object", - "default": {}, - "title": "The labels Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "enableHttp2": { - "type": "boolean", - "default": false, - "title": "The enableHttp2 Schema", - "examples": [ - true - ] - }, - "followRedirects": { - "type": "boolean", - "default": false, - "title": "The followRedirects Schema", - "examples": [ - false - ] - }, - "honorLabels": { - "type": "boolean", - "default": false, - "title": "The honorLabels Schema", - "examples": [ - false - ] - }, - "interval": { - "type": "string", - "default": "", - "title": "The interval Schema", - "examples": [ - "60s" - ] - }, - "path": { - "type": "string", - "default": "", - "title": "The path Schema", - "examples": [ - "/metrics" - ] - }, - "relabelings": { - "type": "array", - "default": [], - "title": "The relabelings Schema", - "items": {}, - "examples": [ - [] - ] - }, - "scrapeTimeout": { - "type": "string", - "default": "", - "title": "The scrapeTimeout Schema", - "examples": [ - "30s" - ] - }, - "scheme": { - "type": "string", - "default": "", - "title": "The scheme Schema", - "examples": [ - "http" - ] - }, - "tlsConfig": { - "type": "object", - "default": {}, - "title": "The tlsConfig Schema", - "required": [], - "properties": {}, - "examples": [{}] - } - }, - "examples": [{ - "enabled": false, - "annotations": {}, - "labels": {}, - "enableHttp2": true, - "followRedirects": false, - "honorLabels": false, - "interval": "60s", - "path": "/metrics", - "relabelings": [], - "scrapeTimeout": "30s", - "scheme": "http", - "tlsConfig": {} - }] - } - }, - "examples": [{ - "enabled": true, - "podMonitor": { - "enabled": false, - "annotations": {}, - "enableHttp2": true, - "followRedirects": false, - "honorLabels": false, - "labels": {}, - "interval": "60s", - "path": "/metrics", - "relabelings": [], - "scrapeTimeout": "30s", - "scheme": "http", - "tlsConfig": {} - }, - "serviceMonitor": { - "enabled": false, - "annotations": {}, - "labels": {}, - "enableHttp2": true, - "followRedirects": false, - "honorLabels": false, - "interval": "60s", - "path": "/metrics", - "relabelings": [], - "scrapeTimeout": "30s", - "scheme": "http", - "tlsConfig": {} - } - }] - }, - "rules": { - "type": "array", - "default": [], - "title": "The rules Schema", - "items": {}, - "examples": [ - [] - ] - } - }, - "examples": [{ - "metrics": { - "enabled": true, - "podMonitor": { - "enabled": false, - "annotations": {}, - "enableHttp2": true, - "followRedirects": false, - "honorLabels": false, - "labels": {}, - "interval": "60s", - "path": "/metrics", - "relabelings": [], - "scrapeTimeout": "30s", - "scheme": "http", - "tlsConfig": {} - }, - "serviceMonitor": { - "enabled": false, - "annotations": {}, - "labels": {}, - "enableHttp2": true, - "followRedirects": false, - "honorLabels": false, - "interval": "60s", - "path": "/metrics", - "relabelings": [], - "scrapeTimeout": "30s", - "scheme": "http", - "tlsConfig": {} - } - }, - "rules": [] - }] - }, - "services": { - "type": "object", - "default": {}, - "title": "The services Schema", - "required": [ - "http" - ], - "properties": { - "http": { - "type": "object", - "default": {}, - "title": "The http Schema", - "required": [ - "enabled", - "annotations", - "externalIPs", - "externalTrafficPolicy", - "internalTrafficPolicy", - "ipFamilies", - "labels", - "loadBalancerClass", - "loadBalancerIP", - "loadBalancerSourceRanges", - "port", - "sessionAffinity", - "sessionAffinityConfig", - "type" - ], - "properties": { - "enabled": { - "type": "boolean", - "default": false, - "title": "The enabled Schema", - "examples": [ - true - ] - }, - "annotations": { - "type": "object", - "default": {}, - "title": "The annotations Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "externalIPs": { - "type": "array", - "default": [], - "title": "The externalIPs Schema", - "items": {}, - "examples": [ - [] - ] - }, - "externalTrafficPolicy": { - "type": "string", - "default": "", - "title": "The externalTrafficPolicy Schema", - "examples": [ - "Cluster" - ] - }, - "internalTrafficPolicy": { - "type": "string", - "default": "", - "title": "The internalTrafficPolicy Schema", - "examples": [ - "Cluster" - ] - }, - "ipFamilies": { - "type": "array", - "default": [], - "title": "The ipFamilies Schema", - "items": {}, - "examples": [ - [] - ] - }, - "labels": { - "type": "object", - "default": {}, - "title": "The labels Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "loadBalancerClass": { - "type": "string", - "default": "", - "title": "The loadBalancerClass Schema", - "examples": [ - "" - ] - }, - "loadBalancerIP": { - "type": "string", - "default": "", - "title": "The loadBalancerIP Schema", - "examples": [ - "" - ] - }, - "loadBalancerSourceRanges": { - "type": "array", - "default": [], - "title": "The loadBalancerSourceRanges Schema", - "items": {}, - "examples": [ - [] - ] - }, - "port": { - "type": "integer", - "default": 0, - "title": "The port Schema", - "examples": [ - 9187 - ] - }, - "sessionAffinity": { - "type": "string", - "default": "", - "title": "The sessionAffinity Schema", - "examples": [ - "None" - ] - }, - "sessionAffinityConfig": { - "type": "object", - "default": {}, - "title": "The sessionAffinityConfig Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "type": { - "type": "string", - "default": "", - "title": "The type Schema", - "examples": [ - "ClusterIP" - ] - } - }, - "examples": [{ - "enabled": true, - "annotations": {}, - "externalIPs": [], - "externalTrafficPolicy": "Cluster", - "internalTrafficPolicy": "Cluster", - "ipFamilies": [], - "labels": {}, - "loadBalancerClass": "", - "loadBalancerIP": "", - "loadBalancerSourceRanges": [], - "port": 9187, - "sessionAffinity": "None", - "sessionAffinityConfig": {}, - "type": "ClusterIP" - }] - } - }, - "examples": [{ - "http": { - "enabled": true, - "annotations": {}, - "externalIPs": [], - "externalTrafficPolicy": "Cluster", - "internalTrafficPolicy": "Cluster", - "ipFamilies": [], - "labels": {}, - "loadBalancerClass": "", - "loadBalancerIP": "", - "loadBalancerSourceRanges": [], - "port": 9187, - "sessionAffinity": "None", - "sessionAffinityConfig": {}, - "type": "ClusterIP" - } - }] - }, - "serviceAccount": { - "type": "object", - "default": {}, - "title": "The serviceAccount Schema", - "required": [ - "existing", - "new" - ], - "properties": { - "existing": { - "type": "object", - "default": {}, - "title": "The existing Schema", - "required": [ - "enabled", - "serviceAccountName" - ], - "properties": { - "enabled": { - "type": "boolean", - "default": false, - "title": "The enabled Schema", - "examples": [ - false - ] - }, - "serviceAccountName": { - "type": "string", - "default": "", - "title": "The serviceAccountName Schema", - "examples": [ - "" - ] - } - }, - "examples": [{ - "enabled": false, - "serviceAccountName": "" - }] - }, - "new": { - "type": "object", - "default": {}, - "title": "The new Schema", - "required": [ - "annotations", - "labels", - "automountServiceAccountToken", - "imagePullSecrets", - "secrets" - ], - "properties": { - "annotations": { - "type": "object", - "default": {}, - "title": "The annotations Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "labels": { - "type": "object", - "default": {}, - "title": "The labels Schema", - "required": [], - "properties": {}, - "examples": [{}] - }, - "automountServiceAccountToken": { - "type": "boolean", - "default": false, - "title": "The automountServiceAccountToken Schema", - "examples": [ - true - ] - }, - "imagePullSecrets": { - "type": "array", - "default": [], - "title": "The imagePullSecrets Schema", - "items": {}, - "examples": [ - [] - ] - }, - "secrets": { - "type": "array", - "default": [], - "title": "The secrets Schema", - "items": {}, - "examples": [ - [] - ] - } - }, - "examples": [{ - "annotations": {}, - "labels": {}, - "automountServiceAccountToken": true, - "imagePullSecrets": [], - "secrets": [] - }] - } - }, - "examples": [{ - "existing": { - "enabled": false, - "serviceAccountName": "" - }, - "new": { - "annotations": {}, - "labels": {}, - "automountServiceAccountToken": true, - "imagePullSecrets": [], - "secrets": [] - } - }] - } + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "nameOverride": { + "type": "string" }, - "examples": [{ - "nameOverride": "", - "fullnameOverride": "", - "config": { - "database": { - "existingSecret": { - "enabled": false, - "secretName": "" + "fullnameOverride": { + "type": "string" + }, + "config": { + "type": "object", + "properties": { + "database": { + "type": "object", + "properties": { + "existingSecret": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" }, - "secret": { - "annotations": {}, - "labels": {}, - "databaseUsername": "", - "databasePassword": "", - "databaseConnectionUrl": "" + "secretName": { + "type": "string" } + }, + "required": [ + "enabled", + "secretName" + ] }, - "exporterConfig": { - "existingSecret": { - "enabled": false, - "secretName": "" + "secret": { + "type": "object", + "properties": { + "annotations": { + "type": "object" }, - "secret": { - "annotations": {}, - "labels": {}, - "exporterConfig": {} - } - }, - "webConfig": { - "existingSecret": { - "enabled": false, - "secretName": "" + "labels": { + "type": "object" }, - "secret": { - "annotations": {}, - "labels": {}, - "webConfig": {} + "databaseUsername": { + "type": "string" + }, + "databasePassword": { + "type": "string" + }, + "databaseConnectionUrl": { + "type": "string" } + }, + "required": [ + "annotations", + "labels", + "databaseUsername", + "databasePassword", + "databaseConnectionUrl" + ] } + }, + "required": [ + "existingSecret", + "secret" + ] }, - "deployment": { - "annotations": {}, - "labels": {}, - "additionalContainers": [], - "affinity": {}, - "initContainers": [], - "dnsConfig": {}, - "dnsPolicy": "", - "hostname": "", - "subdomain": "", - "hostNetwork": false, - "imagePullSecrets": [], - "postgresExporter": { - "args": [], - "env": [], - "envFrom": [], - "image": { - "registry": "quay.io", - "repository": "prometheuscommunity/postgres-exporter", - "tag": "", - "pullPolicy": "IfNotPresent" + "exporterConfig": { + "type": "object", + "properties": { + "existingSecret": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" }, - "resources": {}, - "securityContext": {}, - "volumeMounts": [] - }, - "nodeSelector": {}, - "priorityClassName": "", - "replicaCount": 1, - "restartPolicy": "", - "securityContext": {}, - "strategy": { - "type": "Recreate", - "rollingUpdate": { - "maxSurge": 1, - "maxUnavailable": 1 + "secretName": { + "type": "string" } + }, + "required": [ + "enabled", + "secretName" + ] }, - "terminationGracePeriodSeconds": 60, - "tolerations": [], - "topologySpreadConstraints": [], - "volumes": [] - }, - "grafana": { - "enabled": false, - "dashboards": { - "businessMetrics": true - } - }, - "ingress": { - "enabled": false, - "className": "nginx", - "annotations": {}, - "labels": {}, - "hosts": [], - "tls": [] - }, - "podDisruptionBudget": {}, - "networkPolicies": {}, - "prometheus": { - "metrics": { - "enabled": true, - "podMonitor": { - "enabled": false, - "annotations": {}, - "enableHttp2": true, - "followRedirects": false, - "honorLabels": false, - "labels": {}, - "interval": "60s", - "path": "/metrics", - "relabelings": [], - "scrapeTimeout": "30s", - "scheme": "http", - "tlsConfig": {} + "secret": { + "type": "object", + "properties": { + "annotations": { + "type": "object" }, - "serviceMonitor": { - "enabled": false, - "annotations": {}, - "labels": {}, - "enableHttp2": true, - "followRedirects": false, - "honorLabels": false, - "interval": "60s", - "path": "/metrics", - "relabelings": [], - "scrapeTimeout": "30s", - "scheme": "http", - "tlsConfig": {} + "labels": { + "type": "object" + }, + "exporterConfig": { + "type": "object" } - }, - "rules": [] - }, - "services": { - "http": { - "enabled": true, - "annotations": {}, - "externalIPs": [], - "externalTrafficPolicy": "Cluster", - "internalTrafficPolicy": "Cluster", - "ipFamilies": [], - "labels": {}, - "loadBalancerClass": "", - "loadBalancerIP": "", - "loadBalancerSourceRanges": [], - "port": 9187, - "sessionAffinity": "None", - "sessionAffinityConfig": {}, - "type": "ClusterIP" + }, + "required": [ + "annotations", + "labels", + "exporterConfig" + ] } + }, + "required": [ + "existingSecret", + "secret" + ] }, - "serviceAccount": { - "existing": { - "enabled": false, - "serviceAccountName": "" + "webConfig": { + "type": "object", + "properties": { + "existingSecret": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "secretName": { + "type": "string" + } + }, + "required": [ + "enabled", + "secretName" + ] }, - "new": { - "annotations": {}, - "labels": {}, - "automountServiceAccountToken": true, - "imagePullSecrets": [], - "secrets": [] + "secret": { + "type": "object", + "properties": { + "annotations": { + "type": "object" + }, + "labels": { + "type": "object" + }, + "webConfig": { + "type": "object" + } + }, + "required": [ + "annotations", + "labels", + "webConfig" + ] } + }, + "required": [ + "existingSecret", + "secret" + ] } - }] -} \ No newline at end of file + }, + "required": [ + "database", + "exporterConfig", + "webConfig" + ] + }, + "deployment": { + "type": "object", + "properties": { + "annotations": { + "type": "object" + }, + "labels": { + "type": "object" + }, + "additionalContainers": { + "type": "array", + "items": {} + }, + "affinity": { + "type": "object" + }, + "initContainers": { + "type": "array", + "items": {} + }, + "dnsConfig": { + "type": "object" + }, + "dnsPolicy": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "subdomain": { + "type": "string" + }, + "hostNetwork": { + "type": "boolean" + }, + "imagePullSecrets": { + "type": "array", + "items": {} + }, + "postgresExporter": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": {} + }, + "env": { + "type": "array", + "items": {} + }, + "envFrom": { + "type": "array", + "items": {} + }, + "image": { + "type": "object", + "properties": { + "registry": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "pullPolicy": { + "type": "string" + } + }, + "required": [ + "registry", + "repository", + "tag", + "pullPolicy" + ] + }, + "resources": { + "type": "object" + }, + "securityContext": { + "type": "object" + }, + "volumeMounts": { + "type": "array", + "items": {} + } + }, + "required": [ + "args", + "env", + "envFrom", + "image", + "resources", + "securityContext", + "volumeMounts" + ] + }, + "nodeSelector": { + "type": "object" + }, + "priorityClassName": { + "type": "string" + }, + "replicaCount": { + "type": "integer" + }, + "restartPolicy": { + "type": "string" + }, + "securityContext": { + "type": "object" + }, + "strategy": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "rollingUpdate": { + "type": "object", + "properties": { + "maxSurge": { + "type": "integer" + }, + "maxUnavailable": { + "type": "integer" + } + }, + "required": [ + "maxSurge", + "maxUnavailable" + ] + } + }, + "required": [ + "type", + "rollingUpdate" + ] + }, + "terminationGracePeriodSeconds": { + "type": "integer" + }, + "tolerations": { + "type": "array", + "items": {} + }, + "topologySpreadConstraints": { + "type": "array", + "items": {} + }, + "volumes": { + "type": "array", + "items": {} + } + }, + "required": [ + "annotations", + "labels", + "additionalContainers", + "affinity", + "initContainers", + "dnsConfig", + "dnsPolicy", + "hostname", + "subdomain", + "hostNetwork", + "imagePullSecrets", + "postgresExporter", + "nodeSelector", + "priorityClassName", + "replicaCount", + "restartPolicy", + "securityContext", + "strategy", + "terminationGracePeriodSeconds", + "tolerations", + "topologySpreadConstraints", + "volumes" + ] + }, + "grafana": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "dashboardDiscoveryLabels": { + "type": "object" + }, + "dashboards": { + "type": "object", + "properties": { + "postgresExporter": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "annotations": { + "type": "object" + }, + "labels": { + "type": "object" + } + }, + "required": [ + "enabled", + "annotations", + "labels" + ] + } + }, + "required": [ + "postgresExporter" + ] + } + }, + "required": [ + "enabled", + "dashboardDiscoveryLabels", + "dashboards" + ] + }, + "ingress": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "className": { + "type": "string" + }, + "annotations": { + "type": "object" + }, + "labels": { + "type": "object" + }, + "hosts": { + "type": "array", + "items": {} + }, + "tls": { + "type": "array", + "items": {} + } + }, + "required": [ + "enabled", + "className", + "annotations", + "labels", + "hosts", + "tls" + ] + }, + "podDisruptionBudget": { + "type": "object" + }, + "networkPolicies": { + "type": "object" + }, + "prometheus": { + "type": "object", + "properties": { + "metrics": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "podMonitor": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "annotations": { + "type": "object" + }, + "enableHttp2": { + "type": "boolean" + }, + "followRedirects": { + "type": "boolean" + }, + "honorLabels": { + "type": "boolean" + }, + "labels": { + "type": "object" + }, + "interval": { + "type": "string" + }, + "path": { + "type": "string" + }, + "relabelings": { + "type": "array", + "items": {} + }, + "scrapeTimeout": { + "type": "string" + }, + "scheme": { + "type": "string" + }, + "tlsConfig": { + "type": "object" + } + }, + "required": [ + "enabled", + "annotations", + "enableHttp2", + "followRedirects", + "honorLabels", + "labels", + "interval", + "path", + "relabelings", + "scrapeTimeout", + "scheme", + "tlsConfig" + ] + }, + "serviceMonitor": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "annotations": { + "type": "object" + }, + "labels": { + "type": "object" + }, + "enableHttp2": { + "type": "boolean" + }, + "followRedirects": { + "type": "boolean" + }, + "honorLabels": { + "type": "boolean" + }, + "interval": { + "type": "string" + }, + "path": { + "type": "string" + }, + "relabelings": { + "type": "array", + "items": {} + }, + "scrapeTimeout": { + "type": "string" + }, + "scheme": { + "type": "string" + }, + "tlsConfig": { + "type": "object" + } + }, + "required": [ + "enabled", + "annotations", + "labels", + "enableHttp2", + "followRedirects", + "honorLabels", + "interval", + "path", + "relabelings", + "scrapeTimeout", + "scheme", + "tlsConfig" + ] + } + }, + "required": [ + "enabled", + "podMonitor", + "serviceMonitor" + ] + }, + "rules": { + "type": "array", + "items": {} + } + }, + "required": [ + "metrics", + "rules" + ] + }, + "services": { + "type": "object", + "properties": { + "http": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "annotations": { + "type": "object" + }, + "externalIPs": { + "type": "array", + "items": {} + }, + "externalTrafficPolicy": { + "type": "string" + }, + "internalTrafficPolicy": { + "type": "string" + }, + "ipFamilies": { + "type": "array", + "items": {} + }, + "labels": { + "type": "object" + }, + "loadBalancerClass": { + "type": "string" + }, + "loadBalancerIP": { + "type": "string" + }, + "loadBalancerSourceRanges": { + "type": "array", + "items": {} + }, + "port": { + "type": "integer" + }, + "sessionAffinity": { + "type": "string" + }, + "sessionAffinityConfig": { + "type": "object" + }, + "type": { + "type": "string" + } + }, + "required": [ + "enabled", + "annotations", + "externalIPs", + "externalTrafficPolicy", + "internalTrafficPolicy", + "ipFamilies", + "labels", + "loadBalancerClass", + "loadBalancerIP", + "loadBalancerSourceRanges", + "port", + "sessionAffinity", + "sessionAffinityConfig", + "type" + ] + } + }, + "required": [ + "http" + ] + }, + "serviceAccount": { + "type": "object", + "properties": { + "existing": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "serviceAccountName": { + "type": "string" + } + }, + "required": [ + "enabled", + "serviceAccountName" + ] + }, + "new": { + "type": "object", + "properties": { + "annotations": { + "type": "object" + }, + "labels": { + "type": "object" + }, + "automountServiceAccountToken": { + "type": "boolean" + }, + "imagePullSecrets": { + "type": "array", + "items": {} + }, + "secrets": { + "type": "array", + "items": {} + } + }, + "required": [ + "annotations", + "labels", + "automountServiceAccountToken", + "imagePullSecrets", + "secrets" + ] + } + }, + "required": [ + "existing", + "new" + ] + } + }, + "required": [ + "nameOverride", + "fullnameOverride", + "config", + "deployment", + "grafana", + "ingress", + "podDisruptionBudget", + "networkPolicies", + "prometheus", + "services", + "serviceAccount" + ] +} diff --git a/values.yaml b/values.yaml index 119e0c8..0227441 100644 --- a/values.yaml +++ b/values.yaml @@ -248,12 +248,23 @@ deployment: # secretName: my-secret ## @section Grafana -## @param grafana.enabled Enable integration into Grafana. -## @param grafana.dashboards.businessMetrics Enable deployment of Grafana dashboard `businessMetrics`. +## @param grafana.enabled Enable integration into Grafana. Require the prometheus operator deployment. grafana: enabled: false + + ## @param grafana.dashboardDiscoveryLabels Labels that Grafana uses to discover resources. The labels may vary depending on the Grafana deployment. + ## @skip grafana.dashboardDiscoveryLabels + dashboardDiscoveryLabels: + grafana_dashboard: "1" + dashboards: - businessMetrics: true + ## @param grafana.dashboards.postgresExporter.enabled Enable deployment of Grafana dashboard `postgresExporter`. + ## @param grafana.dashboards.postgresExporter.annotations Additional configmap annotations. + ## @param grafana.dashboards.postgresExporter.labels Additional configmap labels. + postgresExporter: + enabled: true + annotations: {} + labels: {} ## @section Ingress ingress: