From 25f043f9bc56156c59920fc6a361feb913e55204 Mon Sep 17 00:00:00 2001 From: Susana Cardoso Ferreira Date: Wed, 3 Sep 2025 18:32:23 +0000 Subject: [PATCH 1/6] feat: update prebuilds dashboard with build time metrics --- .../dashboards/_dashboards_prebuilds.json.tpl | 714 ++++++++++------- compiled/resources.yaml | 726 +++++++++++------- 2 files changed, 912 insertions(+), 528 deletions(-) diff --git a/coder-observability/templates/dashboards/_dashboards_prebuilds.json.tpl b/coder-observability/templates/dashboards/_dashboards_prebuilds.json.tpl index 938b501..df2e405 100644 --- a/coder-observability/templates/dashboards/_dashboards_prebuilds.json.tpl +++ b/coder-observability/templates/dashboards/_dashboards_prebuilds.json.tpl @@ -19,107 +19,9 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 10, + "id": 132, "links": [], "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [ - { - "options": { - "0": { - "color": "orange", - "index": 2, - "text": "Not enabled" - }, - "1": { - "color": "green", - "index": 0, - "text": "Enabled" - } - }, - "type": "value" - }, - { - "options": { - "match": "null", - "result": { - "color": "orange", - "index": 1, - "text": "Not enabled" - } - }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 0, - "y": 0 - }, - "id": 15, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": { - "valueSize": 15 - }, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "10.4.3", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "min(coderd_experiments{experiment=\"workspace-prebuilds\"})", - "instant": true, - "legendFormat": "__auto", - "range": false, - "refId": "A" - } - ], - "title": "Experiment enabled?", - "type": "stat" - }, { "datasource": { "type": "prometheus", @@ -137,7 +39,7 @@ "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -151,7 +53,7 @@ "gridPos": { "h": 4, "w": 4, - "x": 4, + "x": 0, "y": 0 }, "id": 49, @@ -161,6 +63,7 @@ "graphMode": "area", "justifyMode": "center", "orientation": "vertical", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -172,8 +75,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "10.4.3", - "repeatDirection": "v", + "pluginVersion": "12.1.0", "targets": [ { "datasource": { @@ -241,7 +143,7 @@ "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -255,7 +157,7 @@ "gridPos": { "h": 4, "w": 4, - "x": 8, + "x": 4, "y": 0 }, "id": 48, @@ -265,6 +167,7 @@ "graphMode": "area", "justifyMode": "center", "orientation": "vertical", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -276,8 +179,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "10.4.3", - "repeatDirection": "v", + "pluginVersion": "12.1.0", "targets": [ { "datasource": { @@ -329,6 +231,7 @@ "type": "stat" }, { + "collapsed": false, "gridPos": { "h": 1, "w": 24, @@ -337,9 +240,8 @@ }, "id": 2, "panels": [], - "repeat": "template", - "repeatDirection": "h", - "title": "$template", + "repeat": "preset", + "title": "$preset", "type": "row" }, { @@ -347,6 +249,7 @@ "type": "prometheus", "uid": "prometheus" }, + "description": "", "fieldConfig": { "defaults": { "color": { @@ -359,7 +262,7 @@ "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -371,18 +274,19 @@ "overrides": [] }, "gridPos": { - "h": 7, - "w": 4, + "h": 3, + "w": 6, "x": 0, "y": 5 }, - "id": 31, + "id": 1, "interval": "30s", "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "vertical", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -394,9 +298,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "10.4.3", - "repeat": "preset", - "repeatDirection": "v", + "pluginVersion": "12.1.0", "targets": [ { "datasource": { @@ -405,12 +307,13 @@ }, "editorMode": "code", "exemplar": false, - "expr": "max(coderd_prebuilt_workspaces_desired{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", + "expr": "max(coderd_prebuilt_workspaces_created_total{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", + "hide": false, "instant": true, "interval": "", - "legendFormat": "Desired", + "legendFormat": "Created", "range": false, - "refId": "A" + "refId": "B" }, { "datasource": { @@ -419,13 +322,13 @@ }, "editorMode": "code", "exemplar": false, - "expr": "max(coderd_prebuilt_workspaces_running{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", + "expr": "max(coderd_prebuilt_workspaces_failed_total{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", "hide": false, "instant": true, "interval": "", - "legendFormat": "Running", + "legendFormat": "Failed", "range": false, - "refId": "D" + "refId": "C" }, { "datasource": { @@ -434,16 +337,16 @@ }, "editorMode": "code", "exemplar": false, - "expr": "max(coderd_prebuilt_workspaces_eligible{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", + "expr": "max(coderd_prebuilt_workspaces_claimed_total{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", "hide": false, "instant": true, "interval": "", - "legendFormat": "Eligible", + "legendFormat": "Claimed", "range": false, - "refId": "E" + "refId": "A" } ], - "title": "Current: $preset", + "title": "All Time: $preset", "type": "stat" }, { @@ -465,8 +368,9 @@ "axisSoftMax": 10, "axisSoftMin": 0, "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", - "fillOpacity": 18, + "fillOpacity": 13, "gradientMode": "none", "hideFrom": { "legend": false, @@ -501,7 +405,7 @@ "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -514,33 +418,45 @@ { "matcher": { "id": "byName", - "options": "Desired" + "options": "Failed" }, "properties": [ { "id": "color", "value": { - "fixedColor": "purple", + "fixedColor": "red", "mode": "fixed" } - }, + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Created" + }, + "properties": [ { - "id": "custom.lineStyle", + "id": "color", "value": { - "dash": [ - 10, - 10 - ], - "fill": "dash" + "fixedColor": "blue", + "mode": "fixed" } - }, - { - "id": "custom.fillOpacity", - "value": 85 - }, + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Desired" + }, + "properties": [ { - "id": "custom.fillBelowTo", - "value": "Running" + "id": "color", + "value": { + "fixedColor": "purple", + "mode": "fixed" + } } ] }, @@ -556,10 +472,6 @@ "fixedColor": "yellow", "mode": "fixed" } - }, - { - "id": "custom.fillBelowTo", - "value": "Eligible" } ] }, @@ -577,16 +489,31 @@ } } ] + }, + { + "matcher": { + "id": "byName", + "options": "Claimed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-green", + "mode": "fixed" + } + } + ] } ] }, "gridPos": { - "h": 7, - "w": 8, - "x": 4, + "h": 6, + "w": 9, + "x": 6, "y": 5 }, - "id": 5, + "id": 38, "options": { "legend": { "calcs": [], @@ -595,13 +522,12 @@ "showLegend": true }, "tooltip": { + "hideZeros": false, "mode": "single", "sort": "none" } }, - "pluginVersion": "10.4.3", - "repeat": "preset", - "repeatDirection": "v", + "pluginVersion": "12.1.0", "targets": [ { "datasource": { @@ -609,12 +535,13 @@ "uid": "prometheus" }, "editorMode": "code", - "expr": "max(coderd_prebuilt_workspaces_desired{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", + "expr": "floor(max(increase(coderd_prebuilt_workspaces_created_total{template_name=~\"$template\", preset_name=~\"$preset\"}[$__rate_interval]))) or vector(0)", + "hide": false, "instant": false, "interval": "", - "legendFormat": "Desired", + "legendFormat": "Created", "range": true, - "refId": "A" + "refId": "B" }, { "datasource": { @@ -622,13 +549,13 @@ "uid": "prometheus" }, "editorMode": "code", - "expr": "max(coderd_prebuilt_workspaces_running{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", + "expr": "floor(max(increase(coderd_prebuilt_workspaces_failed_total{template_name=~\"$template\", preset_name=~\"$preset\"}[$__rate_interval]))) or vector(0)", "hide": false, "instant": false, "interval": "", - "legendFormat": "Running", + "legendFormat": "Failed", "range": true, - "refId": "D" + "refId": "C" }, { "datasource": { @@ -636,16 +563,16 @@ "uid": "prometheus" }, "editorMode": "code", - "expr": "max(coderd_prebuilt_workspaces_eligible{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", + "expr": "floor(max(increase(coderd_prebuilt_workspaces_claimed_total{template_name=~\"$template\", preset_name=~\"$preset\"}[$__rate_interval]))) or vector(0)", "hide": false, "instant": false, "interval": "", - "legendFormat": "Eligible", + "legendFormat": "Claimed", "range": true, - "refId": "E" + "refId": "F" } ], - "title": "Pool Capacity: $preset", + "title": "Pool Operations: $preset", "type": "timeseries" }, { @@ -667,8 +594,9 @@ "axisSoftMax": 10, "axisSoftMin": 0, "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", - "fillOpacity": 13, + "fillOpacity": 18, "gradientMode": "none", "hideFrom": { "legend": false, @@ -703,7 +631,7 @@ "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -716,45 +644,33 @@ { "matcher": { "id": "byName", - "options": "Failed" + "options": "Desired" }, "properties": [ { "id": "color", "value": { - "fixedColor": "red", + "fixedColor": "purple", "mode": "fixed" } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Created" - }, - "properties": [ + }, { - "id": "color", + "id": "custom.lineStyle", "value": { - "fixedColor": "blue", - "mode": "fixed" + "dash": [ + 10, + 10 + ], + "fill": "dash" } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Desired" - }, - "properties": [ + }, { - "id": "color", - "value": { - "fixedColor": "purple", - "mode": "fixed" - } + "id": "custom.fillOpacity", + "value": 85 + }, + { + "id": "custom.fillBelowTo", + "value": "Running" } ] }, @@ -770,6 +686,10 @@ "fixedColor": "yellow", "mode": "fixed" } + }, + { + "id": "custom.fillBelowTo", + "value": "Eligible" } ] }, @@ -787,31 +707,16 @@ } } ] - }, - { - "matcher": { - "id": "byName", - "options": "Claimed" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "dark-green", - "mode": "fixed" - } - } - ] } ] }, "gridPos": { - "h": 7, - "w": 8, - "x": 12, + "h": 6, + "w": 9, + "x": 15, "y": 5 }, - "id": 38, + "id": 5, "options": { "legend": { "calcs": [], @@ -820,13 +725,12 @@ "showLegend": true }, "tooltip": { + "hideZeros": false, "mode": "single", "sort": "none" } }, - "pluginVersion": "10.4.3", - "repeat": "preset", - "repeatDirection": "v", + "pluginVersion": "12.1.0", "targets": [ { "datasource": { @@ -834,13 +738,12 @@ "uid": "prometheus" }, "editorMode": "code", - "expr": "floor(max(increase(coderd_prebuilt_workspaces_created_total{template_name=~\"$template\", preset_name=~\"$preset\"}[$__rate_interval]))) or vector(0)", - "hide": false, + "expr": "max(coderd_prebuilt_workspaces_desired{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", "instant": false, "interval": "", - "legendFormat": "Created", + "legendFormat": "Desired", "range": true, - "refId": "B" + "refId": "A" }, { "datasource": { @@ -848,13 +751,13 @@ "uid": "prometheus" }, "editorMode": "code", - "expr": "floor(max(increase(coderd_prebuilt_workspaces_failed_total{template_name=~\"$template\", preset_name=~\"$preset\"}[$__rate_interval]))) or vector(0)", + "expr": "max(coderd_prebuilt_workspaces_running{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", "hide": false, "instant": false, "interval": "", - "legendFormat": "Failed", + "legendFormat": "Running", "range": true, - "refId": "C" + "refId": "D" }, { "datasource": { @@ -862,16 +765,16 @@ "uid": "prometheus" }, "editorMode": "code", - "expr": "floor(max(increase(coderd_prebuilt_workspaces_claimed_total{template_name=~\"$template\", preset_name=~\"$preset\"}[$__rate_interval]))) or vector(0)", + "expr": "max(coderd_prebuilt_workspaces_eligible{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", "hide": false, "instant": false, "interval": "", - "legendFormat": "Claimed", + "legendFormat": "Eligible", "range": true, - "refId": "F" + "refId": "E" } ], - "title": "Pool Operations: $preset", + "title": "Pool Capacity: $preset", "type": "timeseries" }, { @@ -879,7 +782,6 @@ "type": "prometheus", "uid": "prometheus" }, - "description": "", "fieldConfig": { "defaults": { "color": { @@ -892,7 +794,7 @@ "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -904,18 +806,19 @@ "overrides": [] }, "gridPos": { - "h": 7, - "w": 4, - "x": 20, - "y": 5 + "h": 3, + "w": 6, + "x": 0, + "y": 8 }, - "id": 1, + "id": 31, "interval": "30s", "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "vertical", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -927,9 +830,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "10.4.3", - "repeat": "preset", - "repeatDirection": "v", + "pluginVersion": "12.1.0", "targets": [ { "datasource": { @@ -938,13 +839,12 @@ }, "editorMode": "code", "exemplar": false, - "expr": "max(coderd_prebuilt_workspaces_created_total{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", - "hide": false, + "expr": "max(coderd_prebuilt_workspaces_desired{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", "instant": true, "interval": "", - "legendFormat": "Created", + "legendFormat": "Desired", "range": false, - "refId": "B" + "refId": "A" }, { "datasource": { @@ -953,13 +853,13 @@ }, "editorMode": "code", "exemplar": false, - "expr": "max(coderd_prebuilt_workspaces_failed_total{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", + "expr": "max(coderd_prebuilt_workspaces_running{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", "hide": false, "instant": true, "interval": "", - "legendFormat": "Failed", + "legendFormat": "Running", "range": false, - "refId": "C" + "refId": "D" }, { "datasource": { @@ -968,35 +868,328 @@ }, "editorMode": "code", "exemplar": false, - "expr": "max(coderd_prebuilt_workspaces_claimed_total{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", + "expr": "max(coderd_prebuilt_workspaces_eligible{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", "hide": false, "instant": true, "interval": "", - "legendFormat": "Claimed", + "legendFormat": "Eligible", "range": false, + "refId": "E" + } + ], + "title": "Current: $preset", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "description": "Compares the total number of regular workspace creations to prebuilt workspace claims to date.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 6, + "x": 0, + "y": 11 + }, + "id": 51, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value_and_name", + "wideLayout": true + }, + "pluginVersion": "12.1.0", + "targets": [ + { + "editorMode": "code", + "exemplar": false, + "expr": "sum(max by (template_name, preset_name) (\n coderd_workspace_creation_total{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n)) or vector(0)", + "instant": false, + "legendFormat": "Regular workspaces created", + "range": true, "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "sum(max by (template_name, preset_name) (\n coderd_prebuilt_workspaces_claimed_total{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n)) or vector(0)\n", + "hide": false, + "instant": false, + "legendFormat": "Prebuild workspaces claimed", + "range": true, + "refId": "B" } ], - "title": "All Time: $preset", + "title": "All Time: Regular vs Prebuild", "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "description": "Average seconds to:\n* Create a regular workspace\n* Create a prebuilt workspace into the pool\n* Claim a prebuilt workspace from the pool", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 9, + "x": 6, + "y": 11 + }, + "id": 52, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.1.0", + "targets": [ + { + "editorMode": "code", + "exemplar": false, + "expr": "# Native Histogram\nhistogram_avg(\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"regular\"\n }\n )\n) \nor\n# Classic Histogram\nmax(\n coderd_workspace_creation_duration_seconds_sum{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"regular\"\n }\n) / \nmax(\n coderd_workspace_creation_duration_seconds_count{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"regular\"\n }\n)\nor vector(0)", + "instant": true, + "legendFormat": "Regular Creation", + "range": false, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "exemplar": false, + "expr": "# Native Histogram\nhistogram_avg(\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n )\n) \nor\n# Classic Histogram\nmax(\n coderd_workspace_creation_duration_seconds_sum{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n) / \nmax(\n coderd_workspace_creation_duration_seconds_count{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n)\nor vector(0)", + "hide": false, + "instant": true, + "legendFormat": "Prebuild Creation", + "range": false, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "exemplar": false, + "expr": "# Native Histogram\nhistogram_avg(\n sum(\n coderd_prebuilt_workspace_claim_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n )\n) \nor\n# Classic Histogram\nmax(\n coderd_prebuilt_workspace_claim_duration_seconds_sum{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n) / \nmax(\n coderd_prebuilt_workspace_claim_duration_seconds_count{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n)\nor vector(0)", + "hide": false, + "instant": true, + "legendFormat": "Prebuild Claim", + "range": false, + "refId": "C" + } + ], + "title": "Regular vs Prebuild Times (Avg)", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "description": "Side-by-side comparison of prebuild creation and prebuild claim times", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "dash": [ + 10, + 10 + ], + "fill": "dash" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 9, + "x": 15, + "y": 11 + }, + "id": 50, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.1.0", + "targets": [ + { + "editorMode": "code", + "expr": "histogram_avg(\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n )\n) or vector(0)", + "legendFormat": "Build into Pool", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "histogram_avg(\n sum(\n coderd_prebuilt_workspace_claim_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n )\n) or vector(0)", + "hide": false, + "instant": false, + "legendFormat": "Claim", + "range": true, + "refId": "B" + } + ], + "title": "Prebuild: Create vs Claim (Avg)", + "type": "timeseries" } ], + "preload": false, "refresh": "{{- include "dashboard-refresh" . -}}", - "schemaVersion": 39, + "schemaVersion": 41, "tags": [], "templating": { "list": [ { - "allValue": "", + "current": { + "text": "coder", + "value": "coder" + }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "definition": "label_values(coderd_prebuilt_workspaces_desired,template_name)", - "hide": 0, "includeAll": false, "label": "Template", - "multi": false, "name": "template", "options": [], "query": { @@ -1006,18 +1199,20 @@ }, "refresh": 1, "regex": "", - "skipUrlSync": false, - "sort": 0, "type": "query" }, { - "allValue": "", + "current": { + "text": "All", + "value": [ + "$__all" + ] + }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "definition": "label_values(coderd_prebuilt_workspaces_desired{template_name=~\"$template\"},preset_name)", - "hide": 0, "includeAll": true, "label": "Preset", "multi": true, @@ -1030,8 +1225,6 @@ }, "refresh": 1, "regex": "", - "skipUrlSync": false, - "sort": 0, "type": "query" } ] @@ -1044,7 +1237,6 @@ "timezone": "browser", "title": "Prebuilds", "uid": "cej6jysyme22oa", - "version": 13, - "weekStart": "" + "version": 5 } {{ end }} \ No newline at end of file diff --git a/compiled/resources.yaml b/compiled/resources.yaml index ebd6f94..c0eb9cb 100644 --- a/compiled/resources.yaml +++ b/compiled/resources.yaml @@ -2529,107 +2529,9 @@ data: "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 10, + "id": 132, "links": [], "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [ - { - "options": { - "0": { - "color": "orange", - "index": 2, - "text": "Not enabled" - }, - "1": { - "color": "green", - "index": 0, - "text": "Enabled" - } - }, - "type": "value" - }, - { - "options": { - "match": "null", - "result": { - "color": "orange", - "index": 1, - "text": "Not enabled" - } - }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 0, - "y": 0 - }, - "id": 15, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": { - "valueSize": 15 - }, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "10.4.3", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "min(coderd_experiments{experiment=\"workspace-prebuilds\"})", - "instant": true, - "legendFormat": "__auto", - "range": false, - "refId": "A" - } - ], - "title": "Experiment enabled?", - "type": "stat" - }, { "datasource": { "type": "prometheus", @@ -2647,7 +2549,7 @@ data: "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -2661,7 +2563,7 @@ data: "gridPos": { "h": 4, "w": 4, - "x": 4, + "x": 0, "y": 0 }, "id": 49, @@ -2671,6 +2573,7 @@ data: "graphMode": "area", "justifyMode": "center", "orientation": "vertical", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -2682,8 +2585,7 @@ data: "textMode": "auto", "wideLayout": true }, - "pluginVersion": "10.4.3", - "repeatDirection": "v", + "pluginVersion": "12.1.0", "targets": [ { "datasource": { @@ -2751,7 +2653,7 @@ data: "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -2765,7 +2667,7 @@ data: "gridPos": { "h": 4, "w": 4, - "x": 8, + "x": 4, "y": 0 }, "id": 48, @@ -2775,6 +2677,7 @@ data: "graphMode": "area", "justifyMode": "center", "orientation": "vertical", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -2786,8 +2689,7 @@ data: "textMode": "auto", "wideLayout": true }, - "pluginVersion": "10.4.3", - "repeatDirection": "v", + "pluginVersion": "12.1.0", "targets": [ { "datasource": { @@ -2839,6 +2741,7 @@ data: "type": "stat" }, { + "collapsed": false, "gridPos": { "h": 1, "w": 24, @@ -2847,9 +2750,8 @@ data: }, "id": 2, "panels": [], - "repeat": "template", - "repeatDirection": "h", - "title": "$template", + "repeat": "preset", + "title": "$preset", "type": "row" }, { @@ -2857,6 +2759,7 @@ data: "type": "prometheus", "uid": "prometheus" }, + "description": "", "fieldConfig": { "defaults": { "color": { @@ -2869,7 +2772,7 @@ data: "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -2881,18 +2784,19 @@ data: "overrides": [] }, "gridPos": { - "h": 7, - "w": 4, + "h": 3, + "w": 6, "x": 0, "y": 5 }, - "id": 31, + "id": 1, "interval": "30s", "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "vertical", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -2904,9 +2808,7 @@ data: "textMode": "auto", "wideLayout": true }, - "pluginVersion": "10.4.3", - "repeat": "preset", - "repeatDirection": "v", + "pluginVersion": "12.1.0", "targets": [ { "datasource": { @@ -2915,12 +2817,13 @@ data: }, "editorMode": "code", "exemplar": false, - "expr": "max(coderd_prebuilt_workspaces_desired{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", + "expr": "max(coderd_prebuilt_workspaces_created_total{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", + "hide": false, "instant": true, "interval": "", - "legendFormat": "Desired", + "legendFormat": "Created", "range": false, - "refId": "A" + "refId": "B" }, { "datasource": { @@ -2929,13 +2832,13 @@ data: }, "editorMode": "code", "exemplar": false, - "expr": "max(coderd_prebuilt_workspaces_running{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", + "expr": "max(coderd_prebuilt_workspaces_failed_total{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", "hide": false, "instant": true, "interval": "", - "legendFormat": "Running", + "legendFormat": "Failed", "range": false, - "refId": "D" + "refId": "C" }, { "datasource": { @@ -2944,16 +2847,16 @@ data: }, "editorMode": "code", "exemplar": false, - "expr": "max(coderd_prebuilt_workspaces_eligible{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", + "expr": "max(coderd_prebuilt_workspaces_claimed_total{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", "hide": false, "instant": true, "interval": "", - "legendFormat": "Eligible", + "legendFormat": "Claimed", "range": false, - "refId": "E" + "refId": "A" } ], - "title": "Current: $preset", + "title": "All Time: $preset", "type": "stat" }, { @@ -2975,8 +2878,9 @@ data: "axisSoftMax": 10, "axisSoftMin": 0, "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", - "fillOpacity": 18, + "fillOpacity": 13, "gradientMode": "none", "hideFrom": { "legend": false, @@ -3011,7 +2915,7 @@ data: "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -3024,33 +2928,45 @@ data: { "matcher": { "id": "byName", - "options": "Desired" + "options": "Failed" }, "properties": [ { "id": "color", "value": { - "fixedColor": "purple", + "fixedColor": "red", "mode": "fixed" } - }, + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Created" + }, + "properties": [ { - "id": "custom.lineStyle", + "id": "color", "value": { - "dash": [ - 10, - 10 - ], - "fill": "dash" + "fixedColor": "blue", + "mode": "fixed" } - }, - { - "id": "custom.fillOpacity", - "value": 85 - }, + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Desired" + }, + "properties": [ { - "id": "custom.fillBelowTo", - "value": "Running" + "id": "color", + "value": { + "fixedColor": "purple", + "mode": "fixed" + } } ] }, @@ -3066,10 +2982,6 @@ data: "fixedColor": "yellow", "mode": "fixed" } - }, - { - "id": "custom.fillBelowTo", - "value": "Eligible" } ] }, @@ -3087,16 +2999,31 @@ data: } } ] + }, + { + "matcher": { + "id": "byName", + "options": "Claimed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-green", + "mode": "fixed" + } + } + ] } ] }, "gridPos": { - "h": 7, - "w": 8, - "x": 4, + "h": 6, + "w": 9, + "x": 6, "y": 5 }, - "id": 5, + "id": 38, "options": { "legend": { "calcs": [], @@ -3105,13 +3032,12 @@ data: "showLegend": true }, "tooltip": { + "hideZeros": false, "mode": "single", "sort": "none" } }, - "pluginVersion": "10.4.3", - "repeat": "preset", - "repeatDirection": "v", + "pluginVersion": "12.1.0", "targets": [ { "datasource": { @@ -3119,12 +3045,13 @@ data: "uid": "prometheus" }, "editorMode": "code", - "expr": "max(coderd_prebuilt_workspaces_desired{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", + "expr": "floor(max(increase(coderd_prebuilt_workspaces_created_total{template_name=~\"$template\", preset_name=~\"$preset\"}[$__rate_interval]))) or vector(0)", + "hide": false, "instant": false, "interval": "", - "legendFormat": "Desired", + "legendFormat": "Created", "range": true, - "refId": "A" + "refId": "B" }, { "datasource": { @@ -3132,13 +3059,13 @@ data: "uid": "prometheus" }, "editorMode": "code", - "expr": "max(coderd_prebuilt_workspaces_running{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", + "expr": "floor(max(increase(coderd_prebuilt_workspaces_failed_total{template_name=~\"$template\", preset_name=~\"$preset\"}[$__rate_interval]))) or vector(0)", "hide": false, "instant": false, "interval": "", - "legendFormat": "Running", + "legendFormat": "Failed", "range": true, - "refId": "D" + "refId": "C" }, { "datasource": { @@ -3146,16 +3073,16 @@ data: "uid": "prometheus" }, "editorMode": "code", - "expr": "max(coderd_prebuilt_workspaces_eligible{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", + "expr": "floor(max(increase(coderd_prebuilt_workspaces_claimed_total{template_name=~\"$template\", preset_name=~\"$preset\"}[$__rate_interval]))) or vector(0)", "hide": false, "instant": false, "interval": "", - "legendFormat": "Eligible", + "legendFormat": "Claimed", "range": true, - "refId": "E" + "refId": "F" } ], - "title": "Pool Capacity: $preset", + "title": "Pool Operations: $preset", "type": "timeseries" }, { @@ -3177,8 +3104,9 @@ data: "axisSoftMax": 10, "axisSoftMin": 0, "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", - "fillOpacity": 13, + "fillOpacity": 18, "gradientMode": "none", "hideFrom": { "legend": false, @@ -3213,7 +3141,7 @@ data: "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -3226,60 +3154,52 @@ data: { "matcher": { "id": "byName", - "options": "Failed" + "options": "Desired" }, "properties": [ { "id": "color", "value": { - "fixedColor": "red", + "fixedColor": "purple", "mode": "fixed" } + }, + { + "id": "custom.lineStyle", + "value": { + "dash": [ + 10, + 10 + ], + "fill": "dash" + } + }, + { + "id": "custom.fillOpacity", + "value": 85 + }, + { + "id": "custom.fillBelowTo", + "value": "Running" } ] }, { "matcher": { "id": "byName", - "options": "Created" + "options": "Running" }, "properties": [ { "id": "color", "value": { - "fixedColor": "blue", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Desired" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "purple", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Running" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "yellow", + "fixedColor": "yellow", "mode": "fixed" } + }, + { + "id": "custom.fillBelowTo", + "value": "Eligible" } ] }, @@ -3297,31 +3217,16 @@ data: } } ] - }, - { - "matcher": { - "id": "byName", - "options": "Claimed" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "dark-green", - "mode": "fixed" - } - } - ] } ] }, "gridPos": { - "h": 7, - "w": 8, - "x": 12, + "h": 6, + "w": 9, + "x": 15, "y": 5 }, - "id": 38, + "id": 5, "options": { "legend": { "calcs": [], @@ -3330,13 +3235,12 @@ data: "showLegend": true }, "tooltip": { + "hideZeros": false, "mode": "single", "sort": "none" } }, - "pluginVersion": "10.4.3", - "repeat": "preset", - "repeatDirection": "v", + "pluginVersion": "12.1.0", "targets": [ { "datasource": { @@ -3344,13 +3248,12 @@ data: "uid": "prometheus" }, "editorMode": "code", - "expr": "floor(max(increase(coderd_prebuilt_workspaces_created_total{template_name=~\"$template\", preset_name=~\"$preset\"}[$__rate_interval]))) or vector(0)", - "hide": false, + "expr": "max(coderd_prebuilt_workspaces_desired{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", "instant": false, "interval": "", - "legendFormat": "Created", + "legendFormat": "Desired", "range": true, - "refId": "B" + "refId": "A" }, { "datasource": { @@ -3358,13 +3261,13 @@ data: "uid": "prometheus" }, "editorMode": "code", - "expr": "floor(max(increase(coderd_prebuilt_workspaces_failed_total{template_name=~\"$template\", preset_name=~\"$preset\"}[$__rate_interval]))) or vector(0)", + "expr": "max(coderd_prebuilt_workspaces_running{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", "hide": false, "instant": false, "interval": "", - "legendFormat": "Failed", + "legendFormat": "Running", "range": true, - "refId": "C" + "refId": "D" }, { "datasource": { @@ -3372,16 +3275,16 @@ data: "uid": "prometheus" }, "editorMode": "code", - "expr": "floor(max(increase(coderd_prebuilt_workspaces_claimed_total{template_name=~\"$template\", preset_name=~\"$preset\"}[$__rate_interval]))) or vector(0)", + "expr": "max(coderd_prebuilt_workspaces_eligible{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", "hide": false, "instant": false, "interval": "", - "legendFormat": "Claimed", + "legendFormat": "Eligible", "range": true, - "refId": "F" + "refId": "E" } ], - "title": "Pool Operations: $preset", + "title": "Pool Capacity: $preset", "type": "timeseries" }, { @@ -3389,7 +3292,6 @@ data: "type": "prometheus", "uid": "prometheus" }, - "description": "", "fieldConfig": { "defaults": { "color": { @@ -3402,7 +3304,7 @@ data: "steps": [ { "color": "green", - "value": null + "value": 0 }, { "color": "red", @@ -3414,18 +3316,19 @@ data: "overrides": [] }, "gridPos": { - "h": 7, - "w": 4, - "x": 20, - "y": 5 + "h": 3, + "w": 6, + "x": 0, + "y": 8 }, - "id": 1, + "id": 31, "interval": "30s", "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "vertical", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -3437,9 +3340,7 @@ data: "textMode": "auto", "wideLayout": true }, - "pluginVersion": "10.4.3", - "repeat": "preset", - "repeatDirection": "v", + "pluginVersion": "12.1.0", "targets": [ { "datasource": { @@ -3448,13 +3349,12 @@ data: }, "editorMode": "code", "exemplar": false, - "expr": "max(coderd_prebuilt_workspaces_created_total{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", - "hide": false, + "expr": "max(coderd_prebuilt_workspaces_desired{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", "instant": true, "interval": "", - "legendFormat": "Created", + "legendFormat": "Desired", "range": false, - "refId": "B" + "refId": "A" }, { "datasource": { @@ -3463,13 +3363,13 @@ data: }, "editorMode": "code", "exemplar": false, - "expr": "max(coderd_prebuilt_workspaces_failed_total{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", + "expr": "max(coderd_prebuilt_workspaces_running{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", "hide": false, "instant": true, "interval": "", - "legendFormat": "Failed", + "legendFormat": "Running", "range": false, - "refId": "C" + "refId": "D" }, { "datasource": { @@ -3478,35 +3378,328 @@ data: }, "editorMode": "code", "exemplar": false, - "expr": "max(coderd_prebuilt_workspaces_claimed_total{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", + "expr": "max(coderd_prebuilt_workspaces_eligible{template_name=~\"$template\", preset_name=~\"$preset\"}) or vector(0)", "hide": false, "instant": true, "interval": "", - "legendFormat": "Claimed", + "legendFormat": "Eligible", "range": false, + "refId": "E" + } + ], + "title": "Current: $preset", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "description": "Compares the total number of regular workspace creations to prebuilt workspace claims to date.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 6, + "x": 0, + "y": 11 + }, + "id": 51, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value_and_name", + "wideLayout": true + }, + "pluginVersion": "12.1.0", + "targets": [ + { + "editorMode": "code", + "exemplar": false, + "expr": "sum(max by (template_name, preset_name) (\n coderd_workspace_creation_total{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n)) or vector(0)", + "instant": false, + "legendFormat": "Regular workspaces created", + "range": true, "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "sum(max by (template_name, preset_name) (\n coderd_prebuilt_workspaces_claimed_total{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n)) or vector(0)\n", + "hide": false, + "instant": false, + "legendFormat": "Prebuild workspaces claimed", + "range": true, + "refId": "B" } ], - "title": "All Time: $preset", + "title": "All Time: Regular vs Prebuild", "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "description": "Average seconds to:\n* Create a regular workspace\n* Create a prebuilt workspace into the pool\n* Claim a prebuilt workspace from the pool", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 9, + "x": 6, + "y": 11 + }, + "id": 52, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.1.0", + "targets": [ + { + "editorMode": "code", + "exemplar": false, + "expr": "# Native Histogram\nhistogram_avg(\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"regular\"\n }\n )\n) \nor\n# Classic Histogram\nmax(\n coderd_workspace_creation_duration_seconds_sum{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"regular\"\n }\n) / \nmax(\n coderd_workspace_creation_duration_seconds_count{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"regular\"\n }\n)\nor vector(0)", + "instant": true, + "legendFormat": "Regular Creation", + "range": false, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "exemplar": false, + "expr": "# Native Histogram\nhistogram_avg(\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n )\n) \nor\n# Classic Histogram\nmax(\n coderd_workspace_creation_duration_seconds_sum{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n) / \nmax(\n coderd_workspace_creation_duration_seconds_count{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n)\nor vector(0)", + "hide": false, + "instant": true, + "legendFormat": "Prebuild Creation", + "range": false, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "exemplar": false, + "expr": "# Native Histogram\nhistogram_avg(\n sum(\n coderd_prebuilt_workspace_claim_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n )\n) \nor\n# Classic Histogram\nmax(\n coderd_prebuilt_workspace_claim_duration_seconds_sum{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n) / \nmax(\n coderd_prebuilt_workspace_claim_duration_seconds_count{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n)\nor vector(0)", + "hide": false, + "instant": true, + "legendFormat": "Prebuild Claim", + "range": false, + "refId": "C" + } + ], + "title": "Regular vs Prebuild Times (Avg)", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "description": "Side-by-side comparison of prebuild creation and prebuild claim times", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "dash": [ + 10, + 10 + ], + "fill": "dash" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 9, + "x": 15, + "y": 11 + }, + "id": 50, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.1.0", + "targets": [ + { + "editorMode": "code", + "expr": "histogram_avg(\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n )\n) or vector(0)", + "legendFormat": "Build into Pool", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "histogram_avg(\n sum(\n coderd_prebuilt_workspace_claim_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n )\n) or vector(0)", + "hide": false, + "instant": false, + "legendFormat": "Claim", + "range": true, + "refId": "B" + } + ], + "title": "Prebuild: Create vs Claim (Avg)", + "type": "timeseries" } ], + "preload": false, "refresh": "30s", - "schemaVersion": 39, + "schemaVersion": 41, "tags": [], "templating": { "list": [ { - "allValue": "", + "current": { + "text": "coder", + "value": "coder" + }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "definition": "label_values(coderd_prebuilt_workspaces_desired,template_name)", - "hide": 0, "includeAll": false, "label": "Template", - "multi": false, "name": "template", "options": [], "query": { @@ -3516,18 +3709,20 @@ data: }, "refresh": 1, "regex": "", - "skipUrlSync": false, - "sort": 0, "type": "query" }, { - "allValue": "", + "current": { + "text": "All", + "value": [ + "$__all" + ] + }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "definition": "label_values(coderd_prebuilt_workspaces_desired{template_name=~\"$template\"},preset_name)", - "hide": 0, "includeAll": true, "label": "Preset", "multi": true, @@ -3540,8 +3735,6 @@ data: }, "refresh": 1, "regex": "", - "skipUrlSync": false, - "sort": 0, "type": "query" } ] @@ -3554,8 +3747,7 @@ data: "timezone": "browser", "title": "Prebuilds", "uid": "cej6jysyme22oa", - "version": 13, - "weekStart": "" + "version": 5 } --- # Source: coder-observability/templates/dashboards/configmap-dashboards-provisionerd.yaml From 308d51d7bca3ff62db4312494efc425dc3002180 Mon Sep 17 00:00:00 2001 From: Susana Cardoso Ferreira Date: Thu, 4 Sep 2025 14:41:08 +0000 Subject: [PATCH 2/6] chore: address comments --- .../dashboards/_dashboards_prebuilds.json.tpl | 308 +++++++++++++++--- 1 file changed, 258 insertions(+), 50 deletions(-) diff --git a/coder-observability/templates/dashboards/_dashboards_prebuilds.json.tpl b/coder-observability/templates/dashboards/_dashboards_prebuilds.json.tpl index df2e405..f5e065b 100644 --- a/coder-observability/templates/dashboards/_dashboards_prebuilds.json.tpl +++ b/coder-observability/templates/dashboards/_dashboards_prebuilds.json.tpl @@ -909,7 +909,7 @@ "overrides": [] }, "gridPos": { - "h": 5, + "h": 3, "w": 6, "x": 0, "y": 11 @@ -952,12 +952,12 @@ "expr": "sum(max by (template_name, preset_name) (\n coderd_prebuilt_workspaces_claimed_total{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n)) or vector(0)\n", "hide": false, "instant": false, - "legendFormat": "Prebuild workspaces claimed", + "legendFormat": "Prebuilt workspaces claimed", "range": true, "refId": "B" } ], - "title": "All Time: Regular vs Prebuild", + "title": "All Time: Regular vs Prebuilt", "type": "stat" }, { @@ -965,11 +965,51 @@ "type": "prometheus", "uid": "prometheus" }, - "description": "Average seconds to:\n* Create a regular workspace\n* Create a prebuilt workspace into the pool\n* Claim a prebuilt workspace from the pool", + "description": "Median (p50) build time in seconds for Regular Workspace Creation, Prebuilt Workspace Creation, and Prebuilt Workspace Claim", "fieldConfig": { "defaults": { "color": { - "mode": "thresholds" + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "dash": [ + 10, + 10 + ], + "fill": "dash" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } }, "mappings": [], "thresholds": { @@ -984,45 +1024,83 @@ "value": 80 } ] - }, - "unit": "s" + } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Regular Creation" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Prebuild Creation" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Prebuilt Claim" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + } + ] }, "gridPos": { - "h": 5, + "h": 6, "w": 9, "x": 6, "y": 11 }, - "id": 52, + "id": 50, "options": { - "colorMode": "none", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } }, "pluginVersion": "12.1.0", "targets": [ { "editorMode": "code", - "exemplar": false, - "expr": "# Native Histogram\nhistogram_avg(\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"regular\"\n }\n )\n) \nor\n# Classic Histogram\nmax(\n coderd_workspace_creation_duration_seconds_sum{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"regular\"\n }\n) / \nmax(\n coderd_workspace_creation_duration_seconds_count{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"regular\"\n }\n)\nor vector(0)", - "instant": true, + "expr": "histogram_quantile(0.5,\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"regular\"\n }\n )\n)\nor vector(0)", "legendFormat": "Regular Creation", - "range": false, + "range": true, "refId": "A" }, { @@ -1031,12 +1109,11 @@ "uid": "prometheus" }, "editorMode": "code", - "exemplar": false, - "expr": "# Native Histogram\nhistogram_avg(\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n )\n) \nor\n# Classic Histogram\nmax(\n coderd_workspace_creation_duration_seconds_sum{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n) / \nmax(\n coderd_workspace_creation_duration_seconds_count{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n)\nor vector(0)", + "expr": "histogram_quantile(0.5,\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n )\n)\nor vector(0)", "hide": false, - "instant": true, + "instant": false, "legendFormat": "Prebuild Creation", - "range": false, + "range": true, "refId": "B" }, { @@ -1045,24 +1122,23 @@ "uid": "prometheus" }, "editorMode": "code", - "exemplar": false, - "expr": "# Native Histogram\nhistogram_avg(\n sum(\n coderd_prebuilt_workspace_claim_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n )\n) \nor\n# Classic Histogram\nmax(\n coderd_prebuilt_workspace_claim_duration_seconds_sum{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n) / \nmax(\n coderd_prebuilt_workspace_claim_duration_seconds_count{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n)\nor vector(0)", + "expr": "histogram_quantile(0.5,\n sum(\n coderd_prebuilt_workspace_claim_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n )\n)\nor vector(0)", "hide": false, - "instant": true, - "legendFormat": "Prebuild Claim", - "range": false, + "instant": false, + "legendFormat": "Prebuilt Claim", + "range": true, "refId": "C" } ], - "title": "Regular vs Prebuild Times (Avg)", - "type": "stat" + "title": "Workspace Build Latency p50", + "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, - "description": "Side-by-side comparison of prebuild creation and prebuild claim times", + "description": "95th-percentile (p95) build time in seconds for Regular Workspace Creation, Prebuilt Workspace Creation, and Prebuilt Workspace Claim.", "fieldConfig": { "defaults": { "color": { @@ -1123,15 +1199,61 @@ ] } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Regular Creation" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Prebuild Creation" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Prebuilt Claim" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + } + ] }, "gridPos": { - "h": 5, + "h": 6, "w": 9, "x": 15, "y": 11 }, - "id": 50, + "id": 53, "options": { "legend": { "calcs": [], @@ -1149,8 +1271,8 @@ "targets": [ { "editorMode": "code", - "expr": "histogram_avg(\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n )\n) or vector(0)", - "legendFormat": "Build into Pool", + "expr": "histogram_quantile(0.95,\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"regular\"\n }\n )\n)\nor vector(0)", + "legendFormat": "Regular Creation", "range": true, "refId": "A" }, @@ -1160,16 +1282,100 @@ "uid": "prometheus" }, "editorMode": "code", - "expr": "histogram_avg(\n sum(\n coderd_prebuilt_workspace_claim_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n )\n) or vector(0)", + "expr": "histogram_quantile(0.95,\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n )\n)\nor vector(0)", "hide": false, "instant": false, - "legendFormat": "Claim", + "legendFormat": "Prebuild Creation", "range": true, "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "histogram_quantile(0.95,\n sum(\n coderd_prebuilt_workspace_claim_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n )\n)\nor vector(0)", + "hide": false, + "instant": false, + "legendFormat": "Prebuilt Claim", + "range": true, + "refId": "C" } ], - "title": "Prebuild: Create vs Claim (Avg)", + "title": "Workspace Build Latency p95", "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": 0 + }, + { + "color": "#EAB839", + "value": 50 + }, + { + "color": "green", + "value": 75 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 6, + "x": 0, + "y": 14 + }, + "id": 54, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.1.0", + "targets": [ + { + "editorMode": "code", + "expr": "clamp_max(\n 100 *\n (\n sum(\n coderd_prebuilt_workspaces_claimed_total{\n template_name=\"$template\", preset_name=\"$preset\"\n }\n ) or vector(0)\n )\n /\n clamp_min(\n ( \n sum(\n coderd_prebuilt_workspaces_claimed_total{\n template_name=\"$template\", preset_name=\"$preset\"\n }\n ) or vector(0))\n +\n (\n sum(\n coderd_workspace_creation_total{\n template_name=\"$template\", preset_name=\"$preset\"\n }\n ) or vector(0)),\n 1\n ),\n 100\n)", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "All Time: Prebuild Usage %", + "type": "stat" } ], "preload": false, @@ -1203,7 +1409,9 @@ }, { "current": { - "text": "All", + "text": [ + "All" + ], "value": [ "$__all" ] From f9c22105c5411d20c562c9dc74956934c61b7190 Mon Sep 17 00:00:00 2001 From: Susana Cardoso Ferreira Date: Thu, 4 Sep 2025 14:46:00 +0000 Subject: [PATCH 3/6] fix: make lint --- compiled/resources.yaml | 308 +++++++++++++++++++++++++++++++++------- 1 file changed, 258 insertions(+), 50 deletions(-) diff --git a/compiled/resources.yaml b/compiled/resources.yaml index c0eb9cb..3b808db 100644 --- a/compiled/resources.yaml +++ b/compiled/resources.yaml @@ -3419,7 +3419,7 @@ data: "overrides": [] }, "gridPos": { - "h": 5, + "h": 3, "w": 6, "x": 0, "y": 11 @@ -3462,12 +3462,12 @@ data: "expr": "sum(max by (template_name, preset_name) (\n coderd_prebuilt_workspaces_claimed_total{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n)) or vector(0)\n", "hide": false, "instant": false, - "legendFormat": "Prebuild workspaces claimed", + "legendFormat": "Prebuilt workspaces claimed", "range": true, "refId": "B" } ], - "title": "All Time: Regular vs Prebuild", + "title": "All Time: Regular vs Prebuilt", "type": "stat" }, { @@ -3475,11 +3475,51 @@ data: "type": "prometheus", "uid": "prometheus" }, - "description": "Average seconds to:\n* Create a regular workspace\n* Create a prebuilt workspace into the pool\n* Claim a prebuilt workspace from the pool", + "description": "Median (p50) build time in seconds for Regular Workspace Creation, Prebuilt Workspace Creation, and Prebuilt Workspace Claim", "fieldConfig": { "defaults": { "color": { - "mode": "thresholds" + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "dash": [ + 10, + 10 + ], + "fill": "dash" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } }, "mappings": [], "thresholds": { @@ -3494,45 +3534,83 @@ data: "value": 80 } ] - }, - "unit": "s" + } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Regular Creation" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Prebuild Creation" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Prebuilt Claim" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + } + ] }, "gridPos": { - "h": 5, + "h": 6, "w": 9, "x": 6, "y": 11 }, - "id": 52, + "id": 50, "options": { - "colorMode": "none", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } }, "pluginVersion": "12.1.0", "targets": [ { "editorMode": "code", - "exemplar": false, - "expr": "# Native Histogram\nhistogram_avg(\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"regular\"\n }\n )\n) \nor\n# Classic Histogram\nmax(\n coderd_workspace_creation_duration_seconds_sum{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"regular\"\n }\n) / \nmax(\n coderd_workspace_creation_duration_seconds_count{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"regular\"\n }\n)\nor vector(0)", - "instant": true, + "expr": "histogram_quantile(0.5,\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"regular\"\n }\n )\n)\nor vector(0)", "legendFormat": "Regular Creation", - "range": false, + "range": true, "refId": "A" }, { @@ -3541,12 +3619,11 @@ data: "uid": "prometheus" }, "editorMode": "code", - "exemplar": false, - "expr": "# Native Histogram\nhistogram_avg(\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n )\n) \nor\n# Classic Histogram\nmax(\n coderd_workspace_creation_duration_seconds_sum{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n) / \nmax(\n coderd_workspace_creation_duration_seconds_count{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n)\nor vector(0)", + "expr": "histogram_quantile(0.5,\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n )\n)\nor vector(0)", "hide": false, - "instant": true, + "instant": false, "legendFormat": "Prebuild Creation", - "range": false, + "range": true, "refId": "B" }, { @@ -3555,24 +3632,23 @@ data: "uid": "prometheus" }, "editorMode": "code", - "exemplar": false, - "expr": "# Native Histogram\nhistogram_avg(\n sum(\n coderd_prebuilt_workspace_claim_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n )\n) \nor\n# Classic Histogram\nmax(\n coderd_prebuilt_workspace_claim_duration_seconds_sum{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n) / \nmax(\n coderd_prebuilt_workspace_claim_duration_seconds_count{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n)\nor vector(0)", + "expr": "histogram_quantile(0.5,\n sum(\n coderd_prebuilt_workspace_claim_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n )\n)\nor vector(0)", "hide": false, - "instant": true, - "legendFormat": "Prebuild Claim", - "range": false, + "instant": false, + "legendFormat": "Prebuilt Claim", + "range": true, "refId": "C" } ], - "title": "Regular vs Prebuild Times (Avg)", - "type": "stat" + "title": "Workspace Build Latency p50", + "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, - "description": "Side-by-side comparison of prebuild creation and prebuild claim times", + "description": "95th-percentile (p95) build time in seconds for Regular Workspace Creation, Prebuilt Workspace Creation, and Prebuilt Workspace Claim.", "fieldConfig": { "defaults": { "color": { @@ -3633,15 +3709,61 @@ data: ] } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Regular Creation" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Prebuild Creation" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Prebuilt Claim" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + } + ] }, "gridPos": { - "h": 5, + "h": 6, "w": 9, "x": 15, "y": 11 }, - "id": 50, + "id": 53, "options": { "legend": { "calcs": [], @@ -3659,8 +3781,8 @@ data: "targets": [ { "editorMode": "code", - "expr": "histogram_avg(\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n )\n) or vector(0)", - "legendFormat": "Build into Pool", + "expr": "histogram_quantile(0.95,\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"regular\"\n }\n )\n)\nor vector(0)", + "legendFormat": "Regular Creation", "range": true, "refId": "A" }, @@ -3670,16 +3792,100 @@ data: "uid": "prometheus" }, "editorMode": "code", - "expr": "histogram_avg(\n sum(\n coderd_prebuilt_workspace_claim_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n )\n) or vector(0)", + "expr": "histogram_quantile(0.95,\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n )\n)\nor vector(0)", "hide": false, "instant": false, - "legendFormat": "Claim", + "legendFormat": "Prebuild Creation", "range": true, "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "histogram_quantile(0.95,\n sum(\n coderd_prebuilt_workspace_claim_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n )\n)\nor vector(0)", + "hide": false, + "instant": false, + "legendFormat": "Prebuilt Claim", + "range": true, + "refId": "C" } ], - "title": "Prebuild: Create vs Claim (Avg)", + "title": "Workspace Build Latency p95", "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": 0 + }, + { + "color": "#EAB839", + "value": 50 + }, + { + "color": "green", + "value": 75 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 6, + "x": 0, + "y": 14 + }, + "id": 54, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.1.0", + "targets": [ + { + "editorMode": "code", + "expr": "clamp_max(\n 100 *\n (\n sum(\n coderd_prebuilt_workspaces_claimed_total{\n template_name=\"$template\", preset_name=\"$preset\"\n }\n ) or vector(0)\n )\n /\n clamp_min(\n ( \n sum(\n coderd_prebuilt_workspaces_claimed_total{\n template_name=\"$template\", preset_name=\"$preset\"\n }\n ) or vector(0))\n +\n (\n sum(\n coderd_workspace_creation_total{\n template_name=\"$template\", preset_name=\"$preset\"\n }\n ) or vector(0)),\n 1\n ),\n 100\n)", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "All Time: Prebuild Usage %", + "type": "stat" } ], "preload": false, @@ -3713,7 +3919,9 @@ data: }, { "current": { - "text": "All", + "text": [ + "All" + ], "value": [ "$__all" ] From 3c1d5a7c8c3a0c44f8f783c782767b63ab395b1f Mon Sep 17 00:00:00 2001 From: Susana Cardoso Ferreira Date: Thu, 4 Sep 2025 15:06:40 +0000 Subject: [PATCH 4/6] chore: add second unit to histogram panels --- .../templates/dashboards/_dashboards_prebuilds.json.tpl | 6 ++++-- compiled/resources.yaml | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/coder-observability/templates/dashboards/_dashboards_prebuilds.json.tpl b/coder-observability/templates/dashboards/_dashboards_prebuilds.json.tpl index f5e065b..c978a32 100644 --- a/coder-observability/templates/dashboards/_dashboards_prebuilds.json.tpl +++ b/coder-observability/templates/dashboards/_dashboards_prebuilds.json.tpl @@ -1024,7 +1024,8 @@ "value": 80 } ] - } + }, + "unit": "s" }, "overrides": [ { @@ -1197,7 +1198,8 @@ "value": 80 } ] - } + }, + "unit": "s" }, "overrides": [ { diff --git a/compiled/resources.yaml b/compiled/resources.yaml index 3b808db..df42329 100644 --- a/compiled/resources.yaml +++ b/compiled/resources.yaml @@ -3534,7 +3534,8 @@ data: "value": 80 } ] - } + }, + "unit": "s" }, "overrides": [ { @@ -3707,7 +3708,8 @@ data: "value": 80 } ] - } + }, + "unit": "s" }, "overrides": [ { From 178c92feefac483a32b0e1826f4029ec8e6d5af4 Mon Sep 17 00:00:00 2001 From: Susana Cardoso Ferreira Date: Thu, 4 Sep 2025 16:36:09 +0000 Subject: [PATCH 5/6] chore: minor fixes --- .../templates/dashboards/_dashboards_prebuilds.json.tpl | 6 +++--- compiled/resources.yaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/coder-observability/templates/dashboards/_dashboards_prebuilds.json.tpl b/coder-observability/templates/dashboards/_dashboards_prebuilds.json.tpl index c978a32..c27d41f 100644 --- a/coder-observability/templates/dashboards/_dashboards_prebuilds.json.tpl +++ b/coder-observability/templates/dashboards/_dashboards_prebuilds.json.tpl @@ -1113,7 +1113,7 @@ "expr": "histogram_quantile(0.5,\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n )\n)\nor vector(0)", "hide": false, "instant": false, - "legendFormat": "Prebuild Creation", + "legendFormat": "Prebuilt Creation", "range": true, "refId": "B" }, @@ -1287,7 +1287,7 @@ "expr": "histogram_quantile(0.95,\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n )\n)\nor vector(0)", "hide": false, "instant": false, - "legendFormat": "Prebuild Creation", + "legendFormat": "Prebuilt Creation", "range": true, "refId": "B" }, @@ -1376,7 +1376,7 @@ "refId": "A" } ], - "title": "All Time: Prebuild Usage %", + "title": "All Time: Prebuilds Usage %", "type": "stat" } ], diff --git a/compiled/resources.yaml b/compiled/resources.yaml index df42329..794a58c 100644 --- a/compiled/resources.yaml +++ b/compiled/resources.yaml @@ -3623,7 +3623,7 @@ data: "expr": "histogram_quantile(0.5,\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n )\n)\nor vector(0)", "hide": false, "instant": false, - "legendFormat": "Prebuild Creation", + "legendFormat": "Prebuilt Creation", "range": true, "refId": "B" }, @@ -3797,7 +3797,7 @@ data: "expr": "histogram_quantile(0.95,\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n )\n)\nor vector(0)", "hide": false, "instant": false, - "legendFormat": "Prebuild Creation", + "legendFormat": "Prebuilt Creation", "range": true, "refId": "B" }, @@ -3886,7 +3886,7 @@ data: "refId": "A" } ], - "title": "All Time: Prebuild Usage %", + "title": "All Time: Prebuilds Usage %", "type": "stat" } ], From 86ebda8874781fcfd3554c1e69eee56c31972a28 Mon Sep 17 00:00:00 2001 From: Susana Cardoso Ferreira Date: Mon, 8 Sep 2025 10:17:19 +0000 Subject: [PATCH 6/6] chore: address comments --- .../templates/dashboards/_dashboards_prebuilds.json.tpl | 8 ++++---- compiled/resources.yaml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/coder-observability/templates/dashboards/_dashboards_prebuilds.json.tpl b/coder-observability/templates/dashboards/_dashboards_prebuilds.json.tpl index c27d41f..1e23884 100644 --- a/coder-observability/templates/dashboards/_dashboards_prebuilds.json.tpl +++ b/coder-observability/templates/dashboards/_dashboards_prebuilds.json.tpl @@ -1113,7 +1113,7 @@ "expr": "histogram_quantile(0.5,\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n )\n)\nor vector(0)", "hide": false, "instant": false, - "legendFormat": "Prebuilt Creation", + "legendFormat": "Prebuild Creation", "range": true, "refId": "B" }, @@ -1126,7 +1126,7 @@ "expr": "histogram_quantile(0.5,\n sum(\n coderd_prebuilt_workspace_claim_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n )\n)\nor vector(0)", "hide": false, "instant": false, - "legendFormat": "Prebuilt Claim", + "legendFormat": "Prebuild Claim", "range": true, "refId": "C" } @@ -1287,7 +1287,7 @@ "expr": "histogram_quantile(0.95,\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n )\n)\nor vector(0)", "hide": false, "instant": false, - "legendFormat": "Prebuilt Creation", + "legendFormat": "Prebuild Creation", "range": true, "refId": "B" }, @@ -1300,7 +1300,7 @@ "expr": "histogram_quantile(0.95,\n sum(\n coderd_prebuilt_workspace_claim_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n )\n)\nor vector(0)", "hide": false, "instant": false, - "legendFormat": "Prebuilt Claim", + "legendFormat": "Prebuild Claim", "range": true, "refId": "C" } diff --git a/compiled/resources.yaml b/compiled/resources.yaml index 794a58c..b983cc3 100644 --- a/compiled/resources.yaml +++ b/compiled/resources.yaml @@ -3623,7 +3623,7 @@ data: "expr": "histogram_quantile(0.5,\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n )\n)\nor vector(0)", "hide": false, "instant": false, - "legendFormat": "Prebuilt Creation", + "legendFormat": "Prebuild Creation", "range": true, "refId": "B" }, @@ -3636,7 +3636,7 @@ data: "expr": "histogram_quantile(0.5,\n sum(\n coderd_prebuilt_workspace_claim_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n )\n)\nor vector(0)", "hide": false, "instant": false, - "legendFormat": "Prebuilt Claim", + "legendFormat": "Prebuild Claim", "range": true, "refId": "C" } @@ -3797,7 +3797,7 @@ data: "expr": "histogram_quantile(0.95,\n sum(\n coderd_workspace_creation_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\", type=\"prebuild\"\n }\n )\n)\nor vector(0)", "hide": false, "instant": false, - "legendFormat": "Prebuilt Creation", + "legendFormat": "Prebuild Creation", "range": true, "refId": "B" }, @@ -3810,7 +3810,7 @@ data: "expr": "histogram_quantile(0.95,\n sum(\n coderd_prebuilt_workspace_claim_duration_seconds{\n template_name=~\"$template\", preset_name=~\"$preset\"\n }\n )\n)\nor vector(0)", "hide": false, "instant": false, - "legendFormat": "Prebuilt Claim", + "legendFormat": "Prebuild Claim", "range": true, "refId": "C" }

AltStyle によって変換されたページ (->オリジナル) /