From 0b65c6583ab59f28506665ca0f2824ca82e7e95f Mon Sep 17 00:00:00 2001 From: Roman Zhilkin Date: Sat, 25 Jan 2025 02:31:48 +0700 Subject: [PATCH 01/12] =?UTF-8?q?=D0=9D=D0=B5=20=D0=B1=D1=83=D0=B4=D0=B5?= =?UTF-8?q?=D1=82=20=D0=BF=D0=BE=D0=B4=D0=B4=D0=B5=D1=80=D0=B6=D0=B8=D0=B2?= =?UTF-8?q?=D0=B0=D1=82=D1=8C=D1=81=D1=8F=20=D0=B4=D0=B8=D1=80=D0=B5=D0=BA?= =?UTF-8?q?=D1=82=D0=B8=D0=B2=D0=B0=20=D0=B2=20=D0=BD=D0=BE=D0=B2=D1=8B?= =?UTF-8?q?=D1=85=20=D0=B2=D0=B5=D1=80=D1=81=D0=B8=D1=8F=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manufacturer/container/services/docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manufacturer/container/services/docker-compose.yml b/manufacturer/container/services/docker-compose.yml index 1f735bb..cccd116 100644 --- a/manufacturer/container/services/docker-compose.yml +++ b/manufacturer/container/services/docker-compose.yml @@ -23,8 +23,8 @@ services: ipv4_address: 10.10.2.3 volumes: - wordpress_data:/var/www/html - extends: - service: stransit-test-db + depends_on: + - stransit-test-db stransit-test-apache: build: From 563ebc3fbd54ac1061154d07924ca41c3d49c9d7 Mon Sep 17 00:00:00 2001 From: Roman Zhilkin Date: Sat, 25 Jan 2025 02:56:06 +0700 Subject: [PATCH 02/12] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=B0=D0=BD=D0=B5=D0=BB=D0=B8?= =?UTF-8?q?=20=D1=81=20=D0=BC=D0=B5=D1=82=D1=80=D0=B8=D0=BA=D0=B0=D0=BC?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../provisioning/dashboard/dashboard.json | 742 ++++++++++++++++++ 1 file changed, 742 insertions(+) create mode 100644 manufacturer/configs/grafana/provisioning/dashboard/dashboard.json diff --git a/manufacturer/configs/grafana/provisioning/dashboard/dashboard.json b/manufacturer/configs/grafana/provisioning/dashboard/dashboard.json new file mode 100644 index 0000000..6a1da21 --- /dev/null +++ b/manufacturer/configs/grafana/provisioning/dashboard/dashboard.json @@ -0,0 +1,742 @@ +{ + "__inputs": [ + { + "name": "DS_LOCALHOST", + "label": "localhost", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "4.4.3" + }, + { + "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": [] + }, + "editable": true, + "gnetId": 3894, + "graphTooltip": 0, + "hideControls": false, + "id": null, + "links": [], + "refresh": "1m", + "rows": [ + { + "collapse": false, + "height": 102, + "panels": [ + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "datasource": "${DS_LOCALHOST}", + "decimals": 1, + "format": "s", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "id": 8, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "s", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "span": 2, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "apache_uptime_seconds_total{instance=~\"$host:$port\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A", + "step": 240 + } + ], + "thresholds": "", + "title": "Uptime", + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_LOCALHOST}", + "decimals": 0, + "fill": 7, + "id": 5, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 3, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "Apache Down", + "color": "#BF1B00" + }, + { + "alias": "Apache Down", + "transform": "negative-Y" + } + ], + "spaceLength": 10, + "span": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "count(apache_up{instance=~\"$host:$port\"} == 1)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Apache Up", + "refId": "A", + "step": 240 + }, + { + "expr": "scalar(count(apache_up{instance=~\"$host:$port\"} == 0))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Apache Down", + "refId": "B", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Apache Up / Down", + "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": "1", + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Basic Apache status", + "titleSize": "h6" + }, + { + "collapse": false, + "height": "365", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_LOCALHOST}", + "decimals": 2, + "fill": 1, + "id": 3, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(apache_sent_kilobytes_total{instance=~\"$host:$port\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Kilobytes Sent", + "refId": "A", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Current total kbytes sent", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "deckbytes", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ] + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_LOCALHOST}", + "decimals": 2, + "fill": 1, + "id": 1, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(apache_accesses_total{instance=~\"$host:$port\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Accesses", + "refId": "A", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Current total apache accesses", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Traffic Load", + "titleSize": "h6" + }, + { + "collapse": false, + "height": "365", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_LOCALHOST}", + "decimals": 2, + "fill": 1, + "id": 2, + "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", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 12, + "stack": true, + "steppedLine": false, + "targets": [ + { + "expr": "apache_scoreboard{instance=~\"$host:$port\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{ state }}", + "refId": "A", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Apache scoreboard statuses", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Scoreboard", + "titleSize": "h6" + }, + { + "collapse": false, + "height": "365", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_LOCALHOST}", + "decimals": 2, + "fill": 1, + "id": 7, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": true, + "steppedLine": false, + "targets": [ + { + "expr": "apache_workers{instance=~\"$host:$port\"}\n", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{ state }}", + "refId": "A", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Apache worker statuses", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ] + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_LOCALHOST}", + "decimals": 2, + "fill": 1, + "id": 4, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "apache_cpuload{instance=~\"$host:$port\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Load", + "refId": "A", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Apache CPU load", + "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": false + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Processing Load", + "titleSize": "h6" + } + ], + "schemaVersion": 14, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": {}, + "datasource": "${DS_LOCALHOST}", + "hide": 0, + "includeAll": false, + "label": "host", + "multi": false, + "name": "host", + "options": [], + "query": "label_values(apache_up, instance)", + "refresh": 2, + "regex": "/([^:]+):.*/", + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_LOCALHOST}", + "hide": 2, + "includeAll": false, + "label": null, + "multi": false, + "name": "port", + "options": [], + "query": "label_values(apache_up, instance)", + "refresh": 1, + "regex": "/[^:]+:(.*)/", + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-24h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Apache", + "version": 13, + "description": "Apache Prometheus Dashboard" +} From 107569459b0f6423221b7cd9271fad508ee1d4b1 Mon Sep 17 00:00:00 2001 From: Roman Zhilkin Date: Sat, 25 Jan 2025 02:56:27 +0700 Subject: [PATCH 03/12] =?UTF-8?q?=D0=9B=D0=B0=D1=83=D0=BD=D1=87=D0=B5?= =?UTF-8?q?=D1=80=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B4?= =?UTF-8?q?=D0=B5=D1=80=D0=B3=D0=B8=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BD=D1=82=D0=B5=D0=B9=D0=BD=D0=B5=D1=80=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- launcher.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 launcher.sh diff --git a/launcher.sh b/launcher.sh new file mode 100644 index 0000000..5fa58ea --- /dev/null +++ b/launcher.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +docker stop stransit-test-grafana +docker rm stransit-test-grafana +docker volume rm stransit-test_grafana_data + +docker-compose -f manufacturer/container/services/docker-compose.yml up -d \ No newline at end of file From fd27953f40b81e2a4b2ae64ee2618a3b2133f991 Mon Sep 17 00:00:00 2001 From: Roman Zhilkin Date: Sat, 25 Jan 2025 05:18:27 +0700 Subject: [PATCH 04/12] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20Dashboard=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20=D1=81=20Apache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../provisioning/dashboard/dashboard.yaml | 9 - .../provisioning/dashboardProviders.yaml | 16 + .../dashboards/default/dashboard.json | 724 ++++++++++++++++++ 3 files changed, 740 insertions(+), 9 deletions(-) delete mode 100644 manufacturer/configs/grafana/provisioning/dashboard/dashboard.yaml create mode 100644 manufacturer/configs/grafana/provisioning/dashboardProviders.yaml create mode 100644 manufacturer/configs/grafana/provisioning/dashboards/default/dashboard.json diff --git a/manufacturer/configs/grafana/provisioning/dashboard/dashboard.yaml b/manufacturer/configs/grafana/provisioning/dashboard/dashboard.yaml deleted file mode 100644 index 6e0a4f3..0000000 --- a/manufacturer/configs/grafana/provisioning/dashboard/dashboard.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: 1 -providers: - - name: 'apache-dashboard' - type: file - disableDeletion: false - updateIntervalSeconds: 10 - allowUiUpdates: true - options: - path: /var/lib/grafana/dashboard \ No newline at end of file diff --git a/manufacturer/configs/grafana/provisioning/dashboardProviders.yaml b/manufacturer/configs/grafana/provisioning/dashboardProviders.yaml new file mode 100644 index 0000000..834a028 --- /dev/null +++ b/manufacturer/configs/grafana/provisioning/dashboardProviders.yaml @@ -0,0 +1,16 @@ +providers: + - name: 'default' + orgId: 1 + folder: '' + type: file + disableDeletion: false + editable: true + options: + path: /var/lib/grafana/dashboards/default + +dashboards: + default: + spring-boot-stat: + gnetId: 3894 + revision: 2 + datasource: Prometheus \ No newline at end of file diff --git a/manufacturer/configs/grafana/provisioning/dashboards/default/dashboard.json b/manufacturer/configs/grafana/provisioning/dashboards/default/dashboard.json new file mode 100644 index 0000000..452df29 --- /dev/null +++ b/manufacturer/configs/grafana/provisioning/dashboards/default/dashboard.json @@ -0,0 +1,724 @@ +{ + "dashboard": { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Apache Prometheus Dashboard", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "gnetId": 3894, + "hideControls": false, + "id": null, + "links": [], + "refresh": "1m", + "rows": [ + { + "collapse": false, + "height": 102, + "panels": [ + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "datasource": "Prometheus", + "decimals": 1, + "format": "s", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "id": 8, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "s", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "span": 2, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "expr": "apache_uptime_seconds_total{instance=~\"$host:$port\"}", + "format": "time_series", + "intervalFactor": 1, + "refId": "A", + "step": 240 + } + ], + "thresholds": "", + "title": "Uptime", + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "avg" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "decimals": 0, + "fill": 7, + "id": 5, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 3, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "Apache Down", + "color": "#BF1B00" + }, + { + "alias": "Apache Down", + "transform": "negative-Y" + } + ], + "spaceLength": 10, + "span": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "count(apache_up{instance=~\"$host:$port\"} == 1)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Apache Up", + "refId": "A", + "step": 240 + }, + { + "expr": "scalar(count(apache_up{instance=~\"$host:$port\"} == 0))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Apache Down", + "refId": "B", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Apache Up / Down", + "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": "1", + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Basic Apache status", + "titleSize": "h6" + }, + { + "collapse": false, + "height": "365", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "decimals": 2, + "fill": 1, + "id": 3, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(apache_sent_kilobytes_total{instance=~\"$host:$port\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Kilobytes Sent", + "refId": "A", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Current total kbytes sent", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "deckbytes", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ] + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "decimals": 2, + "fill": 1, + "id": 1, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(apache_accesses_total{instance=~\"$host:$port\"}[5m])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Accesses", + "refId": "A", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Current total apache accesses", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Traffic Load", + "titleSize": "h6" + }, + { + "collapse": false, + "height": "365", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "decimals": 2, + "fill": 1, + "id": 2, + "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", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 12, + "stack": true, + "steppedLine": false, + "targets": [ + { + "expr": "apache_scoreboard{instance=~\"$host:$port\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{ state }}", + "refId": "A", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Apache scoreboard statuses", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Scoreboard", + "titleSize": "h6" + }, + { + "collapse": false, + "height": "365", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "decimals": 2, + "fill": 1, + "id": 7, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": true, + "steppedLine": false, + "targets": [ + { + "expr": "apache_workers{instance=~\"$host:$port\"}\n", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{ state }}", + "refId": "A", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Apache worker statuses", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ] + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "decimals": 2, + "fill": 1, + "id": 4, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "apache_cpuload{instance=~\"$host:$port\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Load", + "refId": "A", + "step": 240 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Apache CPU load", + "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": false + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Processing Load", + "titleSize": "h6" + } + ], + "schemaVersion": 14, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": {}, + "datasource": "Prometheus", + "hide": 0, + "includeAll": false, + "label": "host", + "multi": false, + "name": "host", + "options": [], + "query": "label_values(apache_up, instance)", + "refresh": 2, + "regex": "/([^:]+):.*/", + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "Prometheus", + "hide": 2, + "includeAll": false, + "label": null, + "multi": false, + "name": "port", + "options": [], + "query": "label_values(apache_up, instance)", + "refresh": 1, + "regex": "/[^:]+:(.*)/", + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-24h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Apache", + "version": 13, + "description": "Apache Prometheus Dashboard" + }, + "overwrite": true +} From 11a63aafc29db1b6dddc39ee0ef89dba1614cbe0 Mon Sep 17 00:00:00 2001 From: Roman Zhilkin Date: Sat, 25 Jan 2025 05:25:11 +0700 Subject: [PATCH 05/12] =?UTF-8?q?=D0=A1=D0=BC=D0=B5=D0=BD=D0=B0=20=D0=BF?= =?UTF-8?q?=D1=83=D1=82=D0=B8=20=D0=B4=D0=BE=20=D0=B4=D0=B0=D1=88=D0=B0=20?= =?UTF-8?q?=D0=B0=D0=BF=D0=B0=D1=87=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboards/default/{dashboard.json => apache.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename manufacturer/configs/grafana/provisioning/dashboards/default/{dashboard.json => apache.json} (100%) diff --git a/manufacturer/configs/grafana/provisioning/dashboards/default/dashboard.json b/manufacturer/configs/grafana/provisioning/dashboards/default/apache.json similarity index 100% rename from manufacturer/configs/grafana/provisioning/dashboards/default/dashboard.json rename to manufacturer/configs/grafana/provisioning/dashboards/default/apache.json From dd2db7b1e20f0f2929cfee6c050d01a7ee915b0a Mon Sep 17 00:00:00 2001 From: Roman Zhilkin Date: Sat, 25 Jan 2025 05:31:08 +0700 Subject: [PATCH 06/12] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=81=D1=82=D0=B0=D1=80=D0=BE=D0=B3=D0=BE=20das?= =?UTF-8?q?h'=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../provisioning/dashboard/dashboard.json | 742 ------------------ 1 file changed, 742 deletions(-) delete mode 100644 manufacturer/configs/grafana/provisioning/dashboard/dashboard.json diff --git a/manufacturer/configs/grafana/provisioning/dashboard/dashboard.json b/manufacturer/configs/grafana/provisioning/dashboard/dashboard.json deleted file mode 100644 index 6a1da21..0000000 --- a/manufacturer/configs/grafana/provisioning/dashboard/dashboard.json +++ /dev/null @@ -1,742 +0,0 @@ -{ - "__inputs": [ - { - "name": "DS_LOCALHOST", - "label": "localhost", - "description": "", - "type": "datasource", - "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "4.4.3" - }, - { - "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": [] - }, - "editable": true, - "gnetId": 3894, - "graphTooltip": 0, - "hideControls": false, - "id": null, - "links": [], - "refresh": "1m", - "rows": [ - { - "collapse": false, - "height": 102, - "panels": [ - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "datasource": "${DS_LOCALHOST}", - "decimals": 1, - "format": "s", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "id": 8, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], - "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "postfix": "s", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "span": 2, - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false - }, - "tableColumn": "", - "targets": [ - { - "expr": "apache_uptime_seconds_total{instance=~\"$host:$port\"}", - "format": "time_series", - "intervalFactor": 1, - "refId": "A", - "step": 240 - } - ], - "thresholds": "", - "title": "Uptime", - "type": "singlestat", - "valueFontSize": "50%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_LOCALHOST}", - "decimals": 0, - "fill": 7, - "id": 5, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "rightSide": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 3, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "alias": "Apache Down", - "color": "#BF1B00" - }, - { - "alias": "Apache Down", - "transform": "negative-Y" - } - ], - "spaceLength": 10, - "span": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "count(apache_up{instance=~\"$host:$port\"} == 1)", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Apache Up", - "refId": "A", - "step": 240 - }, - { - "expr": "scalar(count(apache_up{instance=~\"$host:$port\"} == 0))", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Apache Down", - "refId": "B", - "step": 240 - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Apache Up / Down", - "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": "1", - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": false - } - ] - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "Basic Apache status", - "titleSize": "h6" - }, - { - "collapse": false, - "height": "365", - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_LOCALHOST}", - "decimals": 2, - "fill": 1, - "id": 3, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "span": 6, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(apache_sent_kilobytes_total{instance=~\"$host:$port\"}[5m])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Kilobytes Sent", - "refId": "A", - "step": 240 - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Current total kbytes sent", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "deckbytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": false - } - ] - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_LOCALHOST}", - "decimals": 2, - "fill": 1, - "id": 1, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "span": 6, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(apache_accesses_total{instance=~\"$host:$port\"}[5m])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Accesses", - "refId": "A", - "step": 240 - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Current total apache accesses", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": false - } - ] - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "Traffic Load", - "titleSize": "h6" - }, - { - "collapse": false, - "height": "365", - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_LOCALHOST}", - "decimals": 2, - "fill": 1, - "id": 2, - "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", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "span": 12, - "stack": true, - "steppedLine": false, - "targets": [ - { - "expr": "apache_scoreboard{instance=~\"$host:$port\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "{{ state }}", - "refId": "A", - "step": 240 - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Apache scoreboard statuses", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": false - } - ] - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "Scoreboard", - "titleSize": "h6" - }, - { - "collapse": false, - "height": "365", - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_LOCALHOST}", - "decimals": 2, - "fill": 1, - "id": 7, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "span": 6, - "stack": true, - "steppedLine": false, - "targets": [ - { - "expr": "apache_workers{instance=~\"$host:$port\"}\n", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "{{ state }}", - "refId": "A", - "step": 240 - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Apache worker statuses", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": false - } - ] - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_LOCALHOST}", - "decimals": 2, - "fill": 1, - "id": 4, - "legend": { - "alignAsTable": true, - "avg": true, - "current": true, - "max": true, - "min": true, - "show": true, - "total": false, - "values": true - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "span": 6, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "apache_cpuload{instance=~\"$host:$port\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Load", - "refId": "A", - "step": 240 - } - ], - "thresholds": [], - "timeFrom": null, - "timeShift": null, - "title": "Apache CPU load", - "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": false - } - ] - } - ], - "repeat": null, - "repeatIteration": null, - "repeatRowId": null, - "showTitle": false, - "title": "Processing Load", - "titleSize": "h6" - } - ], - "schemaVersion": 14, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "allValue": null, - "current": {}, - "datasource": "${DS_LOCALHOST}", - "hide": 0, - "includeAll": false, - "label": "host", - "multi": false, - "name": "host", - "options": [], - "query": "label_values(apache_up, instance)", - "refresh": 2, - "regex": "/([^:]+):.*/", - "sort": 1, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": null, - "current": {}, - "datasource": "${DS_LOCALHOST}", - "hide": 2, - "includeAll": false, - "label": null, - "multi": false, - "name": "port", - "options": [], - "query": "label_values(apache_up, instance)", - "refresh": 1, - "regex": "/[^:]+:(.*)/", - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-24h", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, - "timezone": "", - "title": "Apache", - "version": 13, - "description": "Apache Prometheus Dashboard" -} From 266a141aca9a5447f33ea9200fff1cb403b61b82 Mon Sep 17 00:00:00 2001 From: Roman Zhilkin Date: Sat, 25 Jan 2025 05:31:41 +0700 Subject: [PATCH 07/12] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D0=BA=D1=80=D0=B8=D0=BF=D1=82?= =?UTF-8?q?=D0=B0=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=B4=D0=B0=D1=88=D0=B0=20=D0=B0=D0=BF=D0=B0=D1=87=D0=B0=20?= =?UTF-8?q?=D0=BF=D0=BE=20=D0=90=D0=9F=D0=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scripts/import_apache_dashboard.sh | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 manufacturer/container/grafana/scripts/import_apache_dashboard.sh diff --git a/manufacturer/container/grafana/scripts/import_apache_dashboard.sh b/manufacturer/container/grafana/scripts/import_apache_dashboard.sh new file mode 100644 index 0000000..acd59df --- /dev/null +++ b/manufacturer/container/grafana/scripts/import_apache_dashboard.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Устанавливаю переменные +GF_URL=localhost:3000 +GF_LOGIN=admin +GF_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD} +GF_DASHBOARD_URL=/var/lib/grafana/dashboards/default/apache.json + + +# Проверяю, что файл существует +if [[ ! -f "$GF_DASHBOARD_URL" ]]; then + echo "Файл $GF_DASHBOARD_URL не найден!" + exit 1 +fi + +# Загружаю JSON в переменную +GF_DASHBOARD_JSON=$(<"$GF_DASHBOARD_URL") + +# Создаю запрос на создание дашборда +response=$(curl -u "$GF_LOGIN:$GF_PASSWORD" \ + -X POST \ + -H "Content-Type: application/json" \ + -d "$GF_DASHBOARD_JSON" \ + "$GF_URL/api/dashboards/db") + +# Вывожу ответ от API графы +if [[ $? -eq 0 ]]; then + echo "Ответ API: $response" +else + echo "Произошла ошибка при создании дашборда." + echo "Ответ API: $response" +fi From dc823fc26af233e76e1f8da4b2a17251740a212e Mon Sep 17 00:00:00 2001 From: Roman Zhilkin Date: Sat, 25 Jan 2025 05:50:11 +0700 Subject: [PATCH 08/12] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B1=D1=80=D0=BE?= =?UTF-8?q?=D1=81=20=D1=81=D0=BA=D1=80=D0=B8=D0=BF=D1=82=D0=BE=D0=B2=20?= =?UTF-8?q?=D0=B8=20=D0=BF=D0=B0=D0=BD=D0=B5=D0=BB=D0=B5=D0=B9=20=D0=B2=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=82=D0=B5=D0=B9=D0=BD=D0=B5=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manufacturer/container/services/docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manufacturer/container/services/docker-compose.yml b/manufacturer/container/services/docker-compose.yml index cccd116..0bfe963 100644 --- a/manufacturer/container/services/docker-compose.yml +++ b/manufacturer/container/services/docker-compose.yml @@ -88,6 +88,8 @@ services: volumes: - grafana_data:/var/lib/grafana - ../../configs/grafana/provisioning:/etc/grafana/provisioning + - ../../configs/grafana/provisioning/dashboards:/var/lib/grafana/dashboards + - ../grafana/scripts:/var/lib/grafana/scripts # - ../grafana/import_dashboard.sh:/docker-entrypoint-init.d/import_dashboard.sh # entrypoint: [ "/bin/sh", "-c", "chmod +x /docker-entrypoint-init.d/import_dashboard.sh && /docker-entrypoint-init.d/import_dashboard.sh" ] From a0d69ac4fd56b223c9aeba17bb18de0ab1fb84ac Mon Sep 17 00:00:00 2001 From: Roman Zhilkin Date: Sat, 25 Jan 2025 06:52:53 +0700 Subject: [PATCH 09/12] =?UTF-8?q?=D0=A3=D0=BA=D0=B0=D0=B7=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B0=D0=B4=D1=80=D0=B5=D1=81=D0=B0=20=D0=B4?= =?UTF-8?q?=D0=BE=20=D0=B3=D1=80=D0=B0=D1=84=D0=B0=D0=BD=D1=8B=20=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D1=82=D0=B8=D0=BA=D0=BE=D0=B9=20=D0=B8=20=D1=81?= =?UTF-8?q?=D0=BE=D0=BA=D1=80=D0=B0=D1=89=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF?= =?UTF-8?q?=D1=83=D1=82=D0=B8=20=D0=B4=D0=BE=20=D0=B4=D0=B0=D1=88=D0=B0=20?= =?UTF-8?q?=D0=B0=D0=BF=D0=B0=D1=87=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../container/grafana/scripts/import_apache_dashboard.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 manufacturer/container/grafana/scripts/import_apache_dashboard.sh diff --git a/manufacturer/container/grafana/scripts/import_apache_dashboard.sh b/manufacturer/container/grafana/scripts/import_apache_dashboard.sh old mode 100644 new mode 100755 index acd59df..2ca2003 --- a/manufacturer/container/grafana/scripts/import_apache_dashboard.sh +++ b/manufacturer/container/grafana/scripts/import_apache_dashboard.sh @@ -1,10 +1,10 @@ #!/bin/bash # Устанавливаю переменные -GF_URL=localhost:3000 +GF_URL=10.10.1.4:3000 GF_LOGIN=admin GF_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD} -GF_DASHBOARD_URL=/var/lib/grafana/dashboards/default/apache.json +GF_DASHBOARD_URL=/scripts/apache.json # Проверяю, что файл существует From c0886cb4ec65a50adee07cde69db883e5b429048 Mon Sep 17 00:00:00 2001 From: Roman Zhilkin Date: Sat, 25 Jan 2025 06:53:44 +0700 Subject: [PATCH 10/12] =?UTF-8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B8=D0=BC=D0=BF=D0=BE=D1=80=D1=82=D0=B5=D1=80?= =?UTF-8?q?=D0=B0=20=D0=B8=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=81=D0=BA=D1=80=D0=B8=D0=BF=D1=82=D0=B0?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20=D0=BE=D0=B6=D0=B8=D0=B4=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=B4=D0=BE=D1=81=D1=82=D1=83=D0=BF=D0=BD=D0=BE?= =?UTF-8?q?=D1=81=D1=82=D0=B8=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B5=D0=B9=D0=BD?= =?UTF-8?q?=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manufacturer/container/importer/Dockerfile | 8 ++++++++ .../container/importer/scripts/wait_for_it.sh | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 manufacturer/container/importer/Dockerfile create mode 100644 manufacturer/container/importer/scripts/wait_for_it.sh diff --git a/manufacturer/container/importer/Dockerfile b/manufacturer/container/importer/Dockerfile new file mode 100644 index 0000000..20d1e3b --- /dev/null +++ b/manufacturer/container/importer/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:3.21 + +# Устанавливаю BASH и CURL для работы с API графаны +RUN apk add --no-cache bash curl + +COPY manufacturer/container/importer/scripts/wait_for_it.sh /usr/local/bin/wait-for-it + +RUN chmod +x /usr/local/bin/wait-for-it \ No newline at end of file diff --git a/manufacturer/container/importer/scripts/wait_for_it.sh b/manufacturer/container/importer/scripts/wait_for_it.sh new file mode 100644 index 0000000..f7af33d --- /dev/null +++ b/manufacturer/container/importer/scripts/wait_for_it.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -e + +host="$1" +shift +port="$1" +shift +cmd="$@" + +until nc -z "$host" "$port"; do + >&2 echo "Графана $host:$port недоступна - ждем..." + sleep 1 +done + +>&2 echo "Графана $host:$port доступна - импортирую даш." +exec $cmd From 74de141ab47276759f43a56aeb8291532152ba9e Mon Sep 17 00:00:00 2001 From: Roman Zhilkin Date: Sat, 25 Jan 2025 06:54:21 +0700 Subject: [PATCH 11/12] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B8=D0=BC=D0=BF=D0=BE=D1=80=D1=82?= =?UTF-8?q?=D0=B5=D1=80=D0=B0=20=D0=B2=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE?= =?UTF-8?q?=D0=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../container/services/docker-compose.yml | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/manufacturer/container/services/docker-compose.yml b/manufacturer/container/services/docker-compose.yml index 0bfe963..ed5457e 100644 --- a/manufacturer/container/services/docker-compose.yml +++ b/manufacturer/container/services/docker-compose.yml @@ -88,10 +88,24 @@ services: volumes: - grafana_data:/var/lib/grafana - ../../configs/grafana/provisioning:/etc/grafana/provisioning - - ../../configs/grafana/provisioning/dashboards:/var/lib/grafana/dashboards - - ../grafana/scripts:/var/lib/grafana/scripts -# - ../grafana/import_dashboard.sh:/docker-entrypoint-init.d/import_dashboard.sh -# entrypoint: [ "/bin/sh", "-c", "chmod +x /docker-entrypoint-init.d/import_dashboard.sh && /docker-entrypoint-init.d/import_dashboard.sh" ] + + stransit-test-grafana-importer: + build: + context: ../../../. + dockerfile: manufacturer/container/importer/Dockerfile + image: stransit-test-grafana-importer:v1 + container_name: stransit-test-grafana-importer + networks: + stransit-test-metrics: + volumes: + - ../grafana/scripts/import_apache_dashboard.sh:/scripts/import_apache_dashboard.sh + - ../../configs/grafana/provisioning/dashboards/default/apache.json:/scripts/apache.json + depends_on: + - stransit-test-grafana + env_file: + - .env + command: + [ "/bin/bash", "-c", "wait-for-it stransit-test-grafana:3000 -- bash /scripts/import_apache_dashboard.sh" ] volumes: db_data: From 118b28157a13a6e31f20b520afd9d409f83ce953 Mon Sep 17 00:00:00 2001 From: Roman Zhilkin Date: Sat, 25 Jan 2025 06:54:32 +0700 Subject: [PATCH 12/12] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=81=D1=82=D0=B0=D1=80=D0=BE=D0=B3=D0=BE=20?= =?UTF-8?q?=D1=81=D0=BA=D1=80=D0=B8=D0=BF=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../container/grafana/import_dashboard.sh | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100755 manufacturer/container/grafana/import_dashboard.sh diff --git a/manufacturer/container/grafana/import_dashboard.sh b/manufacturer/container/grafana/import_dashboard.sh deleted file mode 100755 index d93b22b..0000000 --- a/manufacturer/container/grafana/import_dashboard.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - - -GF_SECURITY_ADMIN_PASSWORD=admin -GRAFANA_URL=localhost -DASHBOARD_FILE="dashboard.json" -DATA_SOURCE_UID="10.10.1.3:9090" - -GRAFANA_URL=http://admin:${GF_SECURITY_ADMIN_PASSWORD}@${GRAFANA_URL}:3000 - -if [[ ! -f "$DASHBOARD_FILE" ]]; then - echo "Ошибка: Файл с дашбордом '${DASHBOARD_FILE}' не найден." - exit 1 -fi - -DASHBOARD_JSON=$(<"$DASHBOARD_FILE") - -DASHBOARD_JSON=$(echo "$DASHBOARD_JSON" | sed "s/\${DS_LOCALHOST}/$DATA_SOURCE_UID/g") - -IMPORT_JSON=$(jq -n --argjson dashboard "$DASHBOARD_JSON" \ - '{dashboard: $dashboard, overwrite: true}') - - -echo "Измененный JSON дашборда:" -echo "$IMPORT_JSON" - - -response=$(curl -X POST "${GRAFANA_URL}/api/dashboards/import" \ - -H "Content-Type: application/json" \ - -d "${IMPORT_JSON}") - -echo "Ответ от Grafana: ${response}" \ No newline at end of file