diff --git a/extras/grafana_status_overview.json b/extras/grafana_status_overview.json index 0f9ff16f..9f38a439 100644 --- a/extras/grafana_status_overview.json +++ b/extras/grafana_status_overview.json @@ -1,4 +1,46 @@ { + "__inputs": [ + { + "name": "DS_PG", + "label": "pg", + "description": "", + "type": "datasource", + "pluginId": "grafana-postgresql-datasource", + "pluginName": "PostgreSQL" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana" + }, + { + "type": "datasource", + "id": "grafana-postgresql-datasource", + "name": "PostgreSQL", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], "annotations": { "list": [ { @@ -13,28 +55,45 @@ ] }, "editable": true, - "gnetId": null, + "fiscalYearStartMonth": 0, "graphTooltip": 0, "id": null, "links": [], + "liveNow": false, "panels": [ { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": null, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] }, "gridPos": { "h": 4, @@ -42,52 +101,33 @@ "x": 0, "y": 0 }, - "id": 7, - "interval": null, + "id": 4, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "pluginVersion": "6.6.1", - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false, - "ymax": null, - "ymin": null + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto", + "wideLayout": true }, - "tableColumn": "", + "pluginVersion": "10.2.3", "targets": [ { + "editorMode": "code", "format": "time_series", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n 0 as time,\n count(*)\nFROM\n timetable.task\n JOIN\n timetable.chain USING (task_id)\nWHERE\n run_at IS NOT NULL\n\n", + "rawSql": "SELECT\n 0 as time,\n count(*)\nFROM\n timetable.chain\n\n", "refId": "A", "select": [ [ @@ -99,6 +139,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "timeColumn": "time", "where": [ { @@ -109,38 +166,32 @@ ] } ], - "thresholds": "", - "timeFrom": null, - "timeShift": null, - "title": "Recurring Task Chains (Cron)", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - } - ], - "valueName": "avg" + "title": "Total Chains", + "type": "stat" }, { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": null, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_PG}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "fixed" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [] }, "gridPos": { "h": 4, @@ -148,52 +199,33 @@ "x": 4, "y": 0 }, - "id": 4, - "interval": null, + "id": 7, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "pluginVersion": "6.6.1", - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false, - "ymax": null, - "ymin": null + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto", + "wideLayout": true }, - "tableColumn": "", + "pluginVersion": "10.2.3", "targets": [ { + "editorMode": "code", "format": "time_series", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n 0 as time,\n count(*)\nFROM\n timetable.task\n\n", + "rawSql": "SELECT\n 0 as time,\n count(*)\nFROM\n timetable.chain\nWHERE\n live and client_name ISNULL or client_name in ($client) ", "refId": "A", "select": [ [ @@ -205,6 +237,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "timeColumn": "time", "where": [ { @@ -212,42 +261,54 @@ "params": [], "type": "macro" } - ] - } - ], - "thresholds": "", - "timeFrom": null, - "timeShift": null, - "title": "Total Task Chains", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" + ], + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_PG}" + } } ], - "valueName": "avg" + "title": "Enabled Chains", + "type": "stat" }, { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": null, - "description": "Based on \"execution_log\"", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_PG}" + }, + "description": "How many tasks executed during selected interval", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] }, "gridPos": { "h": 4, @@ -256,51 +317,32 @@ "y": 0 }, "id": 5, - "interval": null, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "pluginVersion": "6.6.1", - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false, - "ymax": null, - "ymin": null + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto", + "wideLayout": true }, - "tableColumn": "", + "pluginVersion": "10.2.3", "targets": [ { + "editorMode": "code", "format": "time_series", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n 0 as time,\n count(*)\nFROM\n timetable.execution_log\nWHERE\n $__timeFilter(last_run)", + "rawSql": "SELECT\n 0 as time,\n count(*)\nFROM\n timetable.execution_log\nWHERE\n $__timeFilter(last_run) and client_name in ($client) ", "refId": "A", "select": [ [ @@ -312,6 +354,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "timeColumn": "time", "where": [ { @@ -319,42 +378,58 @@ "params": [], "type": "macro" } - ] - } - ], - "thresholds": "", - "timeFrom": null, - "timeShift": null, - "title": "Total task executions (selected interval)", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" + ], + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_PG}" + } } ], - "valueName": "avg" + "title": "Total task executions", + "type": "stat" }, { - "cacheTimeout": null, - "colorBackground": true, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": null, - "description": "execution_log.retcode != 0", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_PG}" + }, + "description": "How many tasks failed during selected interval", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#299c46", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 1 + }, + { + "color": "#d44a3a", + "value": 10 + } + ] + }, + "unit": "none" + }, + "overrides": [] }, "gridPos": { "h": 4, @@ -363,51 +438,32 @@ "y": 0 }, "id": 6, - "interval": null, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "pluginVersion": "6.6.1", - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false, - "ymax": null, - "ymin": null + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto", + "wideLayout": true }, - "tableColumn": "", + "pluginVersion": "10.2.3", "targets": [ { + "editorMode": "code", "format": "time_series", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n 0 as time,\n count(*)\nFROM\n timetable.execution_log\nWHERE\n $__timeFilter(last_run)\n AND returncode != 0", + "rawSql": "SELECT\n 0 as time,\n count(*)\nFROM\n timetable.execution_log\nWHERE\n $__timeFilter(last_run)\n AND returncode != 0 AND NOT COALESCE(ignore_error, false) AND client_name in ($client) ", "refId": "A", "select": [ [ @@ -419,6 +475,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "timeColumn": "time", "where": [ { @@ -426,42 +499,54 @@ "params": [], "type": "macro" } - ] - } - ], - "thresholds": "0,5", - "timeFrom": null, - "timeShift": null, - "title": "Total task executions errors (selected interval)", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" + ], + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_PG}" + } } ], - "valueName": "avg" + "title": "Total task errors", + "type": "stat" }, { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": null, - "description": "NB! For successful executions!", - "format": "s", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_PG}" + }, + "description": "Average duration of successful tasks during selected interval", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] }, "gridPos": { "h": 4, @@ -470,51 +555,32 @@ "y": 0 }, "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, - "options": {}, - "pluginVersion": "6.6.1", - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false, - "ymax": null, - "ymin": null + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto", + "wideLayout": true }, - "tableColumn": "", + "pluginVersion": "10.2.3", "targets": [ { + "editorMode": "code", "format": "time_series", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n 0 as time,\n avg(extract(epoch from finished - last_run))\nFROM\n timetable.execution_log\nWHERE\n $__timeFilter(last_run)\n AND returncode = 0", + "rawSql": "SELECT\n 0 as time,\n avg(extract(epoch from finished - last_run))\nFROM\n timetable.execution_log\nWHERE\n $__timeFilter(last_run)\n AND returncode = 0\n AND client_name in ($client) ", "refId": "A", "select": [ [ @@ -526,6 +592,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "timeColumn": "time", "where": [ { @@ -533,42 +616,53 @@ "params": [], "type": "macro" } - ] - } - ], - "thresholds": "", - "timeFrom": null, - "timeShift": null, - "title": "Avg. execution duration (selected interval)", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" + ], + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_PG}" + } } ], - "valueName": "avg" + "title": "Avg. task duration", + "type": "stat" }, { - "cacheTimeout": null, - "colorBackground": true, - "colorValue": false, - "colors": [ - "#d44a3a", - "#37872D", - "#299c46" - ], - "datasource": null, "description": "", - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "0": { + "index": 0, + "text": "NOT RUNNING" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#d44a3a", + "value": null + }, + { + "color": "#37872D", + "value": 1 + }, + { + "color": "#299c46" + } + ] + }, + "unit": "none" + }, + "overrides": [] }, "gridPos": { "h": 4, @@ -577,51 +671,32 @@ "y": 0 }, "id": 9, - "interval": null, "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 - }, - { - "name": "range to text", - "value": 2 - } - ], "maxDataPoints": 100, - "nullPointMode": "connected", - "nullText": null, - "options": {}, - "pluginVersion": "6.6.1", - "postfix": "", - "postfixFontSize": "50%", - "prefix": "", - "prefixFontSize": "50%", - "rangeMaps": [ - { - "from": "null", - "text": "N/A", - "to": "null" - } - ], - "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", - "full": false, - "lineColor": "rgb(31, 120, 193)", - "show": false, - "ymax": null, - "ymin": null + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "textMode": "auto", + "wideLayout": true }, - "tableColumn": "", + "pluginVersion": "10.2.3", "targets": [ { + "editorMode": "code", "format": "time_series", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n 0 as time,\n case when count(*) > 0 then 1 else 0 end\nfrom\n timetable.log\nwhere\n ts > now() - '1min'::interval\n", + "rawSql": "SELECT\n 0 as time,\n count(DISTINCT client_name)\nfrom\n timetable.active_session\n\n", "refId": "A", "select": [ [ @@ -633,6 +708,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "timeColumn": "time", "where": [ { @@ -643,82 +735,129 @@ ] } ], - "thresholds": "1", - "timeFrom": null, - "timeShift": null, - "title": "Scheduler running", - "type": "singlestat", - "valueFontSize": "80%", - "valueMaps": [ - { - "op": "=", - "text": "N/A", - "value": "null" - }, - { - "op": "=", - "text": "OK", - "value": "1" - }, - { - "op": "=", - "text": "NOT RUNNING", - "value": "0" - } - ], - "valueName": "avg" + "title": "Schedulers running", + "type": "stat" }, { - "aliasColors": { - "errors": "semi-dark-red" + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_PG}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 75, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 0, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "errors" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "ignored" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "yellow", + "mode": "fixed" + } + } + ] + } + ] }, - "bars": true, - "dashLength": 10, - "dashes": false, - "datasource": null, - "decimals": 0, - "fill": 1, - "fillGradient": 0, "gridPos": { "h": 11, "w": 24, "x": 0, "y": 4 }, - "hiddenSeries": false, + "hideTimeOverride": false, "id": 2, - "interval": "5m", - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": false, - "linewidth": 1, - "nullPointMode": "null", + "interval": "1m", "options": { - "dataLinks": [] + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, + "pluginVersion": "10.2.3", "targets": [ { + "editorMode": "code", "format": "time_series", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n $__timeGroup(last_run, $__interval),\n count(*) as total\nFROM\n timetable.execution_log\nWHERE\n $__timeFilter(last_run)\nGROUP by\n 1\n", + "rawSql": "SELECT\n date_trunc('minute', finished) as time,\n count(*) as total,\n count(*) FILTER (WHERE returncode != 0 AND NOT COALESCE(ignore_error, false)) as errors,\n count(*) FILTER (WHERE returncode != 0 AND ignore_error) as \"ignored errors\"\nFROM\n timetable.execution_log\nWHERE\n $__timeFilter(finished) AND client_name in ($client) \nGROUP by\n 1\n", "refId": "A", "select": [ [ @@ -730,32 +869,23 @@ } ] ], - "timeColumn": "time", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - }, - { - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n $__timeGroup(last_run, $__interval),\n count(*) as errors\nFROM\n timetable.execution_log\nWHERE\n $__timeFilter(last_run)\n AND returncode != 0\nGROUP by\n 1\n", - "refId": "B", - "select": [ - [ + "sql": { + "columns": [ { - "params": [ - "value" - ], - "type": "column" + "parameters": [], + "type": "function" } - ] - ], + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "timeColumn": "time", "where": [ { @@ -763,56 +893,78 @@ "params": [], "type": "macro" } - ] + ], + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_PG}" + } } ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, "title": "Task executions (total vs error, selected interval)", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": false - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } + "type": "timeseries" }, { - "columns": [], - "datasource": null, "description": "execution_log.returncode != 0", - "fontSize": "100%", + "fieldConfig": { + "defaults": { + "color": { + "mode": "fixed" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false, + "minWidth": 50 + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "finished_ago" + }, + "properties": [ + { + "id": "unit", + "value": "s" + }, + { + "id": "custom.align", + "value": "center" + }, + { + "id": "custom.width", + "value": 100 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "output" + }, + "properties": [ + { + "id": "custom.minWidth", + "value": 400 + } + ] + } + ] + }, "gridPos": { "h": 12, "w": 24, @@ -820,29 +972,28 @@ "y": 15 }, "id": 10, - "options": {}, - "pageSize": null, - "showHeader": true, - "sort": { - "col": 0, - "desc": false + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true }, - "styles": [ - { - "alias": "Time", - "align": "auto", - "dateFormat": "YYYY-MM-DD HH:mm:ss", - "pattern": "Time", - "type": "date" - } - ], + "pluginVersion": "10.2.3", "targets": [ { + "editorMode": "code", "format": "table", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n -- $__timeGroup(last_run, $__interval),\n -- 0 as time,\n extract(epoch from now() - finished)::int as finished_seconds_ago,\n last_run as started_on,\n task_id::text,\n returncode,\n output\nFROM\n timetable.execution_log\nWHERE\n $__timeFilter(last_run)\n AND returncode != 0\nORDER BY\n finished DESC\nLIMIT\n 10\n ", + "rawSql": "SELECT\n -- $__timeGroup(last_run, $__interval),\n -- 0 as time,\n extract(epoch from now() - finished)::int as finished_ago,\n last_run as started_on,\n client_name,\n chain_id,\n task_id,\n command,\n returncode,\n output\nFROM\n timetable.execution_log\nWHERE\n $__timeFilter(last_run)\n AND returncode != 0 AND NOT ignore_error\nORDER BY\n finished DESC\nLIMIT\n 50\n ", "refId": "A", "select": [ [ @@ -854,6 +1005,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "timeColumn": "time", "where": [ { @@ -864,22 +1032,47 @@ ] } ], - "timeFrom": null, - "timeShift": null, "title": "Task executions errors (selected interval)", - "transform": "table", + "transformations": [ + { + "id": "merge", + "options": { + "reducers": [] + } + } + ], "type": "table" } ], "refresh": "1m", - "schemaVersion": 22, - "style": "dark", + "schemaVersion": 39, "tags": [], "templating": { - "list": [] + "list": [ + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_PG}" + }, + "definition": "SELECT DISTINCT(l.client_name) FROM timetable.log l ", + "hide": 0, + "includeAll": true, + "label": "Client name", + "multi": false, + "name": "client", + "options": [], + "query": "SELECT DISTINCT(l.client_name) FROM timetable.log l ", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] }, "time": { - "from": "now-3h", + "from": "now-1h", "to": "now" }, "timepicker": { @@ -898,6 +1091,7 @@ }, "timezone": "", "title": "Timetable overview", - "uid": null, - "version": 1 + "uid": "e330845d-5ed4-46fd-b85e-cea7f524c176", + "version": 15, + "weekStart": "" } \ No newline at end of file