Grafana: Added new dashboards, improved old ones

This commit is contained in:
Kirill Zhukov 2023-03-08 00:02:25 +01:00
parent c4983d6ae4
commit 76be50ca9c
3 changed files with 951 additions and 433 deletions

View File

@ -1,8 +1,8 @@
{ {
"__inputs": [ "__inputs": [
{ {
"name": "DS_ALBS_ANALYTICS", "name": "DS_POSTGRESQL",
"label": "albs_analytics", "label": "PostgreSQL",
"description": "", "description": "",
"type": "datasource", "type": "datasource",
"pluginId": "postgres", "pluginId": "postgres",
@ -11,11 +11,17 @@
], ],
"__elements": {}, "__elements": {},
"__requires": [ "__requires": [
{
"type": "panel",
"id": "bargauge",
"name": "Bar gauge",
"version": ""
},
{ {
"type": "grafana", "type": "grafana",
"id": "grafana", "id": "grafana",
"name": "Grafana", "name": "Grafana",
"version": "9.3.6" "version": "9.3.2"
}, },
{ {
"type": "panel", "type": "panel",
@ -64,7 +70,7 @@
} }
] ]
}, },
"editable": false, "editable": true,
"fiscalYearStartMonth": 0, "fiscalYearStartMonth": 0,
"graphTooltip": 0, "graphTooltip": 0,
"id": null, "id": null,
@ -87,7 +93,7 @@
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -171,7 +177,7 @@
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"editorMode": "code", "editorMode": "code",
"format": "table", "format": "table",
@ -200,7 +206,7 @@
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"editorMode": "code", "editorMode": "code",
"format": "table", "format": "table",
@ -233,7 +239,7 @@
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"description": "", "description": "",
"fieldConfig": { "fieldConfig": {
@ -363,7 +369,7 @@
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"editorMode": "code", "editorMode": "code",
"format": "table", "format": "table",
@ -392,7 +398,7 @@
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"editorMode": "code", "editorMode": "code",
"format": "table", "format": "table",
@ -421,7 +427,7 @@
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"editorMode": "code", "editorMode": "code",
"format": "table", "format": "table",
@ -450,7 +456,7 @@
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"editorMode": "code", "editorMode": "code",
"format": "table", "format": "table",
@ -479,7 +485,7 @@
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"editorMode": "code", "editorMode": "code",
"format": "table", "format": "table",
@ -512,7 +518,7 @@
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"description": "", "description": "",
"fieldConfig": { "fieldConfig": {
@ -702,7 +708,7 @@
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"editorMode": "code", "editorMode": "code",
"format": "table", "format": "table",
@ -731,7 +737,7 @@
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"editorMode": "code", "editorMode": "code",
"format": "table", "format": "table",
@ -760,7 +766,7 @@
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"editorMode": "code", "editorMode": "code",
"format": "table", "format": "table",
@ -789,7 +795,7 @@
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"editorMode": "code", "editorMode": "code",
"format": "table", "format": "table",
@ -818,7 +824,7 @@
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"editorMode": "code", "editorMode": "code",
"format": "table", "format": "table",
@ -851,7 +857,7 @@
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -894,13 +900,13 @@
}, },
"textMode": "auto" "textMode": "auto"
}, },
"pluginVersion": "9.3.6", "pluginVersion": "9.3.2",
"targets": [ "targets": [
{ {
"cacheDurationSeconds": 300, "cacheDurationSeconds": 300,
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"editorMode": "code", "editorMode": "code",
"fields": [ "fields": [
@ -913,7 +919,7 @@
"queryParams": "", "queryParams": "",
"rawQuery": true, "rawQuery": true,
"rawSql": "SELECT MAX(finished_at - created_at) AS MAX\nFROM builds\nWHERE $__unixEpochFilter(created_at) AND finished_at IS NOT NULL;", "rawSql": "SELECT MAX(finished_at - created_at) AS MAX\nFROM builds\nWHERE $__unixEpochFilter(created_at) AND finished_at IS NOT NULL;",
"refId": "MAX", "refId": "max",
"sql": { "sql": {
"columns": [ "columns": [
{ {
@ -937,7 +943,7 @@
"cacheDurationSeconds": 300, "cacheDurationSeconds": 300,
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"editorMode": "code", "editorMode": "code",
"fields": [ "fields": [
@ -951,7 +957,7 @@
"queryParams": "", "queryParams": "",
"rawQuery": true, "rawQuery": true,
"rawSql": "SELECT MIN(finished_at - created_at) AS MIN\nFROM builds\nWHERE $__unixEpochFilter(created_at) AND finished_at IS NOT NULL;", "rawSql": "SELECT MIN(finished_at - created_at) AS MIN\nFROM builds\nWHERE $__unixEpochFilter(created_at) AND finished_at IS NOT NULL;",
"refId": "MIN", "refId": "min",
"sql": { "sql": {
"columns": [ "columns": [
{ {
@ -972,24 +978,16 @@
"urlPath": "" "urlPath": ""
}, },
{ {
"cacheDurationSeconds": 300,
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"editorMode": "code", "editorMode": "code",
"fields": [
{
"jsonPath": ""
}
],
"format": "table", "format": "table",
"hide": false, "hide": false,
"method": "GET",
"queryParams": "",
"rawQuery": true, "rawQuery": true,
"rawSql": "SELECT AVG(finished_at - created_at) AS AVG\nFROM builds\nWHERE $__unixEpochFilter(created_at) AND finished_at IS NOT NULL;", "rawSql": "SELECT PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER BY durations.duration) as median FROM \n(SELECT (finished_at - created_at) AS duration \n FROM builds\n WHERE $__unixEpochFilter(created_at) AND finished_at IS NOT NULL) as durations\n",
"refId": "AVG", "refId": "meidan",
"sql": { "sql": {
"columns": [ "columns": [
{ {
@ -1006,8 +1004,7 @@
} }
], ],
"limit": 50 "limit": 50
}, }
"urlPath": ""
} }
], ],
"title": "Build duration", "title": "Build duration",
@ -1016,7 +1013,7 @@
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"description": "", "description": "",
"fieldConfig": { "fieldConfig": {
@ -1060,13 +1057,13 @@
}, },
"textMode": "auto" "textMode": "auto"
}, },
"pluginVersion": "9.3.6", "pluginVersion": "9.3.2",
"targets": [ "targets": [
{ {
"cacheDurationSeconds": 300, "cacheDurationSeconds": 300,
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"editorMode": "code", "editorMode": "code",
"fields": [ "fields": [
@ -1079,7 +1076,7 @@
"queryParams": "", "queryParams": "",
"rawQuery": true, "rawQuery": true,
"rawSql": "SELECT MAX(finished_at - started_at) AS MAX\nFROM build_tasks\nWHERE $__unixEpochFilter(started_at) AND finished_at IS NOT NULL AND status_id <> 4", "rawSql": "SELECT MAX(finished_at - started_at) AS MAX\nFROM build_tasks\nWHERE $__unixEpochFilter(started_at) AND finished_at IS NOT NULL AND status_id <> 4",
"refId": "MAX", "refId": "max",
"sql": { "sql": {
"columns": [ "columns": [
{ {
@ -1103,7 +1100,7 @@
"cacheDurationSeconds": 300, "cacheDurationSeconds": 300,
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"editorMode": "code", "editorMode": "code",
"fields": [ "fields": [
@ -1117,7 +1114,7 @@
"queryParams": "", "queryParams": "",
"rawQuery": true, "rawQuery": true,
"rawSql": "SELECT MIN(finished_at - started_at) AS MIN\nFROM build_tasks\nWHERE $__unixEpochFilter(started_at) AND finished_at IS NOT NULL AND status_id <> 4", "rawSql": "SELECT MIN(finished_at - started_at) AS MIN\nFROM build_tasks\nWHERE $__unixEpochFilter(started_at) AND finished_at IS NOT NULL AND status_id <> 4",
"refId": "MIN", "refId": "min",
"sql": { "sql": {
"columns": [ "columns": [
{ {
@ -1141,7 +1138,7 @@
"cacheDurationSeconds": 300, "cacheDurationSeconds": 300,
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"editorMode": "code", "editorMode": "code",
"fields": [ "fields": [
@ -1154,8 +1151,8 @@
"method": "GET", "method": "GET",
"queryParams": "", "queryParams": "",
"rawQuery": true, "rawQuery": true,
"rawSql": "SELECT AVG(finished_at - started_at) AS AVG\nFROM build_tasks\nWHERE $__unixEpochFilter(started_at) AND finished_at IS NOT NULL AND status_id <> 4", "rawSql": "SELECT PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER BY durations.duration) as median FROM \n(SELECT (finished_at - started_at) AS duration\nFROM build_tasks\nWHERE $__unixEpochFilter(started_at) AND finished_at IS NOT NULL AND status_id <> 4) as durations\n\n\n",
"refId": "AVG", "refId": "median",
"sql": { "sql": {
"columns": [ "columns": [
{ {
@ -1180,22 +1177,308 @@
"type": "stat" "type": "stat"
}, },
{ {
"collapsed": false, "datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"fixedColor": "#61a69d",
"mode": "fixed"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "s"
},
"overrides": []
},
"gridPos": { "gridPos": {
"h": 1, "h": 8,
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 15 "y": 15
}, },
"id": 5, "id": 20,
"panels": [], "options": {
"title": "Build details", "displayMode": "gradient",
"type": "row" "minVizHeight": 10,
"minVizWidth": 0,
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showUnfilled": false
},
"pluginVersion": "9.3.2",
"targets": [
{
"cacheDurationSeconds": 300,
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"editorMode": "code",
"fields": [
{
"jsonPath": ""
}
],
"format": "table",
"method": "GET",
"queryParams": "",
"rawQuery": true,
"rawSql": "SELECT SUM(end_ts - start_ts) as upload\nFROM build_node_stats \nWHERE stat_name_id = 0 AND $__unixEpochFilter(start_ts);",
"refId": "upload",
"sql": {
"columns": [
{
"parameters": [
{
"name": "start_ts",
"type": "functionParameter"
}
],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
},
"table": "build_node_stats",
"urlPath": ""
},
{
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"editorMode": "code",
"format": "table",
"hide": false,
"rawQuery": true,
"rawSql": "SELECT SUM(end_ts - start_ts) as build_srpm\nFROM build_node_stats \nWHERE stat_name_id = 2 AND $__unixEpochFilter(start_ts);",
"refId": "build_srpm",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
},
{
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"editorMode": "code",
"format": "table",
"hide": false,
"rawQuery": true,
"rawSql": "SELECT SUM(end_ts - start_ts) as git_checkout\nFROM build_node_stats \nWHERE stat_name_id = 3 AND $__unixEpochFilter(start_ts);",
"refId": "git_checkout",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
},
{
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"editorMode": "code",
"format": "table",
"hide": false,
"rawQuery": true,
"rawSql": "SELECT end_ts - start_ts as build_binaries\nFROM build_node_stats \nWHERE stat_name_id = 4 AND $__unixEpochFilter(start_ts);",
"refId": "build_binaries",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
},
{
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"editorMode": "code",
"format": "table",
"hide": false,
"rawQuery": true,
"rawSql": "SELECT end_ts - start_ts as notarize_artifacts\nFROM build_node_stats \nWHERE stat_name_id = 7 AND $__unixEpochFilter(start_ts)",
"refId": "cas_notarize_artifacts",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
},
{
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"editorMode": "code",
"format": "table",
"hide": false,
"rawQuery": true,
"rawSql": "SELECT SUM(end_ts - start_ts) as source_authenticate\nFROM build_node_stats \nWHERE stat_name_id = 8 AND $__unixEpochFilter(start_ts);",
"refId": "cas_source_authenticate",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
},
{
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"editorMode": "code",
"format": "table",
"hide": false,
"rawQuery": true,
"rawSql": "SELECT SUM(end_ts - start_ts) as logs_processing\nFROM web_node_stats \nWHERE stat_name_id = 1 AND $__unixEpochFilter(start_ts);",
"refId": "logs_processing",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
},
{
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"editorMode": "code",
"format": "table",
"hide": false,
"rawQuery": true,
"rawSql": "SELECT SUM(end_ts - start_ts) as packages_processing\nFROM web_node_stats \nWHERE stat_name_id = 2 AND $__unixEpochFilter(start_ts);",
"refId": "B",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
}
],
"title": "Build task steps duration (SUM)",
"type": "bargauge"
}, },
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"description": "", "description": "",
"fieldConfig": { "fieldConfig": {
@ -1260,6 +1543,23 @@
"value": 107 "value": 107
} }
] ]
},
{
"matcher": {
"id": "byName",
"options": "id"
},
"properties": [
{
"id": "links",
"value": [
{
"title": "",
"url": "/d/dmVtrz-4k/build-details?orgId=1&var-build_id=${__value.raw}"
}
]
}
]
} }
] ]
}, },
@ -1267,7 +1567,7 @@
"h": 15, "h": 15,
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 16 "y": 23
}, },
"id": 2, "id": 2,
"options": { "options": {
@ -1286,13 +1586,13 @@
} }
] ]
}, },
"pluginVersion": "9.3.6", "pluginVersion": "9.3.2",
"targets": [ "targets": [
{ {
"cacheDurationSeconds": 300, "cacheDurationSeconds": 300,
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}" "uid": "${DS_POSTGRESQL}"
}, },
"editorMode": "code", "editorMode": "code",
"fields": [ "fields": [
@ -1347,146 +1647,6 @@
} }
], ],
"type": "table" "type": "table"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 31
},
"id": 7,
"panels": [],
"title": "Build tasks details",
"type": "row"
},
{
"datasource": {
"type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "center",
"displayMode": "auto",
"filterable": true,
"inspect": false
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "duration"
},
"properties": [
{
"id": "unit",
"value": "s"
}
]
}
]
},
"gridPos": {
"h": 12,
"w": 24,
"x": 0,
"y": 32
},
"id": 15,
"options": {
"footer": {
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true,
"sortBy": [
{
"desc": false,
"displayName": "duration"
}
]
},
"pluginVersion": "9.3.6",
"targets": [
{
"cacheDurationSeconds": 300,
"datasource": {
"type": "postgres",
"uid": "${DS_ALBS_ANALYTICS}"
},
"editorMode": "code",
"fields": [
{
"jsonPath": ""
}
],
"format": "table",
"method": "GET",
"queryParams": "",
"rawQuery": true,
"rawSql": "SELECT\n bt.id,\n bt.name,\n bt.build_id,\n arch_enum.value AS arch,\n status_enum.value AS status,\n bt.started_at * 1000 AS started,\n bt.finished_at * 1000 AS finished,\n bt.finished_at - bt.started_at AS duration \nFROM build_tasks AS bt\nJOIN build_task_status_enum AS status_enum ON bt.status_id = status_enum.id\nJOIN arch_enum on bt.arch_id = arch_enum.id\nWHERE $__unixEpochFilter(started_at) AND status_id >= 2;",
"refId": "A",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
},
"urlPath": ""
}
],
"title": "Finished buld tasks",
"transformations": [
{
"id": "convertFieldType",
"options": {
"conversions": [
{
"destinationType": "time",
"targetField": "started"
},
{
"destinationType": "time",
"targetField": "finished"
}
],
"fields": {}
}
}
],
"type": "table"
} }
], ],
"refresh": "1m", "refresh": "1m",
@ -1504,6 +1664,6 @@
"timezone": "", "timezone": "",
"title": "Build analytics", "title": "Build analytics",
"uid": "02mg4oxVk", "uid": "02mg4oxVk",
"version": 3, "version": 21,
"weekStart": "" "weekStart": ""
} }

View File

@ -0,0 +1,244 @@
{
"__inputs": [
{
"name": "DS_POSTGRESQL",
"label": "PostgreSQL",
"description": "",
"type": "datasource",
"pluginId": "postgres",
"pluginName": "PostgreSQL"
}
],
"__elements": {},
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "9.3.2"
},
{
"type": "datasource",
"id": "postgres",
"name": "PostgreSQL",
"version": "1.0.0"
},
{
"type": "panel",
"id": "table",
"name": "Table",
"version": ""
}
],
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": false,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "center",
"displayMode": "auto",
"filterable": true,
"inspect": false
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "id"
},
"properties": [
{
"id": "links",
"value": [
{
"targetBlank": false,
"title": "",
"url": "/d/vtQClqxVk/build-task-details?orgId=1&var-build_task=${__value.raw}"
}
]
}
]
},
{
"matcher": {
"id": "byName",
"options": "duration"
},
"properties": [
{
"id": "unit",
"value": "s"
}
]
}
]
},
"gridPos": {
"h": 14,
"w": 24,
"x": 0,
"y": 0
},
"id": 2,
"options": {
"footer": {
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true,
"sortBy": [
{
"desc": true,
"displayName": "build_id"
}
]
},
"pluginVersion": "9.3.2",
"targets": [
{
"cacheDurationSeconds": 300,
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"editorMode": "code",
"fields": [
{
"jsonPath": ""
}
],
"format": "table",
"method": "GET",
"queryParams": "",
"rawQuery": true,
"rawSql": "SELECT\n bt.id,\n bt.name,\n arch_enum.value AS arch,\n status_enum.value AS status,\n bt.started_at * 1000 AS started,\n bt.finished_at * 1000 AS finished,\n bt.finished_at - bt.started_at AS duration \nFROM build_tasks AS bt\nJOIN build_task_status_enum AS status_enum ON bt.status_id = status_enum.id\nJOIN arch_enum on bt.arch_id = arch_enum.id\nWHERE bt.build_id = $build_id AND status_id >= 2;",
"refId": "A",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
},
"urlPath": ""
}
],
"title": "Finished buld tasks",
"transformations": [
{
"id": "convertFieldType",
"options": {
"conversions": [
{
"destinationType": "time",
"targetField": "started"
},
{
"destinationType": "time",
"targetField": "finished"
}
],
"fields": {}
}
}
],
"type": "table"
}
],
"schemaVersion": 37,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"current": {},
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"definition": "SELECT id\nFROM builds\nORDER BY id DESC",
"hide": 0,
"includeAll": false,
"multi": false,
"name": "build_id",
"options": [],
"query": "SELECT id\nFROM builds\nORDER BY id DESC",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
}
]
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Build details",
"uid": "dmVtrz-4k",
"version": 5,
"weekStart": ""
}

View File

@ -7,10 +7,22 @@
"type": "datasource", "type": "datasource",
"pluginId": "postgres", "pluginId": "postgres",
"pluginName": "PostgreSQL" "pluginName": "PostgreSQL"
},
{
"name": "DS_EXPRESSION",
"label": "Expression",
"description": "",
"type": "datasource",
"pluginId": "__expr__"
} }
], ],
"__elements": {}, "__elements": {},
"__requires": [ "__requires": [
{
"type": "datasource",
"id": "__expr__",
"version": "1.0.0"
},
{ {
"type": "panel", "type": "panel",
"id": "bargauge", "id": "bargauge",
@ -23,18 +35,18 @@
"name": "Grafana", "name": "Grafana",
"version": "9.3.2" "version": "9.3.2"
}, },
{
"type": "panel",
"id": "piechart",
"name": "Pie chart",
"version": ""
},
{ {
"type": "datasource", "type": "datasource",
"id": "postgres", "id": "postgres",
"name": "PostgreSQL", "name": "PostgreSQL",
"version": "1.0.0" "version": "1.0.0"
}, },
{
"type": "panel",
"id": "stat",
"name": "Stat",
"version": ""
},
{ {
"type": "panel", "type": "panel",
"id": "table", "id": "table",
@ -64,7 +76,7 @@
} }
] ]
}, },
"editable": true, "editable": false,
"fiscalYearStartMonth": 0, "fiscalYearStartMonth": 0,
"graphTooltip": 0, "graphTooltip": 0,
"id": null, "id": null,
@ -194,19 +206,6 @@
], ],
"type": "table" "type": "table"
}, },
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 3
},
"id": 10,
"panels": [],
"title": "Tasks duration",
"type": "row"
},
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
@ -233,10 +232,10 @@
"overrides": [] "overrides": []
}, },
"gridPos": { "gridPos": {
"h": 8, "h": 9,
"w": 16, "w": 24,
"x": 0, "x": 0,
"y": 4 "y": 3
}, },
"id": 12, "id": 12,
"options": { "options": {
@ -298,35 +297,6 @@
"table": "build_node_stats", "table": "build_node_stats",
"urlPath": "" "urlPath": ""
}, },
{
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"editorMode": "code",
"format": "table",
"hide": true,
"rawQuery": true,
"rawSql": "SELECT end_ts - start_ts as build_all\nFROM build_node_stats \nWHERE build_task_id = $build_task and stat_name_id = 1",
"refId": "build_all",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
},
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
@ -414,64 +384,6 @@
"limit": 50 "limit": 50
} }
}, },
{
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"editorMode": "code",
"format": "table",
"hide": true,
"rawQuery": true,
"rawSql": "SELECT end_ts - start_ts as build_packages\nFROM build_node_stats \nWHERE build_task_id = $build_task and stat_name_id = 5",
"refId": "build_packages",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
},
{
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"editorMode": "code",
"format": "table",
"hide": true,
"rawQuery": true,
"rawSql": "SELECT end_ts - start_ts as build_node_task\nFROM build_node_stats \nWHERE build_task_id = $build_task and stat_name_id = 6",
"refId": "build_node_task",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
},
{ {
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
@ -529,111 +441,15 @@
], ],
"limit": 50 "limit": 50
} }
}
],
"title": "Build node",
"type": "bargauge"
},
{
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
}
},
"mappings": [],
"unit": "s"
}, },
"overrides": [
{
"matcher": {
"id": "byName",
"options": "packages_processing"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "yellow",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "logs_processing"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "orange",
"mode": "fixed"
}
}
]
}
]
},
"gridPos": {
"h": 8,
"w": 8,
"x": 16,
"y": 4
},
"id": 14,
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"showLegend": true,
"values": [
"value"
]
},
"pieType": "pie",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "9.3.2",
"targets": [
{ {
"cacheDurationSeconds": 300,
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "${DS_POSTGRESQL}" "uid": "${DS_POSTGRESQL}"
}, },
"editorMode": "code", "editorMode": "code",
"fields": [
{
"jsonPath": ""
}
],
"format": "table", "format": "table",
"method": "GET", "hide": false,
"queryParams": "",
"rawQuery": true, "rawQuery": true,
"rawSql": "SELECT end_ts - start_ts as logs_processing\nFROM web_node_stats \nWHERE build_task_id = $build_task and stat_name_id = 1", "rawSql": "SELECT end_ts - start_ts as logs_processing\nFROM web_node_stats \nWHERE build_task_id = $build_task and stat_name_id = 1",
"refId": "logs_processing", "refId": "logs_processing",
@ -653,8 +469,7 @@
} }
], ],
"limit": 50 "limit": 50
}, }
"urlPath": ""
}, },
{ {
"datasource": { "datasource": {
@ -686,8 +501,8 @@
} }
} }
], ],
"title": "Web node", "title": "Task duration",
"type": "piechart" "type": "bargauge"
}, },
{ {
"collapsed": false, "collapsed": false,
@ -746,6 +561,30 @@
"value": "s" "value": "s"
} }
] ]
},
{
"matcher": {
"id": "byName",
"options": "finished"
},
"properties": [
{
"id": "custom.width",
"value": 235
}
]
},
{
"matcher": {
"id": "byName",
"options": "started"
},
"properties": [
{
"id": "custom.width",
"value": 205
}
]
} }
] ]
}, },
@ -765,7 +604,8 @@
"show": false "show": false
}, },
"frameIndex": 1, "frameIndex": 1,
"showHeader": true "showHeader": true,
"sortBy": []
}, },
"pluginVersion": "9.3.2", "pluginVersion": "9.3.2",
"targets": [ "targets": [
@ -872,6 +712,18 @@
"value": "s" "value": "s"
} }
] ]
},
{
"matcher": {
"id": "byName",
"options": "started"
},
"properties": [
{
"id": "custom.width",
"value": 200
}
]
} }
] ]
}, },
@ -895,7 +747,7 @@
"sortBy": [ "sortBy": [
{ {
"desc": true, "desc": true,
"displayName": "started" "displayName": "duration"
} }
] ]
}, },
@ -959,6 +811,287 @@
} }
], ],
"type": "table" "type": "table"
},
{
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"displayMode": "auto",
"filterable": true,
"inspect": true
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "duration"
},
"properties": [
{
"id": "unit",
"value": "s"
}
]
}
]
},
"gridPos": {
"h": 11,
"w": 24,
"x": 0,
"y": 29
},
"id": 6,
"options": {
"footer": {
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"frameIndex": 1,
"showHeader": true,
"sortBy": [
{
"desc": true,
"displayName": "finished"
}
]
},
"pluginVersion": "9.3.2",
"targets": [
{
"cacheDurationSeconds": 300,
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"editorMode": "code",
"fields": [
{
"jsonPath": ""
}
],
"format": "table",
"method": "GET",
"queryParams": "",
"rawQuery": true,
"rawSql": "SELECT enum.value,\n stats.start_ts * 1000 AS started,\n stats.end_ts * 1000 AS finished,\n stats.end_ts - stats.start_ts AS duration\nFROM build_node_stats AS stats\nINNER JOIN build_node_stats_enum AS enum\n ON stats.stat_name_id = enum.id\nWHERE build_task_id = $build_task",
"refId": "web node stats",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
},
"urlPath": ""
}
],
"title": "Build node stats",
"transformations": [
{
"id": "convertFieldType",
"options": {
"conversions": [
{
"destinationType": "time",
"targetField": "started"
},
{
"destinationType": "time",
"targetField": "finished"
}
],
"fields": {}
}
}
],
"type": "table"
},
{
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"fixedColor": "blue",
"mode": "fixed"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "s"
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 17,
"x": 3,
"y": 40
},
"id": 14,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "9.3.2",
"targets": [
{
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT\n bt.finished_at - bt.started_at AS task_duration \nFROM build_tasks AS bt\nWHERE bt.id = $build_task;",
"refId": "task_duration",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
},
{
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"editorMode": "code",
"format": "table",
"hide": false,
"rawQuery": true,
"rawSql": "SELECT \n stats.end_ts - stats.start_ts AS web_node_duration\nFROM web_node_stats AS stats\nWHERE build_task_id = $build_task and stat_name_id=0;",
"refId": "web_node_duration",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
},
{
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"editorMode": "code",
"format": "table",
"hide": false,
"rawQuery": true,
"rawSql": "SELECT \n stats.end_ts - stats.start_ts AS build_node_duration\nFROM build_node_stats AS stats\nWHERE build_task_id = $build_task AND stat_name_id=6",
"refId": "build_node_duration",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
},
{
"datasource": {
"type": "__expr__",
"uid": "${DS_EXPRESSION}"
},
"expression": "$task_duration - ($web_node_duration + $build_node_duration)",
"hide": false,
"refId": "Not accounted duration",
"type": "math"
}
],
"title": "Diff",
"type": "stat"
} }
], ],
"schemaVersion": 37, "schemaVersion": 37,
@ -972,32 +1105,13 @@
"type": "postgres", "type": "postgres",
"uid": "${DS_POSTGRESQL}" "uid": "${DS_POSTGRESQL}"
}, },
"definition": "SELECT id \nFROM builds\nORDER BY id DESC;", "definition": "SELECT id from build_tasks ORDER BY id",
"hide": 0,
"includeAll": false,
"multi": false,
"name": "build",
"options": [],
"query": "SELECT id \nFROM builds\nORDER BY id DESC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"current": {},
"datasource": {
"type": "postgres",
"uid": "${DS_POSTGRESQL}"
},
"definition": "SELECT id from build_tasks where build_id = $build",
"hide": 0, "hide": 0,
"includeAll": false, "includeAll": false,
"multi": false, "multi": false,
"name": "build_task", "name": "build_task",
"options": [], "options": [],
"query": "SELECT id from build_tasks where build_id = $build", "query": "SELECT id from build_tasks ORDER BY id",
"refresh": 1, "refresh": 1,
"regex": "", "regex": "",
"skipUrlSync": false, "skipUrlSync": false,
@ -1014,6 +1128,6 @@
"timezone": "", "timezone": "",
"title": "Build task details", "title": "Build task details",
"uid": "vtQClqxVk", "uid": "vtQClqxVk",
"version": 19, "version": 27,
"weekStart": "" "weekStart": ""
} }