diff --git a/deploy/grafana/dashboards/distr-deployment-status.json b/deploy/grafana/dashboards/distr-deployment-status.json new file mode 100644 index 000000000..f96de2d1e --- /dev/null +++ b/deploy/grafana/dashboards/distr-deployment-status.json @@ -0,0 +1,1146 @@ +{ + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "Prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "11.0.0" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + }, + { + "type": "panel", + "id": "piechart", + "name": "Pie chart", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + }, + { + "type": "panel", + "id": "bargauge", + "name": "Bar gauge", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 1, + "id": null, + "links": [], + "panels": [ + { + "collapsed": false, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, + "id": 100, + "title": "Overview", + "type": "row" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null } + ] + } + }, + "overrides": [] + }, + "gridPos": { "h": 4, "w": 4, "x": 0, "y": 1 }, + "id": 1, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "title": "Total Deployments", + "type": "stat", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "count(count by (deploymentid) (distr_deployment_status{organization=~\"$organization\"}))", + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null } + ] + } + }, + "overrides": [] + }, + "gridPos": { "h": 4, "w": 4, "x": 4, "y": 1 }, + "id": 2, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "title": "Healthy", + "type": "stat", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "count(distr_deployment_status{status=\"healthy\", organization=~\"$organization\"} == 1)", + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "blue", "value": null } + ] + } + }, + "overrides": [] + }, + "gridPos": { "h": 4, "w": 4, "x": 8, "y": 1 }, + "id": 3, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "title": "Running", + "type": "stat", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "count(distr_deployment_status{status=\"running\", organization=~\"$organization\"} == 1)", + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "yellow", "value": null } + ] + } + }, + "overrides": [] + }, + "gridPos": { "h": 4, "w": 4, "x": 12, "y": 1 }, + "id": 4, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "title": "Progressing", + "type": "stat", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "count(distr_deployment_status{status=\"progressing\", organization=~\"$organization\"} == 1)", + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "red", "value": null } + ] + } + }, + "overrides": [] + }, + "gridPos": { "h": 4, "w": 4, "x": 16, "y": 1 }, + "id": 5, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "title": "Error", + "type": "stat", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "count(distr_deployment_status{status=\"error\", organization=~\"$organization\"} == 1)", + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "orange", "value": null } + ] + } + }, + "overrides": [] + }, + "gridPos": { "h": 4, "w": 4, "x": 20, "y": 1 }, + "id": 6, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "title": "Organizations", + "type": "stat", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "distr_organizations_total", + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "hideFrom": { "legend": false, "tooltip": false, "viz": false } + } + }, + "overrides": [ + { + "matcher": { "id": "byName", "options": "healthy" }, + "properties": [{ "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } }] + }, + { + "matcher": { "id": "byName", "options": "running" }, + "properties": [{ "id": "color", "value": { "fixedColor": "blue", "mode": "fixed" } }] + }, + { + "matcher": { "id": "byName", "options": "progressing" }, + "properties": [{ "id": "color", "value": { "fixedColor": "yellow", "mode": "fixed" } }] + }, + { + "matcher": { "id": "byName", "options": "error" }, + "properties": [{ "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } }] + } + ] + }, + "gridPos": { "h": 8, "w": 8, "x": 0, "y": 5 }, + "id": 7, + "options": { + "legend": { "displayMode": "list", "placement": "bottom" }, + "pieType": "donut", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false + }, + "tooltip": { "mode": "single" } + }, + "title": "Deployment Status Distribution", + "type": "piechart", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "count by (status) (distr_deployment_status{organization=~\"$organization\"} == 1)", + "legendFormat": "{{status}}", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { "legend": false, "tooltip": false, "viz": false }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { "type": "linear" }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" }, + "thresholdsStyle": { "mode": "off" } + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null } + ] + } + }, + "overrides": [ + { + "matcher": { "id": "byName", "options": "healthy" }, + "properties": [{ "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } }] + }, + { + "matcher": { "id": "byName", "options": "running" }, + "properties": [{ "id": "color", "value": { "fixedColor": "blue", "mode": "fixed" } }] + }, + { + "matcher": { "id": "byName", "options": "progressing" }, + "properties": [{ "id": "color", "value": { "fixedColor": "yellow", "mode": "fixed" } }] + }, + { + "matcher": { "id": "byName", "options": "error" }, + "properties": [{ "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } }] + } + ] + }, + "gridPos": { "h": 8, "w": 16, "x": 8, "y": 5 }, + "id": 8, + "options": { + "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, + "tooltip": { "mode": "multi", "sort": "none" } + }, + "title": "Deployment Status Over Time", + "type": "timeseries", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "count by (status) (distr_deployment_status{organization=~\"$organization\"} == 1)", + "legendFormat": "{{status}}", + "refId": "A" + } + ] + }, + { + "collapsed": false, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 13 }, + "id": 101, + "title": "Deployments by Application", + "type": "row" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null }, + { "color": "red", "value": 1 } + ] + } + }, + "overrides": [] + }, + "gridPos": { "h": 6, "w": 12, "x": 0, "y": 14 }, + "id": 9, + "options": { + "displayMode": "gradient", + "maxVizHeight": 300, + "minVizHeight": 16, + "minVizWidth": 8, + "namePlacement": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false + }, + "showUnfilled": true, + "sizing": "auto", + "valueMode": "color" + }, + "title": "Errors by Application", + "type": "bargauge", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "count by (application) (distr_deployment_status{status=\"error\", organization=~\"$organization\"} == 1)", + "legendFormat": "{{application}}", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null }, + { "color": "red", "value": 1 } + ] + } + }, + "overrides": [] + }, + "gridPos": { "h": 6, "w": 12, "x": 12, "y": 14 }, + "id": 10, + "options": { + "displayMode": "gradient", + "maxVizHeight": 300, + "minVizHeight": 16, + "minVizWidth": 8, + "namePlacement": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false + }, + "showUnfilled": true, + "sizing": "auto", + "valueMode": "color" + }, + "title": "Errors by Deployment Target", + "type": "bargauge", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "count by (deploymenttarget) (distr_deployment_status{status=\"error\", organization=~\"$organization\"} == 1)", + "legendFormat": "{{deploymenttarget}}", + "refId": "A" + } + ] + }, + { + "collapsed": false, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 20 }, + "id": 102, + "title": "Deployment Details", + "type": "row" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "custom": { + "align": "auto", + "cellOptions": { "type": "auto" }, + "inspect": false + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null } + ] + } + }, + "overrides": [ + { + "matcher": { "id": "byName", "options": "Status" }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "mode": "basic", + "type": "color-background" + } + }, + { + "id": "mappings", + "value": [ + { "options": { "healthy": { "color": "green", "index": 0, "text": "Healthy" } }, "type": "value" }, + { "options": { "running": { "color": "blue", "index": 1, "text": "Running" } }, "type": "value" }, + { "options": { "progressing": { "color": "yellow", "index": 2, "text": "Progressing" } }, "type": "value" }, + { "options": { "error": { "color": "red", "index": 3, "text": "Error" } }, "type": "value" } + ] + } + ] + }, + { + "matcher": { "id": "byName", "options": "deploymentid" }, + "properties": [ + { "id": "custom.hidden", "value": true } + ] + }, + { + "matcher": { "id": "byName", "options": "Time" }, + "properties": [ + { "id": "custom.hidden", "value": true } + ] + }, + { + "matcher": { "id": "byName", "options": "Value" }, + "properties": [ + { "id": "custom.hidden", "value": true } + ] + }, + { + "matcher": { "id": "byName", "options": "__name__" }, + "properties": [ + { "id": "custom.hidden", "value": true } + ] + }, + { + "matcher": { "id": "byName", "options": "job" }, + "properties": [ + { "id": "custom.hidden", "value": true } + ] + }, + { + "matcher": { "id": "byName", "options": "instance" }, + "properties": [ + { "id": "custom.hidden", "value": true } + ] + } + ] + }, + "gridPos": { "h": 10, "w": 24, "x": 0, "y": 21 }, + "id": 11, + "options": { + "cellHeight": "sm", + "footer": { "countRows": false, "fields": "", "reducer": ["sum"], "show": false }, + "showHeader": true, + "sortBy": [ + { "desc": true, "displayName": "Status" } + ] + }, + "title": "All Deployments", + "type": "table", + "transformations": [ + { + "id": "labelsToFields", + "options": { "mode": "columns", "valueLabel": "status" } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "__name__": true, + "deploymentid": true, + "instance": true, + "job": true + }, + "renameByName": { + "application": "Application", + "applicationversion": "Version", + "customerorganization": "Customer", + "deploymenttarget": "Deployment Target", + "organization": "Organization" + } + } + } + ], + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "distr_deployment_status{organization=~\"$organization\"} == 1", + "format": "table", + "instant": true, + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "collapsed": false, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 31 }, + "id": 103, + "title": "Deployment Target Health", + "type": "row" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "custom": { + "align": "auto", + "cellOptions": { "type": "auto" }, + "inspect": false + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null } + ] + } + }, + "overrides": [ + { + "matcher": { "id": "byName", "options": "Last Seen" }, + "properties": [ + { "id": "unit", "value": "dateTimeFromNow" } + ] + }, + { + "matcher": { "id": "byName", "options": "instance" }, + "properties": [ + { "id": "custom.hidden", "value": true } + ] + }, + { + "matcher": { "id": "byName", "options": "job" }, + "properties": [ + { "id": "custom.hidden", "value": true } + ] + }, + { + "matcher": { "id": "byName", "options": "__name__" }, + "properties": [ + { "id": "custom.hidden", "value": true } + ] + }, + { + "matcher": { "id": "byName", "options": "Time" }, + "properties": [ + { "id": "custom.hidden", "value": true } + ] + } + ] + }, + "gridPos": { "h": 8, "w": 24, "x": 0, "y": 32 }, + "id": 12, + "options": { + "cellHeight": "sm", + "footer": { "countRows": false, "fields": "", "reducer": ["sum"], "show": false }, + "showHeader": true, + "sortBy": [ + { "desc": true, "displayName": "Last Seen" } + ] + }, + "title": "Deployment Target Last Seen", + "type": "table", + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "__name__": true, + "instance": true, + "job": true + }, + "renameByName": { + "Value": "Last Seen", + "customerorganization": "Customer", + "deploymenttarget": "Deployment Target", + "organization": "Organization" + } + } + } + ], + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "distr_deployment_target_status_timestamp_seconds{organization=~\"$organization\"} > 0", + "format": "table", + "instant": true, + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "collapsed": false, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 40 }, + "id": 104, + "title": "Deployment Status Timestamps", + "type": "row" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "custom": { + "align": "auto", + "cellOptions": { "type": "auto" }, + "inspect": false + }, + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": null } + ] + } + }, + "overrides": [ + { + "matcher": { "id": "byName", "options": "Last Updated" }, + "properties": [ + { "id": "unit", "value": "dateTimeFromNow" } + ] + }, + { + "matcher": { "id": "byName", "options": "instance" }, + "properties": [{ "id": "custom.hidden", "value": true }] + }, + { + "matcher": { "id": "byName", "options": "job" }, + "properties": [{ "id": "custom.hidden", "value": true }] + }, + { + "matcher": { "id": "byName", "options": "__name__" }, + "properties": [{ "id": "custom.hidden", "value": true }] + }, + { + "matcher": { "id": "byName", "options": "Time" }, + "properties": [{ "id": "custom.hidden", "value": true }] + }, + { + "matcher": { "id": "byName", "options": "deploymentid" }, + "properties": [{ "id": "custom.hidden", "value": true }] + } + ] + }, + "gridPos": { "h": 8, "w": 24, "x": 0, "y": 41 }, + "id": 13, + "options": { + "cellHeight": "sm", + "footer": { "countRows": false, "fields": "", "reducer": ["sum"], "show": false }, + "showHeader": true, + "sortBy": [ + { "desc": true, "displayName": "Last Updated" } + ] + }, + "title": "Deployment Last Status Update", + "type": "table", + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "__name__": true, + "deploymentid": true, + "instance": true, + "job": true + }, + "renameByName": { + "Value": "Last Updated", + "application": "Application", + "applicationversion": "Version", + "customerorganization": "Customer", + "deploymenttarget": "Deployment Target", + "organization": "Organization" + } + } + } + ], + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "distr_deployment_status_timestamp_seconds{organization=~\"$organization\"} > 0", + "format": "table", + "instant": true, + "legendFormat": "", + "refId": "A" + } + ] + }, + { + "collapsed": false, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 49 }, + "id": 105, + "title": "Process Metrics", + "type": "row" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { "legend": false, "tooltip": false, "viz": false }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { "type": "linear" }, + "showPoints": "never", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" }, + "thresholdsStyle": { "mode": "off" } + }, + "unit": "bytes", + "thresholds": { + "mode": "absolute", + "steps": [{ "color": "green", "value": null }] + } + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 12, "x": 0, "y": 50 }, + "id": 14, + "options": { + "legend": { "calcs": ["lastNotNull"], "displayMode": "list", "placement": "bottom" }, + "tooltip": { "mode": "multi", "sort": "none" } + }, + "title": "Memory Usage", + "type": "timeseries", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "process_resident_memory_bytes{job=~\"$job\"}", + "legendFormat": "Resident", + "refId": "A" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "go_memstats_heap_alloc_bytes{job=~\"$job\"}", + "legendFormat": "Heap Allocated", + "refId": "B" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "go_memstats_heap_inuse_bytes{job=~\"$job\"}", + "legendFormat": "Heap In Use", + "refId": "C" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { "legend": false, "tooltip": false, "viz": false }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { "type": "linear" }, + "showPoints": "never", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" }, + "thresholdsStyle": { "mode": "off" } + }, + "thresholds": { + "mode": "absolute", + "steps": [{ "color": "green", "value": null }] + } + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 12, "x": 12, "y": 50 }, + "id": 15, + "options": { + "legend": { "calcs": ["lastNotNull"], "displayMode": "list", "placement": "bottom" }, + "tooltip": { "mode": "multi", "sort": "none" } + }, + "title": "Goroutines & Threads", + "type": "timeseries", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "go_goroutines{job=~\"$job\"}", + "legendFormat": "Goroutines", + "refId": "A" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "go_threads{job=~\"$job\"}", + "legendFormat": "OS Threads", + "refId": "B" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { "legend": false, "tooltip": false, "viz": false }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { "type": "linear" }, + "showPoints": "never", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" }, + "thresholdsStyle": { "mode": "off" } + }, + "unit": "s", + "thresholds": { + "mode": "absolute", + "steps": [{ "color": "green", "value": null }] + } + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 12, "x": 0, "y": 58 }, + "id": 16, + "options": { + "legend": { "calcs": ["lastNotNull"], "displayMode": "list", "placement": "bottom" }, + "tooltip": { "mode": "multi", "sort": "none" } + }, + "title": "CPU Usage", + "type": "timeseries", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "rate(process_cpu_seconds_total{job=~\"$job\"}[5m])", + "legendFormat": "CPU Usage (cores)", + "refId": "A" + } + ] + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { "legend": false, "tooltip": false, "viz": false }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { "type": "linear" }, + "showPoints": "never", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" }, + "thresholdsStyle": { "mode": "off" } + }, + "unit": "Bps", + "thresholds": { + "mode": "absolute", + "steps": [{ "color": "green", "value": null }] + } + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 12, "x": 12, "y": 58 }, + "id": 17, + "options": { + "legend": { "calcs": ["lastNotNull"], "displayMode": "list", "placement": "bottom" }, + "tooltip": { "mode": "multi", "sort": "none" } + }, + "title": "Network I/O", + "type": "timeseries", + "targets": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "rate(process_network_receive_bytes_total{job=~\"$job\"}[5m])", + "legendFormat": "Received", + "refId": "A" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "expr": "rate(process_network_transmit_bytes_total{job=~\"$job\"}[5m])", + "legendFormat": "Transmitted", + "refId": "B" + } + ] + } + ], + "refresh": "30s", + "schemaVersion": 39, + "tags": ["distr", "deployment"], + "templating": { + "list": [ + { + "current": {}, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "definition": "label_values(distr_deployment_status, organization)", + "hide": 0, + "includeAll": true, + "label": "Organization", + "multi": true, + "name": "organization", + "options": [], + "query": { "qryType": 1, "query": "label_values(distr_deployment_status, organization)" }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "current": {}, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "definition": "label_values(go_info, job)", + "hide": 0, + "includeAll": true, + "label": "Job", + "multi": true, + "name": "job", + "options": [], + "query": { "qryType": 1, "query": "label_values(go_info, job)" }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + } + ] + }, + "time": { "from": "now-6h", "to": "now" }, + "timepicker": {}, + "timezone": "", + "title": "Distr - Deployment Status", + "uid": "distr-deployment-status", + "version": 1 +} diff --git a/deploy/grafana/docker-compose.yaml b/deploy/grafana/docker-compose.yaml new file mode 100644 index 000000000..24a35d515 --- /dev/null +++ b/deploy/grafana/docker-compose.yaml @@ -0,0 +1,25 @@ +name: distr-monitoring + +services: + prometheus: + image: prom/prometheus:v3.3.0 + volumes: + - ./prometheus.yaml:/etc/prometheus/prometheus.yml:ro + ports: + - '9090:9090' + extra_hosts: + - 'host.docker.internal:host-gateway' + + grafana: + image: grafana/grafana:11.6.0 + volumes: + - ./provisioning:/etc/grafana/provisioning:ro + - ./dashboards:/var/lib/grafana/dashboards:ro + ports: + - '3001:3000' + environment: + GF_AUTH_ANONYMOUS_ENABLED: 'true' + GF_AUTH_ANONYMOUS_ORG_ROLE: Admin + GF_AUTH_DISABLE_LOGIN_FORM: 'true' + depends_on: + - prometheus diff --git a/deploy/grafana/prometheus.yaml b/deploy/grafana/prometheus.yaml new file mode 100644 index 000000000..0f34cb17c --- /dev/null +++ b/deploy/grafana/prometheus.yaml @@ -0,0 +1,9 @@ +global: + scrape_interval: 15s + +scrape_configs: + - job_name: distr-hub + metrics_path: /metrics + static_configs: + - targets: + - host.docker.internal:3000 diff --git a/deploy/grafana/provisioning/dashboards/default.yaml b/deploy/grafana/provisioning/dashboards/default.yaml new file mode 100644 index 000000000..dc0074b83 --- /dev/null +++ b/deploy/grafana/provisioning/dashboards/default.yaml @@ -0,0 +1,12 @@ +apiVersion: 1 + +providers: + - name: Default + orgId: 1 + folder: Distr + type: file + disableDeletion: false + editable: true + options: + path: /var/lib/grafana/dashboards + foldersFromFilesStructure: false diff --git a/deploy/grafana/provisioning/datasources/prometheus.yaml b/deploy/grafana/provisioning/datasources/prometheus.yaml new file mode 100644 index 000000000..af7492822 --- /dev/null +++ b/deploy/grafana/provisioning/datasources/prometheus.yaml @@ -0,0 +1,10 @@ +apiVersion: 1 + +datasources: + - name: Prometheus + type: prometheus + uid: prometheus + access: proxy + url: http://prometheus:9090 + isDefault: true + editable: true