From 6b69af2c559ca23f2bee9061fa51156f061ac911 Mon Sep 17 00:00:00 2001 From: abeizn Date: Fri, 19 Jan 2024 16:52:15 +0800 Subject: [PATCH 1/4] fix: azure,bamboo,github,jira distinct primary key --- grafana/dashboards/AzureDevOps.json | 99 ++++++++--- grafana/dashboards/Bamboo.json | 47 +++-- grafana/dashboards/GitHub.json | 187 +++++++++++++------- grafana/dashboards/Jira.json | 260 +++++++++++++++++++++------- 4 files changed, 435 insertions(+), 158 deletions(-) diff --git a/grafana/dashboards/AzureDevOps.json b/grafana/dashboards/AzureDevOps.json index 029f4e1d7ae..fdde27c92c9 100644 --- a/grafana/dashboards/AzureDevOps.json +++ b/grafana/dashboards/AzureDevOps.json @@ -18,7 +18,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 46, + "id": 7, "links": [], "liveNow": false, "panels": [ @@ -50,7 +50,7 @@ "content": "- Use Cases: This dashboard shows the basic Git and Code Review metrics from Azure DevOps.\n- Data Source Required: Azure DevOps", "mode": "markdown" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": { @@ -144,16 +144,17 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", + "editorMode": "code", "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "select\n\tcount(*) as pull_request_count\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in ($repo_id)\n\t\n\n", + "rawSql": "select\n\tcount(distinct pr.id) as pull_request_count\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in ($repo_id)\n\t\n\n", "refId": "A", "select": [ [ @@ -165,6 +166,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -274,7 +292,7 @@ "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n count(*) as pr_count\n FROM pull_requests\n WHERE\n base_repo_id in ($repo_id)\n and $__timeFilter(created_date)\n and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n pr_count as \"Pull Request Count\"\nFROM _prs\nORDER BY time\n", + "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n count(distinct id) as pr_count\n FROM pull_requests\n WHERE\n base_repo_id in ($repo_id)\n and $__timeFilter(created_date)\n and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n pr_count as \"Pull Request Count\"\nFROM _prs\nORDER BY time\n", "refId": "A", "select": [ [ @@ -407,12 +425,13 @@ "targets": [ { "datasource": "mysql", + "editorMode": "code", "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nselect\n author_name,\n\tcount(*) as merged_pull_request_count\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in ($repo_id)\n\tand pr.status = 'MERGED'\ngroup by 1\norder by 2 desc\nlimit 20\n", + "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nselect\n author_name,\n\tcount(distinct pr.id) as merged_pull_request_count\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in ($repo_id)\n\tand pr.status = 'MERGED'\ngroup by 1\norder by 2 desc\nlimit 20\n", "refId": "A", "select": [ [ @@ -424,6 +443,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -518,7 +554,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", @@ -723,16 +759,17 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", + "editorMode": "code", "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nselect\n\tcount(*) as merged_pull_request_count\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in ($repo_id)\n\tand pr.status = 'CLOSED'", + "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nselect\n\tcount(distinct pr.id) as merged_pull_request_count\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in ($repo_id)\n\tand pr.status = 'CLOSED'", "refId": "A", "select": [ [ @@ -744,6 +781,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -932,7 +986,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", @@ -1109,7 +1163,7 @@ "content": "
\n\nThis dashboard is created based on this [data schema](https://devlake.apache.org/docs/DataModels/DevLakeDomainLayerSchema). Want to add more metrics? Please follow the [guide](https://devlake.apache.org/docs/Configuration/Dashboards/GrafanaUserGuide).", "mode": "markdown" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": { @@ -1182,7 +1236,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", @@ -1191,7 +1245,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n count(*)\nFROM \n cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and id like \"%azure%\"\n and cicd_scope_id in ($repo_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", + "rawSql": "SELECT\n count(distinct id)\nFROM \n cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and id like \"%azure%\"\n and cicd_scope_id in ($repo_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", "refId": "A", "select": [ [ @@ -1285,7 +1339,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", @@ -1294,7 +1348,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n 1.0 * count(case when result = 'SUCCESS' then 1 else null end)/count(*)\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%azure%\"\n and cicd_scope_id in ($repo_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", + "rawSql": "SELECT\n 1.0 * count(case when result = 'SUCCESS' then id else null end)/count(distinct id)\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%azure%\"\n and cicd_scope_id in ($repo_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", "refId": "A", "select": [ [ @@ -1481,7 +1535,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n result,\n count(*) as build_count\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%azure%\"\n and cicd_scope_id in ($repo_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\nGROUP BY 1\nORDER BY 2 desc", + "rawSql": "SELECT\n result,\n count(distinct id) as build_count\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%azure%\"\n and cicd_scope_id in ($repo_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\nGROUP BY 1\nORDER BY 2 desc", "refId": "A", "select": [ [ @@ -1573,7 +1627,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", @@ -1720,7 +1774,7 @@ "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "WITH _builds as(\n SELECT\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\n count(*) as build_count\n FROM cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and id like \"%azure%\"\n and cicd_scope_id in ($repo_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n GROUP BY 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n build_count as \"Pipeline runs Count\"\nFROM _builds\nORDER BY time\n", + "rawSql": "WITH _builds as(\n SELECT\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\n count(distinct id) as build_count\n FROM cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and id like \"%azure%\"\n and cicd_scope_id in ($repo_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n GROUP BY 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n build_count as \"Pipeline runs Count\"\nFROM _builds\nORDER BY time\n", "refId": "A", "select": [ [ @@ -1877,7 +1931,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "WITH _build_success_rate as(\r\n SELECT\r\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\r\n result\r\n FROM\r\n cicd_pipelines\r\n WHERE\r\n $__timeFilter(finished_date)\r\n and id like \"%azure%\"\r\n and cicd_scope_id in ($repo_id)\r\n -- the following condition will remove the month with incomplete data\r\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\r\n)\r\n\r\nSELECT \r\n date_format(time,'%M %Y') as month,\r\n 1.0 * sum(case when result = 'SUCCESS' then 1 else 0 end)/ count(*) as \"Pipeline runs Success Rate\"\r\nFROM _build_success_rate\r\nGROUP BY time\r\nORDER BY time", + "rawSql": "WITH _build_success_rate as(\r\n SELECT\r\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\r\n result,\r\n id\r\n FROM\r\n cicd_pipelines\r\n WHERE\r\n $__timeFilter(finished_date)\r\n and id like \"%azure%\"\r\n and cicd_scope_id in ($repo_id)\r\n -- the following condition will remove the month with incomplete data\r\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\r\n GROUP BY \r\n time, result, id\r\n)\r\n\r\nSELECT \r\n date_format(time,'%M %Y') as month,\r\n 1.0 * sum(case when result = 'SUCCESS' then 1 else 0 end)/ count(*) as \"Pipeline runs Success Rate\"\r\nFROM _build_success_rate\r\nGROUP BY time\r\nORDER BY time", "refId": "A", "select": [ [ @@ -2095,7 +2149,10 @@ "$__all" ] }, - "datasource": "mysql", + "datasource": { + "type": "mysql", + "uid": "P430005175C4C7810" + }, "definition": "select concat(name, '--', id) as text from repos where id like 'azure%'", "hide": 0, "includeAll": true, @@ -2120,6 +2177,6 @@ "timezone": "", "title": "Azure DevOps", "uid": "ba7e3a95-80ed-4067-a54b-2a82758eb3dd", - "version": 4, + "version": 3, "weekStart": "" } \ No newline at end of file diff --git a/grafana/dashboards/Bamboo.json b/grafana/dashboards/Bamboo.json index 5993bffe08a..131d418938b 100644 --- a/grafana/dashboards/Bamboo.json +++ b/grafana/dashboards/Bamboo.json @@ -18,7 +18,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 5, + "id": 12, "links": [], "liveNow": false, "panels": [ @@ -50,7 +50,7 @@ "content": "- Use Cases: This dashboard shows the basic CI/CD metrics from Bamboo, such as [Build Count](https://devlake.apache.org/docs/Metrics/BuildCount), [Build Duration](https://devlake.apache.org/docs/Metrics/BuildDuration) and [Build Success Rate](https://devlake.apache.org/docs/Metrics/BuildSuccessRate). A build in Bamboo is an execution of a Bamboo Plan.\n- Data Source Required: Bamboo", "mode": "markdown" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": { @@ -111,7 +111,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", @@ -120,7 +120,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n count(*)\nFROM \n cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and id like \"%bamboo%\"\n and cicd_scope_id in ($plan_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", + "rawSql": "SELECT\n count(distinct id)\nFROM \n cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and id like \"%bamboo%\"\n and cicd_scope_id in ($plan_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", "refId": "A", "select": [ [ @@ -214,7 +214,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", @@ -223,7 +223,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n 1.0 * count(case when result = 'SUCCESS' then 1 else null end)/count(*)\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%bamboo%\"\n and cicd_scope_id in ($plan_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", + "rawSql": "SELECT\n 1.0 * count(case when result = 'SUCCESS' then id else null end)/count(distinct id)\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%bamboo%\"\n and cicd_scope_id in ($plan_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", "refId": "A", "select": [ [ @@ -410,7 +410,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n result,\n count(*) as build_count\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%bamboo%\"\n and cicd_scope_id in ($plan_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\nGROUP BY 1\nORDER BY 2 desc", + "rawSql": "SELECT\n result,\n count(distinct id) as build_count\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%bamboo%\"\n and cicd_scope_id in ($plan_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\nGROUP BY 1\nORDER BY 2 desc", "refId": "A", "select": [ [ @@ -502,7 +502,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", @@ -649,7 +649,7 @@ "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "WITH _builds as(\n SELECT\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\n count(*) as build_count\n FROM cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and id like \"%bamboo%\"\n and cicd_scope_id in ($plan_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n GROUP BY 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n build_count as \"Build Count\"\nFROM _builds\nORDER BY time\n", + "rawSql": "WITH _builds as(\n SELECT\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\n count(distinct id) as build_count\n FROM cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and id like \"%bamboo%\"\n and cicd_scope_id in ($plan_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n GROUP BY 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n build_count as \"Build Count\"\nFROM _builds\nORDER BY time\n", "refId": "A", "select": [ [ @@ -801,11 +801,12 @@ "targets": [ { "datasource": "mysql", + "editorMode": "code", "format": "table", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "WITH _build_success_rate as(\r\n SELECT\r\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\r\n result\r\n FROM\r\n cicd_pipelines\r\n WHERE\r\n $__timeFilter(finished_date)\r\n and id like \"%bamboo%\"\r\n and cicd_scope_id in ($plan_id)\r\n -- the following condition will remove the month with incomplete data\r\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\r\n)\r\n\r\nSELECT \r\n date_format(time,'%M %Y') as month,\r\n 1.0 * sum(case when result = 'SUCCESS' then 1 else 0 end)/ count(*) as \"Build Success Rate\"\r\nFROM _build_success_rate\r\nGROUP BY time\r\nORDER BY time", + "rawSql": "WITH _build_success_rate as(\r\n SELECT\r\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\r\n result,\r\n id\r\n FROM\r\n cicd_pipelines\r\n WHERE\r\n $__timeFilter(finished_date)\r\n and id like \"%bamboo%\"\r\n and cicd_scope_id in ($plan_id)\r\n -- the following condition will remove the month with incomplete data\r\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\r\n GROUP BY\r\n time, result, id\r\n)\r\n\r\nSELECT \r\n date_format(time,'%M %Y') as month,\r\n 1.0 * sum(case when result = 'SUCCESS' then 1 else 0 end)/ count(*) as \"Build Success Rate\"\r\nFROM _build_success_rate\r\nGROUP BY time\r\nORDER BY time", "refId": "A", "select": [ [ @@ -817,6 +818,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ca_analysis", "timeColumn": "create_time", "timeColumnType": "timestamp", @@ -1139,7 +1157,7 @@ "content": "
\n\nThis dashboard is created based on this [data schema](https://devlake.apache.org/docs/DataModels/DevLakeDomainLayerSchema). Want to add more metrics? Please follow the [guide](https://devlake.apache.org/docs/Configuration/Dashboards/GrafanaUserGuide).", "mode": "markdown" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": { @@ -1171,7 +1189,10 @@ "$__all" ] }, - "datasource": "mysql", + "datasource": { + "type": "mysql", + "uid": "P430005175C4C7810" + }, "definition": "select concat(name, '--', id) as text from cicd_scopes where id like \"bamboo%\" ", "hide": 0, "includeAll": true, @@ -1196,6 +1217,6 @@ "timezone": "", "title": "Bamboo", "uid": "a90e58d9-7acc-4858-aa77-f606d11a7d4a", - "version": 3, + "version": 2, "weekStart": "" } \ No newline at end of file diff --git a/grafana/dashboards/GitHub.json b/grafana/dashboards/GitHub.json index a5c819bd514..6e4a65b7267 100644 --- a/grafana/dashboards/GitHub.json +++ b/grafana/dashboards/GitHub.json @@ -18,7 +18,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 27, + "id": 14, "links": [], "liveNow": false, "panels": [ @@ -50,7 +50,7 @@ "content": "- Use Cases: This dashboard shows the basic Git and Code Review metrics from GitHub.\n- Data Source Required: GitHub", "mode": "markdown" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": { @@ -144,7 +144,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", @@ -382,7 +382,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", @@ -607,7 +607,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", @@ -797,8 +797,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -916,8 +915,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1041,7 +1039,7 @@ "showHeader": true, "sortBy": [] }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", @@ -1116,8 +1114,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1157,16 +1154,17 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", + "editorMode": "code", "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "select\n\tcount(*) as pull_request_count\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in ($repo_id)\n\t\n\n", + "rawSql": "select\n\tcount(distinct pr.id) as pull_request_count\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in ($repo_id)\n\t\n\n", "refId": "A", "select": [ [ @@ -1178,6 +1176,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -1227,8 +1242,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1281,12 +1295,13 @@ "targets": [ { "datasource": "mysql", + "editorMode": "code", "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n count(*) as pr_count\n FROM pull_requests\n WHERE\n base_repo_id in ($repo_id)\n and $__timeFilter(created_date)\n and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n pr_count as \"Pull Request Count\"\nFROM _prs\nORDER BY time\n", + "rawSql": "with _prs as(\n SELECT\n DATE_ADD(date(created_date), INTERVAL -DAY(date(created_date))+1 DAY) as time,\n count(distinct id) as pr_count\n FROM pull_requests\n WHERE\n base_repo_id in ($repo_id)\n and $__timeFilter(created_date)\n and created_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n group by 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n pr_count as \"Pull Request Count\"\nFROM _prs\nORDER BY time\n", "refId": "A", "select": [ [ @@ -1298,6 +1313,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -1347,8 +1379,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1402,12 +1433,13 @@ "targets": [ { "datasource": "mysql", + "editorMode": "code", "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nselect\n author_name,\n\tcount(*) as merged_pull_request_count\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in ($repo_id)\n and pr.status = 'MERGED'\ngroup by 1\norder by 2 desc\nlimit 20\n", + "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nselect\n author_name,\n\tcount(distinct pr.id) as merged_pull_request_count\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in ($repo_id)\n and pr.status = 'MERGED'\ngroup by 1\norder by 2 desc\nlimit 20\n", "refId": "A", "select": [ [ @@ -1419,6 +1451,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -1473,8 +1522,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1513,7 +1561,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", @@ -1592,8 +1640,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" } ] } @@ -1677,8 +1724,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1718,16 +1764,17 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", + "editorMode": "code", "format": "table", "group": [], "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nselect\n\tcount(*) as merged_pull_request_count\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in ($repo_id)\n\tand pr.status = 'CLOSED'", + "rawSql": "-- The PR/MR statuses are standardized to DevLake's statuses 'OPEN', 'MERGED' and 'CLOSED'. You can check out the original status from the field `original_status`\nselect\n\tcount(distinct pr.id) as merged_pull_request_count\nfrom \n\tpull_requests pr\nwhere\n $__timeFilter(created_date)\n\tand base_repo_id in ($repo_id)\n\tand pr.status = 'CLOSED'", "refId": "A", "select": [ [ @@ -1739,6 +1786,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ae_projects", "timeColumn": "ae_create_time", "timeColumnType": "timestamp", @@ -1800,8 +1864,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" } ] }, @@ -1884,8 +1947,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1925,7 +1987,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", @@ -1995,8 +2057,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -2094,8 +2155,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -2133,7 +2193,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", @@ -2203,8 +2263,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -2312,8 +2371,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" } ] } @@ -2349,7 +2407,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", @@ -2358,7 +2416,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n count(*)\nFROM \n cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and id like \"%github%\"\n and cicd_scope_id in ($repo_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", + "rawSql": "SELECT\n count(distinct id)\nFROM \n cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and id like \"%github%\"\n and cicd_scope_id in ($repo_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", "refId": "A", "select": [ [ @@ -2414,8 +2472,7 @@ "mode": "absolute", "steps": [ { - "color": "blue", - "value": null + "color": "blue" } ] }, @@ -2452,7 +2509,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", @@ -2461,7 +2518,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n 1.0 * count(case when result = 'SUCCESS' then 1 else null end)/count(*)\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%github%\"\n and cicd_scope_id in ($repo_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", + "rawSql": "SELECT\n 1.0 * count(case when result = 'SUCCESS' then id else null end)/count(distinct id)\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%github%\"\n and cicd_scope_id in ($repo_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)", "refId": "A", "select": [ [ @@ -2648,7 +2705,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n result,\n count(*) as build_count\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%github%\"\n and cicd_scope_id in ($repo_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\nGROUP BY 1\nORDER BY 2 desc", + "rawSql": "SELECT\n result,\n count(distinct id) as build_count\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%github%\"\n and cicd_scope_id in ($repo_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\nGROUP BY 1\nORDER BY 2 desc", "refId": "A", "select": [ [ @@ -2704,8 +2761,7 @@ "mode": "absolute", "steps": [ { - "color": "light-orange", - "value": null + "color": "light-orange" } ] }, @@ -2740,7 +2796,7 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": "mysql", @@ -2827,8 +2883,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -2887,7 +2942,7 @@ "hide": false, "metricColumn": "none", "rawQuery": true, - "rawSql": "WITH _builds as(\n SELECT\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\n count(*) as build_count\n FROM cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and id like \"%github%\"\n and cicd_scope_id in ($repo_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n GROUP BY 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n build_count as \"Workflow Runs Count\"\nFROM _builds\nORDER BY time\n", + "rawSql": "WITH _builds as(\n SELECT\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\n count(distinct id) as build_count\n FROM cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n and result = 'SUCCESS'\n and id like \"%github%\"\n and cicd_scope_id in ($repo_id)\n -- the following condition will remove the month with incomplete data\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\n GROUP BY 1\n)\n\nSELECT \n date_format(time,'%M %Y') as month,\n build_count as \"Workflow Runs Count\"\nFROM _builds\nORDER BY time\n", "refId": "A", "select": [ [ @@ -2965,8 +3020,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -3044,7 +3098,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "WITH _build_success_rate as(\r\n SELECT\r\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\r\n result\r\n FROM\r\n cicd_pipelines\r\n WHERE\r\n $__timeFilter(finished_date)\r\n and id like \"%github%\"\r\n and cicd_scope_id in ($repo_id)\r\n -- the following condition will remove the month with incomplete data\r\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\r\n)\r\n\r\nSELECT \r\n date_format(time,'%M %Y') as month,\r\n 1.0 * sum(case when result = 'SUCCESS' then 1 else 0 end)/ count(*) as \"Workflow Runs Success Rate\"\r\nFROM _build_success_rate\r\nGROUP BY time\r\nORDER BY time", + "rawSql": "WITH _build_success_rate as(\r\n SELECT\r\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\r\n result,\r\n id\r\n FROM\r\n cicd_pipelines\r\n WHERE\r\n $__timeFilter(finished_date)\r\n and id like \"%github%\"\r\n and cicd_scope_id in ($repo_id)\r\n -- the following condition will remove the month with incomplete data\r\n and finished_date >= DATE_ADD(DATE_ADD($__timeFrom(), INTERVAL -DAY($__timeFrom())+1 DAY), INTERVAL +1 MONTH)\r\n GROUP BY \r\n time, result, id\r\n)\r\n\r\nSELECT \r\n date_format(time,'%M %Y') as month,\r\n 1.0 * sum(case when result = 'SUCCESS' then 1 else 0 end)/ count(*) as \"Workflow Runs Success Rate\"\r\nFROM _build_success_rate\r\nGROUP BY time\r\nORDER BY time", "refId": "A", "select": [ [ @@ -3131,8 +3185,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -3290,8 +3343,7 @@ "mode": "absolute", "steps": [ { - "color": "purple", - "value": null + "color": "purple" }, { "color": "red", @@ -3431,7 +3483,7 @@ "content": "
\n\nThis dashboard is created based on this [data schema](https://devlake.apache.org/docs/DataModels/DevLakeDomainLayerSchema). Want to add more metrics? Please follow the [guide](https://devlake.apache.org/docs/Configuration/Dashboards/GrafanaUserGuide).", "mode": "markdown" }, - "pluginVersion": "9.5.2", + "pluginVersion": "9.5.15", "targets": [ { "datasource": { @@ -3464,7 +3516,10 @@ "$__all" ] }, - "datasource": "mysql", + "datasource": { + "type": "mysql", + "uid": "P430005175C4C7810" + }, "definition": "select concat(name, '--', id) as text from repos where id like 'github%'", "hide": 0, "includeAll": true, @@ -3489,6 +3544,6 @@ "timezone": "", "title": "GitHub", "uid": "KXWvOFQnz", - "version": 3, + "version": 9, "weekStart": "" } \ No newline at end of file diff --git a/grafana/dashboards/Jira.json b/grafana/dashboards/Jira.json index da4b0768ca9..c276c08e577 100644 --- a/grafana/dashboards/Jira.json +++ b/grafana/dashboards/Jira.json @@ -3,7 +3,10 @@ "list": [ { "builtIn": 1, - "datasource": "-- Grafana --", + "datasource": { + "type": "datasource", + "uid": "grafana" + }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", @@ -13,10 +16,9 @@ ] }, "editable": true, - "gnetId": null, + "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 14, - "iteration": 1682063040196, + "id": 26, "links": [ { "asDropdown": false, @@ -45,9 +47,13 @@ "url": "" } ], + "liveNow": false, "panels": [ { - "datasource": null, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, "gridPos": { "h": 3, "w": 13, @@ -63,12 +69,21 @@ } ], "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, "content": "- Use Cases: This dashboard shows the basic project management metrics from Jira.\n- Data Source Required: Jira", "mode": "markdown" }, - "pluginVersion": "8.0.6", + "pluginVersion": "9.5.15", "targets": [ { + "datasource": { + "type": "datasource", + "uid": "grafana" + }, "queryType": "randomWalk", "refId": "A" } @@ -77,7 +92,10 @@ "type": "text" }, { - "datasource": null, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, "gridPos": { "h": 1, "w": 24, @@ -85,6 +103,15 @@ "y": 3 }, "id": 126, + "targets": [ + { + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "refId": "A" + } + ], "title": "1. Issue Throughput", "type": "row" }, @@ -138,15 +165,20 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.0.6", + "pluginVersion": "9.5.15", "targets": [ { + "datasource": { + "type": "mysql", + "uid": "P430005175C4C7810" + }, + "editorMode": "code", "format": "table", "group": [], "metricColumn": "none", "queryType": "randomWalk", "rawQuery": true, - "rawSql": "select \r\n count(*) as value\r\nfrom issues i\r\n join board_issues bi on i.id = bi.issue_id\r\nwhere \r\n i.type in ($type)\r\n and $__timeFilter(i.created_date)\r\n and bi.board_id in ($board_id)", + "rawSql": "select \r\n count(distinct i.id) as value\r\nfrom issues i\r\n join board_issues bi on i.id = bi.issue_id\r\nwhere \r\n i.type in ($type)\r\n and $__timeFilter(i.created_date)\r\n and bi.board_id in ($board_id)", "refId": "A", "select": [ [ @@ -158,6 +190,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "timeColumn": "time", "where": [ { @@ -222,15 +271,20 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.0.6", + "pluginVersion": "9.5.15", "targets": [ { + "datasource": { + "type": "mysql", + "uid": "P430005175C4C7810" + }, + "editorMode": "code", "format": "table", "group": [], "metricColumn": "none", "queryType": "randomWalk", "rawQuery": true, - "rawSql": "select \r\n count(*) as value\r\nfrom issues i\r\n join board_issues bi on i.id = bi.issue_id\r\nwhere \r\n i.type in ($type)\r\n and i.status = 'DONE'\r\n and $__timeFilter(i.created_date)\r\n and bi.board_id in ($board_id)", + "rawSql": "select \r\n count(distinct i.id) as value\r\nfrom issues i\r\n join board_issues bi on i.id = bi.issue_id\r\nwhere \r\n i.type in ($type)\r\n and i.status = 'DONE'\r\n and $__timeFilter(i.created_date)\r\n and bi.board_id in ($board_id)", "refId": "A", "select": [ [ @@ -242,6 +296,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "timeColumn": "time", "where": [ { @@ -264,6 +335,8 @@ "mode": "palette-classic" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 1, @@ -316,7 +389,6 @@ "y": 4 }, "id": 120, - "interval": null, "links": [ { "targetBlank": true, @@ -330,15 +402,21 @@ "sum" ], "displayMode": "list", - "placement": "bottom" + "placement": "bottom", + "showLegend": true }, "tooltip": { - "mode": "multi" + "mode": "multi", + "sort": "none" } }, "pluginVersion": "8.0.6", "targets": [ { + "datasource": { + "type": "mysql", + "uid": "P430005175C4C7810" + }, "format": "time_series", "group": [], "metricColumn": "none", @@ -366,8 +444,6 @@ ] } ], - "timeFrom": null, - "timeShift": null, "title": "Issue Status Distribution over Month [Issues Created in Selected Time Range]", "type": "timeseries" }, @@ -426,9 +502,13 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.0.6", + "pluginVersion": "9.5.15", "targets": [ { + "datasource": { + "type": "mysql", + "uid": "P430005175C4C7810" + }, "format": "time_series", "group": [], "metricColumn": "none", @@ -460,7 +540,6 @@ "type": "stat" }, { - "cacheTimeout": null, "datasource": "mysql", "description": "Issue Delivery Rate = count(Delivered Issues)/count(Issues)", "fieldConfig": { @@ -469,6 +548,8 @@ "mode": "palette-classic" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "Delivery Rate(%)", "axisPlacement": "auto", "barAlignment": 0, @@ -532,15 +613,21 @@ "legend": { "calcs": [], "displayMode": "list", - "placement": "bottom" + "placement": "bottom", + "showLegend": true }, "tooltip": { - "mode": "single" + "mode": "single", + "sort": "none" } }, "pluginVersion": "8.0.6", "targets": [ { + "datasource": { + "type": "mysql", + "uid": "P430005175C4C7810" + }, "format": "time_series", "group": [], "metricColumn": "none", @@ -568,14 +655,15 @@ ] } ], - "timeFrom": null, - "timeShift": null, "title": "Issue Delivery Rate over Time [Issues Created in Selected Time Range]", "type": "timeseries" }, { "collapsed": false, - "datasource": null, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, "gridPos": { "h": 1, "w": 24, @@ -584,6 +672,15 @@ }, "id": 110, "panels": [], + "targets": [ + { + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "refId": "A" + } + ], "title": "2. Issue Lead Time", "type": "row" }, @@ -639,9 +736,14 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.0.6", + "pluginVersion": "9.5.15", "targets": [ { + "datasource": { + "type": "mysql", + "uid": "P430005175C4C7810" + }, + "editorMode": "code", "format": "table", "group": [], "metricColumn": "none", @@ -658,6 +760,23 @@ } ] ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, "table": "ca_analysis", "timeColumn": "create_time", "timeColumnType": "timestamp", @@ -670,8 +789,6 @@ ] } ], - "timeFrom": null, - "timeShift": null, "title": "Mean Issue Lead Time in Days [Issues Resolved in Select Time Range]", "type": "stat" }, @@ -726,9 +843,13 @@ "text": {}, "textMode": "auto" }, - "pluginVersion": "8.0.6", + "pluginVersion": "9.5.15", "targets": [ { + "datasource": { + "type": "mysql", + "uid": "P430005175C4C7810" + }, "format": "table", "group": [], "metricColumn": "none", @@ -757,8 +878,6 @@ ] } ], - "timeFrom": null, - "timeShift": null, "title": "80% Issues' Lead Time are less than # days [Issues Resolved in Select Time Range]", "type": "stat" }, @@ -771,6 +890,8 @@ "mode": "palette-classic" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "Lead Time(days)", "axisPlacement": "auto", "axisSoftMin": 0, @@ -781,7 +902,13 @@ "tooltip": false, "viz": false }, - "lineWidth": 1 + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } }, "mappings": [], "thresholds": { @@ -817,25 +944,36 @@ } ], "options": { + "barRadius": 0, "barWidth": 0.5, + "fullHighlight": false, "groupWidth": 0.7, "legend": { "calcs": [], "displayMode": "list", - "placement": "bottom" + "placement": "bottom", + "showLegend": true }, "orientation": "auto", "showValue": "auto", + "stacking": "none", "text": { "valueSize": 12 }, "tooltip": { - "mode": "single" - } + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 0 }, "pluginVersion": "8.0.6", "targets": [ { + "datasource": { + "type": "mysql", + "uid": "P430005175C4C7810" + }, "format": "table", "group": [], "metricColumn": "none", @@ -864,8 +1002,6 @@ ] } ], - "timeFrom": null, - "timeShift": null, "title": "Mean Issue Lead Time [Issues Resolved in Select Time Range]", "type": "barchart" }, @@ -911,7 +1047,7 @@ "alertThreshold": false }, "percentage": false, - "pluginVersion": "8.0.6", + "pluginVersion": "9.5.15", "pointradius": 0.5, "points": false, "renderer": "flot", @@ -921,6 +1057,10 @@ "steppedLine": false, "targets": [ { + "datasource": { + "type": "mysql", + "uid": "P430005175C4C7810" + }, "format": "time_series", "group": [], "metricColumn": "none", @@ -960,9 +1100,7 @@ "yaxis": "right" } ], - "timeFrom": null, "timeRegions": [], - "timeShift": null, "title": "Cumulative Distribution of Requirement Lead Time [Issues Resolved in Select Time Range]", "tooltip": { "shared": false, @@ -972,9 +1110,7 @@ "transformations": [], "type": "graph", "xaxis": { - "buckets": null, "mode": "series", - "name": null, "show": true, "values": [ "current" @@ -987,26 +1123,24 @@ "label": "Percent Rank (%)", "logBase": 1, "max": "1.2", - "min": null, "show": true }, { "$$hashKey": "object:77", "format": "short", - "label": null, "logBase": 1, - "max": null, - "min": null, "show": false } ], "yaxis": { - "align": false, - "alignLevel": null + "align": false } }, { - "datasource": null, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, "gridPos": { "h": 2, "w": 24, @@ -1015,12 +1149,21 @@ }, "id": 130, "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, "content": "
\n\nThis dashboard is created based on this [data schema](https://devlake.apache.org/docs/DataModels/DevLakeDomainLayerSchema). Want to add more metrics? Please follow the [guide](https://devlake.apache.org/docs/Configuration/Dashboards/GrafanaUserGuide).", "mode": "markdown" }, - "pluginVersion": "8.0.6", + "pluginVersion": "9.5.15", "targets": [ { + "datasource": { + "type": "datasource", + "uid": "grafana" + }, "queryType": "randomWalk", "refId": "A" } @@ -1029,7 +1172,7 @@ } ], "refresh": "", - "schemaVersion": 30, + "schemaVersion": 38, "style": "dark", "tags": [ "Data Source Dashboard" @@ -1037,7 +1180,6 @@ "templating": { "list": [ { - "allValue": null, "current": { "selected": true, "text": [ @@ -1047,10 +1189,11 @@ "$__all" ] }, - "datasource": "mysql", + "datasource": { + "type": "mysql", + "uid": "P430005175C4C7810" + }, "definition": "select concat(name, '--', id) from boards where id like 'jira%'", - "description": null, - "error": null, "hide": 0, "includeAll": true, "label": "Choose Board", @@ -1065,16 +1208,16 @@ "type": "query" }, { - "allValue": null, "current": { "selected": false, "text": "All", "value": "$__all" }, - "datasource": "mysql", + "datasource": { + "type": "mysql", + "uid": "P430005175C4C7810" + }, "definition": "select distinct type from issues", - "description": null, - "error": null, "hide": 0, "includeAll": true, "label": "Issue Type", @@ -1098,5 +1241,6 @@ "timezone": "", "title": "Jira", "uid": "F5vqBQl7z", - "version": 3 + "version": 4, + "weekStart": "" } \ No newline at end of file From 010c2f9f7d793bfcb018bcf45bc03625233518ca Mon Sep 17 00:00:00 2001 From: abeizn Date: Fri, 19 Jan 2024 16:57:46 +0800 Subject: [PATCH 2/4] fix: lint --- grafana/dashboards/AzureDevOps.json | 5 +---- grafana/dashboards/Bamboo.json | 5 +---- grafana/dashboards/Jira.json | 10 ++-------- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/grafana/dashboards/AzureDevOps.json b/grafana/dashboards/AzureDevOps.json index fdde27c92c9..30488dc3bc8 100644 --- a/grafana/dashboards/AzureDevOps.json +++ b/grafana/dashboards/AzureDevOps.json @@ -2149,10 +2149,7 @@ "$__all" ] }, - "datasource": { - "type": "mysql", - "uid": "P430005175C4C7810" - }, + "datasource": "mysql", "definition": "select concat(name, '--', id) as text from repos where id like 'azure%'", "hide": 0, "includeAll": true, diff --git a/grafana/dashboards/Bamboo.json b/grafana/dashboards/Bamboo.json index 131d418938b..9c2f38c8e83 100644 --- a/grafana/dashboards/Bamboo.json +++ b/grafana/dashboards/Bamboo.json @@ -1189,10 +1189,7 @@ "$__all" ] }, - "datasource": { - "type": "mysql", - "uid": "P430005175C4C7810" - }, + "datasource": "mysql", "definition": "select concat(name, '--', id) as text from cicd_scopes where id like \"bamboo%\" ", "hide": 0, "includeAll": true, diff --git a/grafana/dashboards/Jira.json b/grafana/dashboards/Jira.json index c276c08e577..241984f5fe6 100644 --- a/grafana/dashboards/Jira.json +++ b/grafana/dashboards/Jira.json @@ -1189,10 +1189,7 @@ "$__all" ] }, - "datasource": { - "type": "mysql", - "uid": "P430005175C4C7810" - }, + "datasource": "mysql", "definition": "select concat(name, '--', id) from boards where id like 'jira%'", "hide": 0, "includeAll": true, @@ -1213,10 +1210,7 @@ "text": "All", "value": "$__all" }, - "datasource": { - "type": "mysql", - "uid": "P430005175C4C7810" - }, + "datasource": "mysql", "definition": "select distinct type from issues", "hide": 0, "includeAll": true, From db497b61caa28c55346db6a28d30140aeb2295a9 Mon Sep 17 00:00:00 2001 From: abeizn Date: Fri, 19 Jan 2024 17:01:47 +0800 Subject: [PATCH 3/4] fix: lint --- grafana/dashboards/Jira.json | 45 ++++++++---------------------------- 1 file changed, 9 insertions(+), 36 deletions(-) diff --git a/grafana/dashboards/Jira.json b/grafana/dashboards/Jira.json index 241984f5fe6..06911277fad 100644 --- a/grafana/dashboards/Jira.json +++ b/grafana/dashboards/Jira.json @@ -168,10 +168,7 @@ "pluginVersion": "9.5.15", "targets": [ { - "datasource": { - "type": "mysql", - "uid": "P430005175C4C7810" - }, + "datasource": "mysql", "editorMode": "code", "format": "table", "group": [], @@ -274,10 +271,7 @@ "pluginVersion": "9.5.15", "targets": [ { - "datasource": { - "type": "mysql", - "uid": "P430005175C4C7810" - }, + "datasource": "mysql", "editorMode": "code", "format": "table", "group": [], @@ -413,10 +407,7 @@ "pluginVersion": "8.0.6", "targets": [ { - "datasource": { - "type": "mysql", - "uid": "P430005175C4C7810" - }, + "datasource": "mysql", "format": "time_series", "group": [], "metricColumn": "none", @@ -505,10 +496,7 @@ "pluginVersion": "9.5.15", "targets": [ { - "datasource": { - "type": "mysql", - "uid": "P430005175C4C7810" - }, + "datasource": "mysql", "format": "time_series", "group": [], "metricColumn": "none", @@ -624,10 +612,7 @@ "pluginVersion": "8.0.6", "targets": [ { - "datasource": { - "type": "mysql", - "uid": "P430005175C4C7810" - }, + "datasource": "mysql", "format": "time_series", "group": [], "metricColumn": "none", @@ -739,10 +724,7 @@ "pluginVersion": "9.5.15", "targets": [ { - "datasource": { - "type": "mysql", - "uid": "P430005175C4C7810" - }, + "datasource": "mysql", "editorMode": "code", "format": "table", "group": [], @@ -846,10 +828,7 @@ "pluginVersion": "9.5.15", "targets": [ { - "datasource": { - "type": "mysql", - "uid": "P430005175C4C7810" - }, + "datasource": "mysql", "format": "table", "group": [], "metricColumn": "none", @@ -970,10 +949,7 @@ "pluginVersion": "8.0.6", "targets": [ { - "datasource": { - "type": "mysql", - "uid": "P430005175C4C7810" - }, + "datasource": "mysql", "format": "table", "group": [], "metricColumn": "none", @@ -1057,10 +1033,7 @@ "steppedLine": false, "targets": [ { - "datasource": { - "type": "mysql", - "uid": "P430005175C4C7810" - }, + "datasource": "mysql", "format": "time_series", "group": [], "metricColumn": "none", From 8d71ddf702b99f8e3aa79898cb63e05ee5db406b Mon Sep 17 00:00:00 2001 From: abeizn Date: Fri, 19 Jan 2024 17:04:02 +0800 Subject: [PATCH 4/4] fix: lint --- grafana/dashboards/GitHub.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/grafana/dashboards/GitHub.json b/grafana/dashboards/GitHub.json index 6e4a65b7267..8b26df741d7 100644 --- a/grafana/dashboards/GitHub.json +++ b/grafana/dashboards/GitHub.json @@ -3516,10 +3516,7 @@ "$__all" ] }, - "datasource": { - "type": "mysql", - "uid": "P430005175C4C7810" - }, + "datasource": "mysql", "definition": "select concat(name, '--', id) as text from repos where id like 'github%'", "hide": 0, "includeAll": true,