diff --git a/deploy/grafana/dashboards/album-art.json b/deploy/grafana/dashboards/album-art.json index 496f2e1..9365305 100644 --- a/deploy/grafana/dashboards/album-art.json +++ b/deploy/grafana/dashboards/album-art.json @@ -286,7 +286,7 @@ { "type": "timeseries", "title": "Responses / min by result", - "description": "queued = first sighting of an album; pending = still being resolved; unavailable = settled with no art.", + "description": "queued = first sighting of an album; pending = still being resolved; unavailable = settled with no art; override = served from the user's own upload/correction.", "datasource": { "type": "prometheus", "uid": "prometheus" @@ -340,7 +340,7 @@ }, { "type": "timeseries", - "title": "Endpoint latency (p95)", + "title": "Endpoint latency (p95) by endpoint", "description": "", "datasource": { "type": "prometheus", @@ -352,8 +352,8 @@ "type": "prometheus", "uid": "prometheus" }, - "expr": "histogram_quantile(0.95, sum by (le) (rate(scrobbler_http_request_duration_seconds_bucket{endpoint=\"Art.album_art\"}[$__rate_interval])))", - "legendFormat": "p95", + "expr": "histogram_quantile(0.95, sum by (le, endpoint) (rate(scrobbler_http_request_duration_seconds_bucket{endpoint=~\"Art[.].*\"}[$__rate_interval])))", + "legendFormat": "{{endpoint}}", "refId": "A" } ], @@ -750,6 +750,586 @@ "w": 12, "h": 8 } + }, + { + "type": "row", + "title": "Manual art", + "id": 17, + "collapsed": false, + "gridPos": { + "x": 0, + "y": 41, + "w": 24, + "h": 1 + }, + "panels": [] + }, + { + "type": "timeseries", + "title": "Uploads / min by result", + "description": "Anything other than ok was rejected: empty, too_large or bad_type.", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "sum by (result) (rate(scrobbler_art_uploads_total[$__rate_interval])) * 60", + "legendFormat": "{{result}}", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "short", + "custom": { + "lineWidth": 2, + "fillOpacity": 40, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "mode": "normal", + "group": "A" + } + }, + "min": 0 + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "id": 18, + "gridPos": { + "x": 0, + "y": 42, + "w": 12, + "h": 8 + } + }, + { + "type": "timeseries", + "title": "Accepted upload size (p50 / p95)", + "description": "", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "histogram_quantile(0.5, sum by (le) (rate(scrobbler_art_upload_bytes_bucket[$__rate_interval])))", + "legendFormat": "p50", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "histogram_quantile(0.95, sum by (le) (rate(scrobbler_art_upload_bytes_bucket[$__rate_interval])))", + "legendFormat": "p95", + "refId": "B" + } + ], + "fieldConfig": { + "defaults": { + "unit": "bytes", + "custom": { + "lineWidth": 2, + "fillOpacity": 10, + "showPoints": "never", + "spanNulls": true + }, + "min": 0 + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "id": 19, + "gridPos": { + "x": 12, + "y": 42, + "w": 12, + "h": 8 + } + }, + { + "type": "timeseries", + "title": "Manual actions / min", + "description": "", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "sum by (action) (rate(scrobbler_art_override_actions_total[$__rate_interval])) * 60", + "legendFormat": "{{action}}", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "short", + "custom": { + "lineWidth": 2, + "fillOpacity": 40, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "mode": "normal", + "group": "A" + } + }, + "min": 0 + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "id": 20, + "gridPos": { + "x": 0, + "y": 50, + "w": 12, + "h": 8 + } + }, + { + "type": "timeseries", + "title": "Correction outcomes / min", + "description": "input is mbid (a release-group ID was given) or search (corrected text).", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "sum by (input, result) (rate(scrobbler_art_correction_resolutions_total[$__rate_interval])) * 60", + "legendFormat": "{{input}} {{result}}", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "short", + "custom": { + "lineWidth": 2, + "fillOpacity": 40, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "mode": "normal", + "group": "A" + } + }, + "min": 0 + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "id": 21, + "gridPos": { + "x": 12, + "y": 50, + "w": 12, + "h": 8 + } + }, + { + "type": "timeseries", + "title": "Correction wait (p50 / p95)", + "description": "From the user asking for a correction to the worker finishing it.", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "histogram_quantile(0.5, sum by (le) (rate(scrobbler_art_correction_wait_seconds_bucket[$__rate_interval])))", + "legendFormat": "p50", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "histogram_quantile(0.95, sum by (le) (rate(scrobbler_art_correction_wait_seconds_bucket[$__rate_interval])))", + "legendFormat": "p95", + "refId": "B" + } + ], + "fieldConfig": { + "defaults": { + "unit": "s", + "custom": { + "lineWidth": 2, + "fillOpacity": 10, + "showPoints": "never", + "spanNulls": true + }, + "min": 0 + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "id": 22, + "gridPos": { + "x": 0, + "y": 58, + "w": 12, + "h": 8 + } + }, + { + "type": "timeseries", + "title": "Worker time per correction (p95)", + "description": "", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "histogram_quantile(0.95, sum by (le) (rate(scrobbler_art_override_worker_seconds_bucket[$__rate_interval])))", + "legendFormat": "corrections", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "histogram_quantile(0.95, sum by (le) (rate(scrobbler_art_worker_resolve_seconds_bucket[$__rate_interval])))", + "legendFormat": "shared lookups", + "refId": "B" + } + ], + "fieldConfig": { + "defaults": { + "unit": "s", + "custom": { + "lineWidth": 2, + "fillOpacity": 10, + "showPoints": "never", + "spanNulls": true + }, + "min": 0 + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "id": 23, + "gridPos": { + "x": 12, + "y": 58, + "w": 12, + "h": 8 + } + }, + { + "type": "timeseries", + "title": "User art by kind and status", + "description": "", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "max by (kind, status) (scrobbler_art_overrides)", + "legendFormat": "{{kind}} {{status}}", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "short", + "custom": { + "lineWidth": 2, + "fillOpacity": 40, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "mode": "normal", + "group": "A" + } + }, + "min": 0 + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "id": 24, + "gridPos": { + "x": 0, + "y": 66, + "w": 12, + "h": 8 + } + }, + { + "type": "timeseries", + "title": "Own art vs shared art served / min", + "description": "", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "sum by (result) (rate(scrobbler_art_requests_total{result=~\"override|served\"}[$__rate_interval])) * 60", + "legendFormat": "{{result}}", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "short", + "custom": { + "lineWidth": 2, + "fillOpacity": 40, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "mode": "normal", + "group": "A" + } + }, + "min": 0 + }, + "overrides": [] + }, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "id": 25, + "gridPos": { + "x": 12, + "y": 66, + "w": 12, + "h": 8 + } + }, + { + "type": "stat", + "title": "Oldest pending correction", + "description": "", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "max(scrobbler_art_override_oldest_pending_seconds)", + "legendFormat": "__auto", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "s", + "decimals": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "text", + "value": null + } + ] + } + }, + "overrides": [] + }, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "colorMode": "value", + "graphMode": "area", + "textMode": "auto", + "justifyMode": "auto" + }, + "id": 26, + "gridPos": { + "x": 0, + "y": 74, + "w": 6, + "h": 5 + } + }, + { + "type": "stat", + "title": "Albums needing manual art", + "description": "Not found or errored in the shared cache, and not fixed by any user.", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "max(scrobbler_art_unresolved_albums)", + "legendFormat": "__auto", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "short", + "decimals": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "text", + "value": null + } + ] + } + }, + "overrides": [] + }, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "colorMode": "value", + "graphMode": "area", + "textMode": "auto", + "justifyMode": "auto" + }, + "id": 27, + "gridPos": { + "x": 6, + "y": 74, + "w": 6, + "h": 5 + } } ] } diff --git a/deploy/grafana/dashboards/usage.json b/deploy/grafana/dashboards/usage.json index d230503..13da42d 100644 --- a/deploy/grafana/dashboards/usage.json +++ b/deploy/grafana/dashboards/usage.json @@ -989,6 +989,131 @@ "w": 12, "h": 8 } + }, + { + "type": "row", + "title": "Album art", + "id": 21, + "collapsed": false, + "gridPos": { + "x": 0, + "y": 54, + "w": 24, + "h": 1 + }, + "panels": [] + }, + { + "type": "stat", + "title": "Albums needing manual art", + "description": "Not found or errored in the shared cache, and not fixed by any user. See the Album Art dashboard.", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "max(scrobbler_art_unresolved_albums)", + "legendFormat": "__auto", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "short", + "decimals": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "text", + "value": null + } + ] + } + }, + "overrides": [] + }, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "colorMode": "value", + "graphMode": "area", + "textMode": "auto", + "justifyMode": "auto" + }, + "id": 22, + "gridPos": { + "x": 0, + "y": 55, + "w": 6, + "h": 5 + } + }, + { + "type": "stat", + "title": "Pending art corrections", + "description": "", + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "expr": "max(scrobbler_art_overrides{kind=\"correction\",status=\"pending\"})", + "legendFormat": "__auto", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "unit": "short", + "decimals": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "text", + "value": null + } + ] + } + }, + "overrides": [] + }, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "colorMode": "value", + "graphMode": "area", + "textMode": "auto", + "justifyMode": "auto" + }, + "id": 23, + "gridPos": { + "x": 6, + "y": 55, + "w": 6, + "h": 5 + } } ] } diff --git a/deploy/prometheus/alerts.yml b/deploy/prometheus/alerts.yml index 9bb7d7e..1c70c3e 100644 --- a/deploy/prometheus/alerts.yml +++ b/deploy/prometheus/alerts.yml @@ -125,6 +125,25 @@ groups: summary: Over half of {{ $labels.service }} album art calls are failing description: Failed lookups are cached as errors and retried later; check the upstream's status. + - alert: AlbumArtCorrectionBacklog + expr: max(scrobbler_art_override_oldest_pending_seconds) > 900 + for: 10m + labels: {severity: warning} + annotations: + summary: A manual album art correction has been waiting over 15 minutes + description: The worker is probably stopped, or MusicBrainz / Cover Art Archive is failing. + + - alert: AlbumArtUploadRejections + expr: | + sum(rate(scrobbler_art_uploads_total{result!="ok"}[30m])) + / sum(rate(scrobbler_art_uploads_total[30m])) > 0.5 + and sum(rate(scrobbler_art_uploads_total[30m])) > 0.002 + for: 30m + labels: {severity: warning} + annotations: + summary: Most album art uploads are being rejected + description: Check the Album Art dashboard for the reason (too_large suggests ART_UPLOAD_MAX_BYTES or a proxy limit; bad_type a client sending the wrong format). + - alert: PostgresDown expr: pg_up == 0 for: 2m