Add album art observability metrics, dashboard and alerts
CI / lint (push) Successful in 18s
CI / validate-monitoring (push) Successful in 13s
CI / federation-interop (push) Successful in 1m36s
CI / test (push) Successful in 3m37s
CI / assets (push) Successful in 8s
CI / python-package (push) Successful in 13s
CI / images (push) Successful in 1m37s
CI / trigger-deploy (push) Successful in 3s
CI / notify (push) Successful in 5s

Endpoint result counters, worker resolution/latency/image-size metrics,
per-upstream latency and error counters, cache-status and oldest-pending
gauges, an Album Art Grafana dashboard, and backlog/upstream-error alerts.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QHPkt2v797pphGCFKfTFmv
This commit is contained in:
mattandClaude Sonnet 5.5 committed 2026-10-06 21:56:18 +01:00
1 parent 6cd17d7586
commit 48fba1e0e2
9 files changed
+925 -3

No files matched your search

+755
View File
@@ -0,0 +1,755 @@
{
"uid": "scrobbler-album-art",
"title": "Scrobbler: Album Art",
"description": "Album art endpoint, background resolver and MusicBrainz / Cover Art Archive upstreams",
"tags": [
"scrobbler"
],
"timezone": "browser",
"editable": true,
"graphTooltip": 1,
"refresh": "30s",
"time": {
"from": "now-6h",
"to": "now"
},
"schemaVersion": 41,
"version": 1,
"templating": {
"list": []
},
"annotations": {
"list": []
},
"links": [
{
"type": "dashboards",
"tags": [
"scrobbler"
],
"asDropdown": true,
"title": "Scrobbler",
"includeVars": false
}
],
"panels": [
{
"type": "row",
"title": "Cache",
"id": 1,
"collapsed": false,
"gridPos": {
"x": 0,
"y": 0,
"w": 24,
"h": 1
},
"panels": []
},
{
"type": "stat",
"title": "Cached: found",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "max(scrobbler_art_cache{status=\"found\"})",
"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": 2,
"gridPos": {
"x": 0,
"y": 1,
"w": 6,
"h": 5
}
},
{
"type": "stat",
"title": "Cached: not found",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "max(scrobbler_art_cache{status=\"not_found\"})",
"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": 3,
"gridPos": {
"x": 6,
"y": 1,
"w": 6,
"h": 5
}
},
{
"type": "stat",
"title": "Cached: error",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "max(scrobbler_art_cache{status=\"error\"})",
"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": 4,
"gridPos": {
"x": 12,
"y": 1,
"w": 6,
"h": 5
}
},
{
"type": "stat",
"title": "Oldest pending request",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "max(scrobbler_art_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": 5,
"gridPos": {
"x": 18,
"y": 1,
"w": 6,
"h": 5
}
},
{
"type": "row",
"title": "Endpoint",
"id": 6,
"collapsed": false,
"gridPos": {
"x": 0,
"y": 6,
"w": 24,
"h": 1
},
"panels": []
},
{
"type": "timeseries",
"title": "Responses / min by result",
"description": "queued = first sighting of an album; pending = still being resolved; unavailable = settled with no art.",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum by (result) (rate(scrobbler_art_requests_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": 7,
"gridPos": {
"x": 0,
"y": 7,
"w": 12,
"h": 8
}
},
{
"type": "timeseries",
"title": "Endpoint latency (p95)",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"targets": [
{
"datasource": {
"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",
"refId": "A"
}
],
"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": 8,
"gridPos": {
"x": 12,
"y": 7,
"w": 12,
"h": 8
}
},
{
"type": "row",
"title": "Worker",
"id": 9,
"collapsed": false,
"gridPos": {
"x": 0,
"y": 15,
"w": 24,
"h": 1
},
"panels": []
},
{
"type": "timeseries",
"title": "Resolutions / min by result",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum by (source, result) (rate(scrobbler_art_resolutions_total[$__rate_interval])) * 60",
"legendFormat": "{{source}} {{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": 10,
"gridPos": {
"x": 0,
"y": 16,
"w": 12,
"h": 8
}
},
{
"type": "timeseries",
"title": "Time to resolve one album (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_worker_resolve_seconds_bucket[$__rate_interval])))",
"legendFormat": "p50",
"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": "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": 11,
"gridPos": {
"x": 12,
"y": 16,
"w": 12,
"h": 8
}
},
{
"type": "timeseries",
"title": "Cache rows by status",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "max by (status) (scrobbler_art_cache)",
"legendFormat": "{{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": 12,
"gridPos": {
"x": 0,
"y": 24,
"w": 12,
"h": 8
}
},
{
"type": "timeseries",
"title": "Downloaded image 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_image_bytes_bucket[$__rate_interval])))",
"legendFormat": "p50",
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "histogram_quantile(0.95, sum by (le) (rate(scrobbler_art_image_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": 13,
"gridPos": {
"x": 12,
"y": 24,
"w": 12,
"h": 8
}
},
{
"type": "row",
"title": "Upstreams",
"id": 14,
"collapsed": false,
"gridPos": {
"x": 0,
"y": 32,
"w": 24,
"h": 1
},
"panels": []
},
{
"type": "timeseries",
"title": "Upstream latency (p95)",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "histogram_quantile(0.95, sum by (le, service) (rate(scrobbler_art_upstream_seconds_bucket[$__rate_interval])))",
"legendFormat": "{{service}}",
"refId": "A"
}
],
"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": 15,
"gridPos": {
"x": 0,
"y": 33,
"w": 12,
"h": 8
}
},
{
"type": "timeseries",
"title": "Upstream errors / min",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum by (service, error) (rate(scrobbler_art_upstream_errors_total[$__rate_interval])) * 60",
"legendFormat": "{{service}} {{error}}",
"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": 16,
"gridPos": {
"x": 12,
"y": 33,
"w": 12,
"h": 8
}
}
]
}
+18
View File
@@ -107,6 +107,24 @@ groups:
summary: More than 20% of incoming fediverse signatures are failing
description: Check the Federation dashboard for the reason (e.g. a clock problem shows as 'expired').
- alert: AlbumArtBacklog
expr: max(scrobbler_art_oldest_pending_seconds) > 900
for: 10m
labels: {severity: warning}
annotations:
summary: Album art requests have been waiting over 15 minutes
description: The worker is probably stopped, or MusicBrainz / Cover Art Archive is failing.
- alert: AlbumArtUpstreamErrors
expr: |
sum by (service) (rate(scrobbler_art_upstream_errors_total[15m]))
/ sum by (service) (rate(scrobbler_art_upstream_seconds_count[15m])) > 0.5
for: 15m
labels: {severity: warning}
annotations:
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: PostgresDown
expr: pg_up == 0
for: 2m