blob: fc72fe2c3e5915bb6fb7fbee68b0fb4c9b907c1f [file] [log] [blame]
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 4,
"iteration": 1682063024677,
"links": [],
"panels": [
{
"datasource": null,
"gridPos": {
"h": 3,
"w": 24,
"x": 0,
"y": 0
},
"id": 58,
"options": {
"content": "- Use Cases: This dashboard shows the basic CI/CD metrics from Jenkins, 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).\n- Data Source Required: Jenkins",
"mode": "markdown"
},
"pluginVersion": "8.0.6",
"targets": [
{
"queryType": "randomWalk",
"refId": "A"
}
],
"title": "Dashboard Introduction",
"type": "text"
},
{
"datasource": "mysql",
"description": "Number of builds executed in the selected time range",
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 6,
"x": 0,
"y": 3
},
"id": 4,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.0.6",
"targets": [
{
"format": "table",
"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 \"%jenkins%\"\n and cicd_scope_id in ($job_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": [
[
{
"params": [
"project_id"
],
"type": "column"
}
]
],
"table": "gitlab_commits",
"timeColumn": "created_at",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"timeFrom": null,
"timeShift": null,
"title": "1. Total Number of Successful Builds [Selected Time Range]",
"type": "stat"
},
{
"datasource": "mysql",
"description": "Number of successful builds / Number of total builds",
"fieldConfig": {
"defaults": {
"mappings": [],
"max": 100,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
}
]
},
"unit": "percentunit"
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 6,
"x": 6,
"y": 3
},
"id": 6,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.0.6",
"targets": [
{
"format": "table",
"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 \"%jenkins%\"\n and cicd_scope_id in ($job_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": [
[
{
"params": [
"project_id"
],
"type": "column"
}
]
],
"table": "gitlab_commits",
"timeColumn": "created_at",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"timeFrom": null,
"timeShift": null,
"title": "2. Mean Build Success Rate",
"type": "stat"
},
{
"cacheTimeout": null,
"datasource": "mysql",
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
}
},
"decimals": 0,
"mappings": [],
"unit": "none"
},
"overrides": [
{
"__systemRef": "hideSeriesFrom",
"matcher": {
"id": "byNames",
"options": {
"mode": "exclude",
"names": [
"build_count",
"ABORT"
],
"prefix": "All except:",
"readOnly": true
}
},
"properties": [
{
"id": "custom.hideFrom",
"value": {
"legend": false,
"tooltip": false,
"viz": true
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "SUCCESS"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "green",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "FAILURE"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "red",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "ABORT"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "rgba(205, 204, 206, 1)",
"mode": "fixed"
}
}
]
}
]
},
"gridPos": {
"h": 6,
"w": 6,
"x": 12,
"y": 3
},
"id": 37,
"interval": null,
"links": [],
"options": {
"displayLabels": [
"value",
"percent"
],
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "right",
"values": [
"percent",
"value"
]
},
"pieType": "donut",
"reduceOptions": {
"calcs": [
"sum"
],
"fields": "",
"values": true
},
"tooltip": {
"mode": "single"
}
},
"pluginVersion": "8.0.6",
"targets": [
{
"format": "table",
"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 \"%jenkins%\"\n and cicd_scope_id in ($job_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": [
[
{
"params": [
"project_id"
],
"type": "column"
}
]
],
"table": "gitlab_commits",
"timeColumn": "created_at",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"timeFrom": null,
"timeShift": null,
"title": "3. Total Build Result Distribution",
"type": "piechart"
},
{
"datasource": "mysql",
"description": "Number of successful builds / Number of total builds",
"fieldConfig": {
"defaults": {
"mappings": [],
"max": 100,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "light-orange",
"value": null
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 6,
"x": 18,
"y": 3
},
"id": 55,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.0.6",
"targets": [
{
"format": "table",
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n avg(duration_sec/60) as duration_in_minutes\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%jenkins%\"\n and cicd_scope_id in ($job_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": [
[
{
"params": [
"project_id"
],
"type": "column"
}
]
],
"table": "gitlab_commits",
"timeColumn": "created_at",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"timeFrom": null,
"timeShift": null,
"title": "4. Mean Build Duration in Minutes",
"type": "stat"
},
{
"datasource": "mysql",
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "Build Count",
"axisPlacement": "auto",
"axisSoftMin": 0,
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineWidth": 1
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 12,
"x": 0,
"y": 9
},
"id": 52,
"options": {
"barWidth": 0.5,
"groupWidth": 0.7,
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"orientation": "auto",
"showValue": "auto",
"text": {
"valueSize": 12
},
"tooltip": {
"mode": "single"
}
},
"pluginVersion": "8.0.6",
"targets": [
{
"format": "table",
"group": [],
"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 \"%jenkins%\"\n and cicd_scope_id in ($job_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": [
[
{
"params": [
"id"
],
"type": "column"
}
]
],
"table": "ae_projects",
"timeColumn": "ae_create_time",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"title": "1.1 Total Number of Successful Builds [Each Month]",
"type": "barchart"
},
{
"datasource": "mysql",
"description": "1. Mean Build success rate over time.\n2. The builds being calculated are filtered by \"build starting time\" (time filter at the upper-right corner) and \"Jira board\" (\"Choose Board\" filter at the upper-left corner)",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "Build Success Rate(%)",
"axisPlacement": "auto",
"axisSoftMin": 0,
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineWidth": 1
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "percentunit"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Build Success Rate"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "blue",
"mode": "fixed"
}
}
]
}
]
},
"gridPos": {
"h": 6,
"w": 12,
"x": 12,
"y": 9
},
"id": 50,
"interval": "",
"options": {
"barWidth": 0.5,
"groupWidth": 0.7,
"legend": {
"calcs": [
"mean"
],
"displayMode": "list",
"placement": "bottom"
},
"orientation": "auto",
"showValue": "auto",
"text": {
"valueSize": 12
},
"tooltip": {
"mode": "single"
}
},
"pluginVersion": "8.0.6",
"targets": [
{
"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 \"%jenkins%\"\r\n and cicd_scope_id in ($job_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 1\r\nORDER BY 1",
"refId": "A",
"select": [
[
{
"params": [
"progress"
],
"type": "column"
}
]
],
"table": "ca_analysis",
"timeColumn": "create_time",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"timeFrom": null,
"timeShift": null,
"title": "2.1 Build Success Rate [Each Month]",
"type": "barchart"
},
{
"datasource": "mysql",
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "fixed"
},
"custom": {
"axisLabel": "Build Count",
"axisPlacement": "auto",
"barAlignment": 1,
"drawStyle": "bars",
"fillOpacity": 50,
"gradientMode": "opacity",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 4,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "normal"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "successful_build_count"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "green",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "failed_build_count"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "red",
"mode": "fixed"
}
}
]
}
]
},
"gridPos": {
"h": 6,
"w": 24,
"x": 0,
"y": 15
},
"id": 54,
"options": {
"legend": {
"calcs": [
"sum"
],
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "multi"
}
},
"pluginVersion": "8.0.6",
"targets": [
{
"format": "time_series",
"group": [],
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n DATE_ADD(date(finished_date), INTERVAL -DAYOFMONTH(date(finished_date))+1 DAY) as time,\n count(distinct case when result = 'SUCCESS' then id else null end) as successful_build_count,\n count(distinct case when result != 'SUCCESS' then id else null end) as failed_build_count\nFROM cicd_pipelines\nWHERE\n $__timeFilter(finished_date)\n and id like \"%jenkins%\"\n and cicd_scope_id in ($job_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",
"refId": "A",
"select": [
[
{
"params": [
"id"
],
"type": "column"
}
]
],
"table": "ae_projects",
"timeColumn": "ae_create_time",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"title": "3.1 Number of Successful and Failed Builds [Each Month]",
"type": "timeseries"
},
{
"datasource": "mysql",
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "Build Count",
"axisPlacement": "auto",
"axisSoftMin": 0,
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineWidth": 1
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "purple",
"value": null
},
{
"color": "red",
"value": 60
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "mean_duration_minutes"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "light-orange",
"mode": "fixed"
}
}
]
}
]
},
"gridPos": {
"h": 6,
"w": 24,
"x": 0,
"y": 21
},
"id": 56,
"options": {
"barWidth": 0.5,
"groupWidth": 0.7,
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"orientation": "auto",
"showValue": "auto",
"text": {
"valueSize": 12
},
"tooltip": {
"mode": "single"
}
},
"pluginVersion": "8.0.6",
"targets": [
{
"format": "table",
"group": [],
"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 avg(duration_sec) as mean_duration_sec\n FROM \n cicd_pipelines\n WHERE\n $__timeFilter(finished_date)\n and id like \"%jenkins%\"\n and cicd_scope_id in ($job_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 mean_duration_sec/60 as mean_duration_minutes\nFROM _builds\nORDER BY time\n",
"refId": "A",
"select": [
[
{
"params": [
"id"
],
"type": "column"
}
]
],
"table": "ae_projects",
"timeColumn": "ae_create_time",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"title": "4.1 Mean Build Duration in Minutes [Each Month]",
"type": "barchart"
},
{
"datasource": null,
"gridPos": {
"h": 2,
"w": 24,
"x": 0,
"y": 27
},
"id": 60,
"options": {
"content": "<br/>\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",
"targets": [
{
"queryType": "randomWalk",
"refId": "A"
}
],
"type": "text"
}
],
"refresh": "",
"schemaVersion": 30,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"allValue": null,
"current": {
"selected": true,
"text": [
"All"
],
"value": [
"$__all"
]
},
"datasource": "mysql",
"definition": "select distinct cicd_scope_id as text from cicd_pipelines where id like \"%jenkins%\" ",
"description": null,
"error": null,
"hide": 0,
"includeAll": true,
"label": "Job Name",
"multi": true,
"name": "job_id",
"options": [],
"query": "select distinct cicd_scope_id as text from cicd_pipelines where id like \"%jenkins%\" ",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
}
]
},
"time": {
"from": "now-6M",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Jenkins",
"uid": "W8AiDFQnk",
"version": 3
}