From c961d411713fe820d26abbcdb955a5cd6cc3a374 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Thu, 23 Jan 2025 17:16:36 -0400 Subject: [PATCH] Add Script Task Metrics Collection --- resources/grafana/MainDashboard.json | 323 +++++++++++++++------------ 1 file changed, 179 insertions(+), 144 deletions(-) diff --git a/resources/grafana/MainDashboard.json b/resources/grafana/MainDashboard.json index 1e367abd99..654ae51b96 100644 --- a/resources/grafana/MainDashboard.json +++ b/resources/grafana/MainDashboard.json @@ -1,59 +1,4 @@ { - "__inputs": [ - { - "name": "DS_PROMETHEUS-PM-SPRING-2025", - "label": "prometheus-pm-spring-2025", - "description": "", - "type": "datasource", - "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__elements": {}, - "__requires": [ - { - "type": "panel", - "id": "barchart", - "name": "Bar chart", - "version": "" - }, - { - "type": "panel", - "id": "bargauge", - "name": "Bar gauge", - "version": "" - }, - { - "type": "panel", - "id": "gauge", - "name": "Gauge", - "version": "" - }, - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "11.4.0" - }, - { - "type": "panel", - "id": "piechart", - "name": "Pie chart", - "version": "" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "timeseries", - "name": "Time series", - "version": "" - } - ], "annotations": { "list": [ { @@ -74,13 +19,13 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": null, + "id": 1, "links": [], "panels": [ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + "uid": "de96jy15v6qrkc" }, "description": "Visual representation of cache performance showing the hit and miss rates for screens.", "fieldConfig": { @@ -141,7 +86,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + "uid": "de96jy15v6qrkc" }, "disableTextWrap": false, "editorMode": "code", @@ -156,7 +101,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + "uid": "de96jy15v6qrkc" }, "disableTextWrap": false, "editorMode": "code", @@ -177,7 +122,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + "uid": "de96jy15v6qrkc" }, "description": "Visual representation of cache performance showing the hit and miss rates for settings.", "fieldConfig": { @@ -238,7 +183,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + "uid": "de96jy15v6qrkc" }, "disableTextWrap": false, "editorMode": "code", @@ -253,7 +198,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + "uid": "de96jy15v6qrkc" }, "disableTextWrap": false, "editorMode": "code", @@ -274,7 +219,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + "uid": "de96jy15v6qrkc" }, "description": "Visual representation of cache performance showing the hit and miss rates for screens.", "fieldConfig": { @@ -326,7 +271,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + "uid": "de96jy15v6qrkc" }, "disableTextWrap": false, "editorMode": "code", @@ -346,9 +291,9 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + "uid": "de96jy15v6qrkc" }, - "description": "Visual representation of cache performance showing the hit and miss rates for screens.", + "description": "Count the number of completed tasks by time", "fieldConfig": { "defaults": { "color": { @@ -360,17 +305,29 @@ "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", - "fillOpacity": 80, + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, + "insertNulls": false, + "lineInterpolation": "linear", "lineWidth": 1, + "pointSize": 5, "scaleDistribution": { "type": "linear" }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, "thresholdsStyle": { "mode": "off" } @@ -399,34 +356,25 @@ "y": 8 }, "id": 4, - "interval": "30m", + "interval": "5m", "options": { - "barRadius": 0, - "barWidth": 0.97, - "fullHighlight": false, - "groupWidth": 0.7, "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, - "orientation": "auto", - "showValue": "auto", - "stacking": "none", "tooltip": { "mode": "single", "sort": "none" - }, - "xTickLabelRotation": 0, - "xTickLabelSpacing": 0 + } }, "pluginVersion": "11.4.0", "targets": [ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + "uid": "de96jy15v6qrkc" }, "disableTextWrap": false, "editorMode": "code", @@ -440,12 +388,12 @@ } ], "title": "Tasks Completed", - "type": "barchart" + "type": "timeseries" }, { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + "uid": "de96jy15v6qrkc" }, "description": "Time a task was completed", "fieldConfig": { @@ -508,7 +456,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + "uid": "de96jy15v6qrkc" }, "disableTextWrap": false, "editorMode": "code", @@ -531,7 +479,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + "uid": "de96jy15v6qrkc" }, "description": "Top Slowest Tasks", "fieldConfig": { @@ -585,7 +533,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + "uid": "de96jy15v6qrkc" }, "disableTextWrap": false, "editorMode": "code", @@ -608,7 +556,123 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + "uid": "de96jy15v6qrkc" + }, + "description": "Average task time completition", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 6, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "dash": [ + 10, + 10 + ], + "fill": "dash" + }, + "lineWidth": 3, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "fieldMinMax": false, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 24 + }, + "id": 7, + "interval": "15s", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "de96jy15v6qrkc" + }, + "disableTextWrap": false, + "editorMode": "code", + "exemplar": false, + "expr": "avg(processmaker_activity_execution_time_seconds_sum{element_type=\"task\"})", + "format": "time_series", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": false, + "interval": "", + "legendFormat": "Average task time completion", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "Average Task Completion Time chart", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "de96jy15v6qrkc" }, "description": "Shows task completion distribution by activity and process to highlight execution patterns and identify key task volumes.", "fieldConfig": { @@ -635,7 +699,7 @@ "y": 24 }, "id": 8, - "interval": "30m", + "interval": "5m", "options": { "displayLabels": [ "percent" @@ -663,10 +727,10 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + "uid": "de96jy15v6qrkc" }, "disableTextWrap": false, - "editorMode": "code", + "editorMode": "builder", "exemplar": false, "expr": "sum(processmaker_activity_completed_total) by (activity_name, process_id)", "fullMetaSearch": false, @@ -684,54 +748,14 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + "uid": "de96jy15v6qrkc" }, - "description": "Average task time completition", + "description": "Time a task was completed", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 6, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "dash": [ - 10, - 10 - ], - "fill": "dash" - }, - "lineWidth": 3, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, "fieldMinMax": false, "mappings": [], "min": 0, @@ -756,61 +780,72 @@ "h": 8, "w": 12, "x": 0, - "y": 24 + "y": 32 }, - "id": 7, + "id": 9, "interval": "15s", "options": { + "displayMode": "gradient", "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, - "tooltip": { - "mode": "single", - "sort": "none" - } + "maxVizHeight": 300, + "minVizHeight": 16, + "minVizWidth": 8, + "namePlacement": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showUnfilled": true, + "sizing": "auto", + "valueMode": "color" }, "pluginVersion": "11.4.0", "targets": [ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + "uid": "de96jy15v6qrkc" }, "disableTextWrap": false, "editorMode": "code", "exemplar": false, - "expr": "avg(processmaker_activity_execution_time_seconds_sum{element_type=\"task\"})", + "expr": "avg without(activity_id) (processmaker_activity_execution_time_seconds_sum{element_type=\"scriptTask\"})", "format": "time_series", "fullMetaSearch": false, "includeNullMetadata": true, "instant": false, "interval": "", - "legendFormat": "Average task time completion", + "legendFormat": "{{activity_name}} (process={{process_id}})", "range": true, "refId": "A", "useBackend": false } ], - "title": "Average Task Completion Time chart", - "type": "timeseries" + "title": "Script Task Execution Time", + "type": "bargauge" } ], + "preload": false, "schemaVersion": 40, "tags": [], "templating": { "list": [] }, "time": { - "from": "now-24h", + "from": "now-6h", "to": "now" }, "timepicker": {}, "timezone": "browser", "title": "ProcessMaker Dashboard", "uid": "be96wxsnlmn7kc", - "version": 38, + "version": 41, "weekStart": "" } \ No newline at end of file