{ "__inputs": [ { "name": "DS_MYSQL", "label": "mysql", "description": "", "type": "datasource", "pluginId": "mysql", "pluginName": "MySQL" } ], "__elements": {}, "__requires": [ { "type": "panel", "id": "barchart", "name": "Bar chart", "version": "" }, { "type": "grafana", "id": "grafana", "name": "Grafana", "version": "11.6.3" }, { "type": "datasource", "id": "mysql", "name": "MySQL", "version": "11.6.3" } ], "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": 0, "id": null, "links": [], "panels": [ { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "fieldConfig": { "defaults": { "color": { "fixedColor": "red", "mode": "fixed" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "fillOpacity": 80, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineWidth": 1, "scaleDistribution": { "type": "linear" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "in_progress" }, "properties": [ { "id": "color", "value": { "mode": "palette-classic" } } ] }, { "matcher": { "id": "byName", "options": "success" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 7, "w": 24, "x": 0, "y": 0 }, "id": 3, "options": { "barRadius": 0, "barWidth": 0.94, "colorByField": "status", "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", "repeat": "organizational_unit", "repeatDirection": "h", "targets": [ { "dataset": "mysql", "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT \n ou.name AS organizational_unit,\n SUM(CASE WHEN trace.status = 'failed' THEN 1 ELSE 0 END) AS failed,\n SUM(CASE WHEN trace.status = 'in-progress' THEN 1 ELSE 0 END) AS in_progress,\n SUM(CASE WHEN trace.status = 'success' THEN 1 ELSE 0 END) AS success\nFROM trace\nJOIN client ON trace.client_id = client.id\nJOIN organizational_unit ou ON client.organizational_unit_id = ou.id\nWHERE ou.name IN (${organizational_unit:sqlstring})\nGROUP BY ou.name\nORDER BY ou.name;\n", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Estado de comandos: ${organizational_unit}", "type": "barchart" }, { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "fillOpacity": 80, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineWidth": 1, "scaleDistribution": { "type": "linear" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 7 }, "id": 2, "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": { "hideZeros": false, "mode": "single", "sort": "none" }, "xTickLabelRotation": 0, "xTickLabelSpacing": 0 }, "pluginVersion": "11.6.3", "targets": [ { "dataset": "mysql", "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT \n command,\n ROUND(AVG(TIMESTAMPDIFF(SECOND, executed_at, finished_at))) AS avg_seconds\nFROM trace\nWHERE finished_at IS NOT NULL\nGROUP BY command\nORDER BY avg_seconds DESC;\n", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Tiempo de media en segundos de la duración de los comandos", "type": "barchart" }, { "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "fieldConfig": { "defaults": { "color": { "fixedColor": "light-red", "mode": "fixed" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "fillOpacity": 80, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineWidth": 1, "scaleDistribution": { "type": "linear" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 7 }, "id": 4, "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": { "hideZeros": false, "mode": "single", "sort": "none" }, "xTickLabelRotation": 0, "xTickLabelSpacing": 0 }, "pluginVersion": "11.6.3", "targets": [ { "dataset": "mysql", "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT \n command,\n COUNT(*) AS total_failed\nFROM trace\nWHERE status = 'failed'\nGROUP BY command\nORDER BY total_failed DESC;\n", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Número de errores por tipo de comando", "type": "barchart" } ], "schemaVersion": 41, "tags": [], "templating": { "list": [ { "current": {}, "datasource": { "type": "mysql", "uid": "${DS_MYSQL}" }, "definition": "SELECT DISTINCT name FROM organizational_unit ORDER BY name", "description": "SELECT DISTINCT name FROM organizational_unit ORDER BY name", "includeAll": true, "label": "Unidad Organizativa", "multi": true, "name": "organizational_unit", "options": [], "query": "SELECT DISTINCT name FROM organizational_unit ORDER BY name", "refresh": 1, "regex": "", "type": "query" } ] }, "time": { "from": "now-6h", "to": "now" }, "timepicker": {}, "timezone": "browser", "title": "Traceo y comandos", "uid": "cehkmg691ogsge", "version": 2, "weekStart": "" }