diff --git a/roles/custom/matrix-media-repo/templates/grafana/media-repo.json b/roles/custom/matrix-media-repo/templates/grafana/media-repo.json index 1fb68e0a9..feee5bace 100644 --- a/roles/custom/matrix-media-repo/templates/grafana/media-repo.json +++ b/roles/custom/matrix-media-repo/templates/grafana/media-repo.json @@ -15,7 +15,13 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "9.3.1" + "version": "10.1.0" + }, + { + "type": "panel", + "id": "heatmap", + "name": "Heatmap", + "version": "" }, { "type": "datasource", @@ -35,8 +41,8 @@ { "builtIn": 1, "datasource": { - "type": "grafana", - "uid": "-- Grafana --" + "type": "datasource", + "uid": "grafana" }, "enable": true, "hide": true, @@ -52,11 +58,10 @@ } ] }, - "description": "", "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 9, + "id": null, "links": [], "liveNow": false, "panels": [ @@ -84,6 +89,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -106,7 +112,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -138,17 +145,19 @@ "sort": "none" } }, - "pluginVersion": "9.5.3", + "pluginVersion": "10.1.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, + "editorMode": "code", "expr": "rate(media_http_requests_total[2m])", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{ '{{host}}: {{method}} {{action}}' }}", + "range": true, "refId": "A" }, { @@ -156,10 +165,12 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, + "editorMode": "code", "expr": "rate(media_invalid_http_requests_total[2m])", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{ 'Invalid Host: {{method}} {{action}}' }}", + "range": true, "refId": "B" } ], @@ -190,6 +201,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -212,7 +224,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -244,23 +257,220 @@ "sort": "none" } }, - "pluginVersion": "9.5.3", + "pluginVersion": "10.1.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, + "editorMode": "code", "expr": "rate(media_http_responses_total[2m])", "format": "time_series", "intervalFactor": 1, "legendFormat": "{{ '{{host}}: {{method}} {{action}} {{statusCode}}' }}", + "range": true, "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "rate(media_invalid_http_requests_total[2m])", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "{{ 'Invalid Host: {{method}} {{action}} {{statusCode}}' }}", + "range": true, + "refId": "B" } ], "title": "HTTP Responses", "type": "timeseries" }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 11, + "maxDataPoints": 5000, + "options": { + "calculate": false, + "calculation": { + "xBuckets": { + "mode": "size", + "value": "" + } + }, + "cellGap": 1, + "color": { + "exponent": 0.5, + "fill": "dark-orange", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "Spectral", + "steps": 64 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, + "legend": { + "show": true + }, + "rowsFrame": { + "layout": "auto" + }, + "tooltip": { + "show": true, + "yHistogram": false + }, + "yAxis": { + "axisPlacement": "left", + "decimals": 0, + "reverse": false, + "unit": "s" + } + }, + "pluginVersion": "10.1.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(rate(media_http_response_time_seconds_bucket{action=~\"download|thumbnail\"}[2m])) by (le)", + "format": "heatmap", + "instant": false, + "interval": "", + "legendFormat": "{{ '{{method}} {{action}} - {{le}}' }}", + "range": true, + "refId": "A" + } + ], + "title": "Downloads and Thumbnails - Response Time", + "type": "heatmap" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 9 + }, + "id": 12, + "maxDataPoints": 5000, + "options": { + "calculate": false, + "calculation": { + "xBuckets": { + "mode": "size", + "value": "" + } + }, + "cellGap": 1, + "color": { + "exponent": 0.5, + "fill": "dark-orange", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "Spectral", + "steps": 64 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, + "legend": { + "show": true + }, + "rowsFrame": { + "layout": "auto" + }, + "tooltip": { + "show": true, + "yHistogram": false + }, + "yAxis": { + "axisPlacement": "left", + "decimals": 0, + "reverse": false, + "unit": "s" + } + }, + "pluginVersion": "10.1.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(rate(media_http_response_time_seconds_bucket{action=\"upload\"}[2m])) by (le)", + "format": "heatmap", + "instant": false, + "legendFormat": "{{ '{{method}} {{action}} - {{le}}' }}", + "range": true, + "refId": "A" + } + ], + "title": "Uploads - Response Time", + "type": "heatmap" + }, { "datasource": { "type": "prometheus", @@ -285,6 +495,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -307,7 +518,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -323,7 +535,7 @@ "h": 9, "w": 12, "x": 0, - "y": 9 + "y": 18 }, "id": 8, "links": [], @@ -339,18 +551,21 @@ "sort": "none" } }, - "pluginVersion": "9.5.3", + "pluginVersion": "10.1.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": "go_memstats_alloc_bytes", + "editorMode": "code", + "exemplar": true, + "expr": "go_memstats_alloc_bytes{job=\"media_repo\"}", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "memory usage (alloc)", + "range": true, "refId": "B" }, { @@ -358,7 +573,8 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": "go_memstats_sys_bytes", + "exemplar": true, + "expr": "go_memstats_sys_bytes{job=\"media_repo\"}", "interval": "", "legendFormat": "memory usage (sys)", "refId": "C" @@ -368,7 +584,8 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": "go_memstats_heap_alloc_bytes", + "exemplar": true, + "expr": "go_memstats_heap_alloc_bytes{job=\"media_repo\"}", "interval": "", "legendFormat": "heap usage (alloc)", "refId": "A" @@ -378,7 +595,8 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": "go_memstats_heap_idle_bytes", + "exemplar": true, + "expr": "go_memstats_heap_idle_bytes{job=\"media_repo\"}", "interval": "", "legendFormat": "heap usage (idle)", "refId": "D" @@ -388,10 +606,24 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": "go_memstats_heap_inuse_bytes", + "exemplar": true, + "expr": "go_memstats_heap_inuse_bytes{job=\"media_repo\"}", "interval": "", "legendFormat": "heap usage (used)", "refId": "E" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "go_memstats_heap_released_bytes{job=\"media_repo\"}", + "hide": false, + "legendFormat": "heap usage (released)", + "range": true, + "refId": "F" } ], "title": "Memory Usage", @@ -421,6 +653,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -443,7 +676,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -451,7 +685,7 @@ } ] }, - "unit": "bytes" + "unit": "none" }, "overrides": [] }, @@ -459,9 +693,9 @@ "h": 9, "w": 12, "x": 12, - "y": 9 + "y": 18 }, - "id": 4, + "id": 10, "links": [], "options": { "legend": { @@ -475,18 +709,21 @@ "sort": "none" } }, - "pluginVersion": "9.5.3", + "pluginVersion": "10.1.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": "media_cache_num_bytes_used", + "editorMode": "code", + "exemplar": true, + "expr": "go_goroutines{job=\"media_repo\"}", "format": "time_series", "interval": "", "intervalFactor": 1, - "legendFormat": "{{ 'size of cache: {{cache}}' }}", + "legendFormat": "goroutines", + "range": true, "refId": "B" }, { @@ -494,13 +731,19 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": "media_cache_num_live_bytes_used", + "editorMode": "code", + "exemplar": true, + "expr": "go_threads{job=\"media_repo\"}", + "format": "time_series", + "hide": false, "interval": "", - "legendFormat": "{{ 'live size of cache: {{cache}}' }}", - "refId": "C" + "intervalFactor": 1, + "legendFormat": "threads", + "range": true, + "refId": "A" } ], - "title": "Cache Size (Bytes)", + "title": "Process Composition", "type": "timeseries" }, { @@ -527,6 +770,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -549,7 +793,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -557,7 +802,7 @@ } ] }, - "unit": "short" + "unit": "hertz" }, "overrides": [] }, @@ -565,7 +810,7 @@ "h": 9, "w": 12, "x": 0, - "y": 18 + "y": 27 }, "id": 9, "links": [], @@ -578,35 +823,26 @@ }, "tooltip": { "mode": "multi", - "sort": "none" + "sort": "desc" } }, - "pluginVersion": "9.5.3", + "pluginVersion": "10.1.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": "media_cache_num_items", + "editorMode": "code", + "expr": "rate(media_s3_operations_total[2m])", "format": "time_series", - "interval": "", "intervalFactor": 1, - "legendFormat": "{{ 'items in cache: {{cache}}' }}", - "refId": "B" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "expr": "media_cache_num_live_items", - "interval": "", - "legendFormat": "{{ 'live items in cache: {{cache}}' }}", - "refId": "C" + "legendFormat": "{{ '{{operation}}' }}", + "range": true, + "refId": "A" } ], - "title": "Cache Size (# of items)", + "title": "S3 Operations", "type": "timeseries" }, { @@ -633,6 +869,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -655,7 +892,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -671,7 +909,7 @@ "h": 9, "w": 12, "x": 12, - "y": 18 + "y": 27 }, "id": 5, "links": [], @@ -687,7 +925,7 @@ "sort": "none" } }, - "pluginVersion": "9.5.3", + "pluginVersion": "10.1.0", "targets": [ { "datasource": { @@ -750,6 +988,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -772,7 +1011,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -788,7 +1028,7 @@ "h": 9, "w": 12, "x": 0, - "y": 27 + "y": 36 }, "id": 6, "links": [], @@ -801,10 +1041,10 @@ }, "tooltip": { "mode": "multi", - "sort": "none" + "sort": "desc" } }, - "pluginVersion": "9.5.3", + "pluginVersion": "10.1.0", "targets": [ { "datasource": { @@ -821,6 +1061,96 @@ "title": "Thumbnail Generation", "type": "timeseries" }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 36 + }, + "id": 13, + "maxDataPoints": 5000, + "options": { + "calculate": false, + "calculation": { + "xBuckets": { + "mode": "size", + "value": "" + } + }, + "cellGap": 1, + "color": { + "exponent": 0.5, + "fill": "dark-orange", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "Spectral", + "steps": 64 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, + "legend": { + "show": true + }, + "rowsFrame": { + "layout": "auto" + }, + "tooltip": { + "show": true, + "yHistogram": false + }, + "yAxis": { + "axisPlacement": "left", + "decimals": 0, + "reverse": false, + "unit": "s" + } + }, + "pluginVersion": "10.1.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(rate(media_age_accessed_media_seconds_bucket[2m])) by (le)", + "format": "heatmap", + "instant": false, + "legendFormat": "{{ '{{method}} {{action}} - {{le}}' }}", + "range": true, + "refId": "A" + } + ], + "title": "Age of Downloaded Media", + "type": "heatmap" + }, { "datasource": { "type": "prometheus", @@ -845,6 +1175,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -867,7 +1198,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -882,8 +1214,8 @@ "gridPos": { "h": 9, "w": 12, - "x": 12, - "y": 27 + "x": 0, + "y": 45 }, "id": 7, "links": [], @@ -896,10 +1228,10 @@ }, "tooltip": { "mode": "multi", - "sort": "none" + "sort": "desc" } }, - "pluginVersion": "9.5.3", + "pluginVersion": "10.1.0", "targets": [ { "datasource": { @@ -933,26 +1265,7 @@ "style": "dark", "tags": [], "templating": { - "list": [ - { - "current": { - "selected": true, - "text": "Prometheus", - "value": "Prometheus" - }, - "hide": 0, - "includeAll": false, - "multi": false, - "name": "DS_PROMETHEUS", - "options": [], - "query": "prometheus", - "queryValue": "", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "type": "datasource" - } - ] + "list": [] }, "time": { "from": "now-1h", @@ -986,6 +1299,6 @@ "timezone": "", "title": "Media Repo Dashboard", "uid": "xJUZ3xfmk", - "version": 2, + "version": 15, "weekStart": "" } \ No newline at end of file