From 93dcf23d59630a5451fd5d4627796483b7791cf4 Mon Sep 17 00:00:00 2001 From: Artem Goncharov Date: Mon, 21 Feb 2022 15:03:05 +0100 Subject: [PATCH] Properly build init container (#6) Properly build init container Reviewed-by: OpenTelekomCloud Bot --- Dockerfile | 3 +- grafana/dashboard/smtp.json | 282 ------------------------- grafana/dashboards/smtp.yaml | 206 ++++++++++++++++++ grafana/library/smtp_availability.json | 102 --------- grafana/library/smtp_latency.json | 89 -------- 5 files changed, 207 insertions(+), 475 deletions(-) delete mode 100644 grafana/dashboard/smtp.json create mode 100644 grafana/dashboards/smtp.yaml delete mode 100644 grafana/library/smtp_availability.json delete mode 100644 grafana/library/smtp_latency.json diff --git a/Dockerfile b/Dockerfile index 330605d..600a394 100644 --- a/Dockerfile +++ b/Dockerfile @@ -55,9 +55,8 @@ WORKDIR /cloudmon COPY ./grafana ./grafana +RUN rm -rf /cloudmon/init/grafana RUN mkdir /cloudmon/init && tar cvfz /cloudmon/init/grafana.tar.gz grafana RUN rm -rf /cloudmon/grafana -# Use an unprivileged user. -USER cloudmon:cloudmon CMD ["/bin/sh"] diff --git a/grafana/dashboard/smtp.json b/grafana/dashboard/smtp.json deleted file mode 100644 index 86bba3e..0000000 --- a/grafana/dashboard/smtp.json +++ /dev/null @@ -1,282 +0,0 @@ -{ - "dashboard": { - "editable": true, - "panels": [ - { - "datasource": {{ cloudmon_datasource }}, - "description": "Connection latency to the SMTP server", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": 120000, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 1, - "libraryPanel": { - "name": "SMTP Server Connection Latency1", - "uid": "CmonSmtpLatency" - }, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single" - } - }, - "targets": [ - { - "datasource": { - "type": "graphite", - "uid": "0hbH5V6Mk" - }, - "refCount": 0, - "refId": "A", - "target": "aliasByNode(stats.timers.cloudmon.$environment.$zone.smtp.$smtp_server.mean, 6)" - } - ], - "title": "Connection Latency", - "type": "timeseries" - }, - { - "datasource": {{ cloudmon_datasource }}, - "description": "Percentage of 220 status codes to overall attempted requests", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "stepBefore", - "lineWidth": 1, - "pointSize": 2, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "always", - "spanNulls": 60000, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 0, - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "yellow", - "value": 80 - }, - { - "color": "green", - "value": 90 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 0 - }, - "id": 2, - "libraryPanel": { - "name": "SMTP Server Availability1", - "uid": "CmonSmtpAvail" - }, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single" - } - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "datasource": { - "type": "graphite", - "uid": "0hbH5V6Mk" - }, - "refCount": 0, - "refId": "A", - "target": "aliasByNode(applyByNode(exclude(stats.counters.cloudmon.$environment.$zone.smtp.$smtp_server.*.count, 'attempted'), 6, 'asPercent(%.220.count, sumSeries(exclude(%.*.count, \"attempted\")))', '%.pct_220'), 6)", - "textEditor": true - } - ], - "title": "Server Availability", - "transformations": [], - "type": "timeseries" - } - ], - "refresh": "10s", - "schemaVersion": 34, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "current": { - "selected": true, - "text": [ - "All" - ], - "value": [ - "$__all" - ] - }, - "datasource": {{ cloudmon_datasource }}, - "definition": "stats.counters.cloudmon.*.*.smtp.*", - "hide": 0, - "includeAll": true, - "label": "Server", - "multi": true, - "name": "smtp_server", - "options": [], - "query": "stats.counters.cloudmon.*.*.smtp.*", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "type": "query" - }, - { - "current": { - "selected": false, - "text": "All", - "value": "$__all" - }, - "datasource": {{ cloudmon_datasource }}, - "definition": "stats.counters.cloudmon.*", - "hide": 0, - "includeAll": true, - "label": "Environment", - "multi": true, - "name": "environment", - "options": [], - "query": "stats.counters.cloudmon.*", - "refresh": 1, - "regex": "/^(?!swift)(.*)$/", - "skipUrlSync": false, - "sort": 0, - "type": "query" - }, - { - "current": { - "selected": true, - "text": [ - "All" - ], - "value": [ - "$__all" - ] - }, - "datasource": {{ cloudmon_datasource }}, - "definition": "stats.counters.cloudmon.*.*", - "hide": 0, - "includeAll": true, - "label": "Zone", - "multi": true, - "name": "zone", - "options": [], - "query": "stats.counters.cloudmon.*.*", - "refresh": 1, - "regex": "/^(?!swift)(.*)$/", - "skipUrlSync": false, - "sort": 0, - "type": "query" - } - ] - }, - "time": { - "from": "now-30m", - "to": "now" - }, - "title": "SMTP Statistics", - "uid": "CmonSmtp" - } -} diff --git a/grafana/dashboards/smtp.yaml b/grafana/dashboards/smtp.yaml new file mode 100644 index 0000000..e753ee6 --- /dev/null +++ b/grafana/dashboards/smtp.yaml @@ -0,0 +1,206 @@ +editable: true +panels: + - datasource: '$cloudmon_datasource' + description: Connection latency to the SMTP server + fieldConfig: + defaults: + color: + mode: palette-classic + custom: + axisLabel: '' + axisPlacement: auto + barAlignment: 0 + drawStyle: line + fillOpacity: 0 + gradientMode: none + hideFrom: + legend: false + tooltip: false + viz: false + lineInterpolation: linear + lineWidth: 1 + pointSize: 5 + scaleDistribution: + type: linear + showPoints: auto + spanNulls: 120000 + stacking: + group: A + mode: none + thresholdsStyle: + mode: 'off' + mappings: [] + thresholds: + mode: absolute + steps: + - color: green + value: null + - color: red + value: 80 + unit: ms + overrides: [] + gridPos: + h: 9 + w: 12 + x: 0 + y: 0 + id: 1 + libraryPanel: + name: SMTP Server Connection Latency1 + uid: CmonSmtpLatency + options: + legend: + calcs: [] + displayMode: list + placement: bottom + tooltip: + mode: single + targets: + - datasource: '$cloudmon_datasource' + refCount: 0 + refId: A + target: aliasByNode(stats.timers.cloudmon.$environment.$zone.smtp.$smtp_server.mean, + 6) + title: Connection Latency + type: timeseries + - datasource: '$cloudmon_datasource' + description: Percentage of 220 status codes to overall attempted requests + fieldConfig: + defaults: + color: + mode: palette-classic + custom: + axisLabel: '' + axisPlacement: auto + barAlignment: 0 + drawStyle: line + fillOpacity: 0 + gradientMode: none + hideFrom: + legend: false + tooltip: false + viz: false + lineInterpolation: stepBefore + lineWidth: 1 + pointSize: 2 + scaleDistribution: + type: linear + showPoints: always + spanNulls: 60000 + stacking: + group: A + mode: none + thresholdsStyle: + mode: 'off' + decimals: 0 + mappings: [] + max: 100 + min: 0 + thresholds: + mode: absolute + steps: + - color: red + value: null + - color: yellow + value: 80 + - color: green + value: 90 + unit: percent + overrides: [] + gridPos: + h: 9 + w: 12 + x: 12 + y: 0 + id: 2 + libraryPanel: + name: SMTP Server Availability1 + uid: CmonSmtpAvail + options: + legend: + calcs: + - lastNotNull + displayMode: list + placement: bottom + tooltip: + mode: single + pluginVersion: 8.3.3 + targets: + - datasource: '$cloudmon_datasource' + refCount: 0 + refId: A + target: aliasByNode(applyByNode(exclude(stats.counters.cloudmon.$environment.$zone.smtp.$smtp_server.*.count, + 'attempted'), 6, 'asPercent(%.220.count, sumSeries(exclude(%.*.count, + "attempted")))', '%.pct_220'), 6) + textEditor: true + title: Server Availability + transformations: [] + type: timeseries +refresh: 1m +schemaVersion: 34 +style: dark +templating: + list: + - current: + selected: true + text: + - All + value: + - $__all + datasource: '$cloudmon_datasource' + definition: stats.counters.cloudmon.*.*.smtp.* + hide: 0 + includeAll: true + label: Server + multi: true + name: smtp_server + options: [] + query: stats.counters.cloudmon.*.*.smtp.* + refresh: 1 + regex: '' + skipUrlSync: false + sort: 0 + type: query + - current: + selected: false + text: All + value: $__all + datasource: '$cloudmon_datasource' + definition: stats.counters.cloudmon.* + hide: 0 + includeAll: true + label: Environment + multi: true + name: environment + options: [] + query: stats.counters.cloudmon.* + refresh: 1 + regex: /^(?!swift)(.*)$/ + skipUrlSync: false + sort: 0 + type: query + - current: + selected: true + text: + - All + value: + - $__all + datasource: '$cloudmon_datasource' + definition: stats.counters.cloudmon.*.* + hide: 0 + includeAll: true + label: Zone + multi: true + name: zone + options: [] + query: stats.counters.cloudmon.*.* + refresh: 1 + regex: /^(?!swift)(.*)$/ + skipUrlSync: false + sort: 0 + type: query +time: + from: now-60m + to: now +title: SMTP Statistics +uid: CmonSmtp diff --git a/grafana/library/smtp_availability.json b/grafana/library/smtp_availability.json deleted file mode 100644 index cae423d..0000000 --- a/grafana/library/smtp_availability.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "uid": "CmonSmtpAvail", - "name": "SMTP Server Availability1", - "kind": 1, - "type": "timeseries", - "description": "Percentage of 220 status codes to overall attempted requests", - "model": { - "datasource": {{ cloudmon_datasource }}, - "description": "Percentage of 220 status codes to overall attempted requests", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "stepBefore", - "lineWidth": 1, - "pointSize": 2, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "always", - "spanNulls": 60000, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 0, - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "yellow", - "value": 80 - }, - { - "color": "green", - "value": 90 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 0 - }, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single" - } - }, - "pluginVersion": "8.3.3", - "targets": [ - { - "datasource": {{ cloudmon_datasource }}, - "refCount": 0, - "refId": "A", - "target": "aliasByNode(applyByNode(exclude(stats.counters.cloudmon.$environment.$zone.smtp.$smtp_server.*.count, 'attempted'), 6, 'asPercent(%.220.count, sumSeries(exclude(%.*.count, \"attempted\")))', '%.pct_220'), 6)", - "textEditor": true - } - ], - "title": "Server Availability", - "transformations": [], - "type": "timeseries" - } - } - } -} diff --git a/grafana/library/smtp_latency.json b/grafana/library/smtp_latency.json deleted file mode 100644 index 1030368..0000000 --- a/grafana/library/smtp_latency.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "uid": "CmonSmtpLatency", - "name": "SMTP Server Connection Latency1", - "kind": 1, - "type": "timeseries", - "description": "Connection latency to the SMTP server", - "model": { - "datasource": {{ cloudmon_datasource }}, - "description": "Connection latency to the SMTP server", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": 120000, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 0 - }, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single" - } - }, - "targets": [ - { - "datasource": {{ cloudmon_datasource }}, - "refCount": 0, - "refId": "A", - "target": "aliasByNode(stats.timers.cloudmon.$environment.$zone.smtp.$smtp_server.mean, 6)" - } - ], - "title": "Connection Latency", - "type": "timeseries" - } - } -}