Files
Scrobbler/deploy/prometheus/alerts.yml
T
mattandClaude Opus 5.5 e40a074a64
CI / validate-monitoring (push) Successful in 7s
CI / lint (push) Successful in 11s
CI / test (push) Successful in 43s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 5s
Import page in the web UI, worker service and import monitoring
- New Import page: upload an export (with upload progress) or, when the
  server has a Last.fm API key, import straight from a Last.fm username;
  jobs list with live progress, counts, errors and cancelling
- docker compose runs the import worker from the API image; the API
  image no longer sets PROMETHEUS_MULTIPROC_DIR (gunicorn.conf.py does,
  and other commands must not inherit multiprocess mode)
- Prometheus scrapes the worker; Usage dashboard gains an Imports row;
  ImportWorkerDown and ImportJobsWaiting alerts
- README and .env.example document imports and LASTFM_API_KEY

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
2026-09-25 15:10:15 +01:00

82 lines
3.0 KiB
YAML

groups:
- name: scrobbler
rules:
- alert: ScrobblerDown
expr: up{job="scrobbler-api"} == 0
for: 2m
labels: {severity: critical}
annotations:
summary: Scrobbler API metrics endpoint is down
description: Prometheus hasn't been able to scrape {{ $labels.instance }} for 2 minutes.
- alert: HighErrorRate
expr: |
sum(rate(scrobbler_http_requests_total{status=~"5.."}[5m]))
/ sum(rate(scrobbler_http_requests_total[5m])) > 0.05
for: 5m
labels: {severity: critical}
annotations:
summary: More than 5% of API requests are failing
description: 5xx ratio is {{ $value | humanizePercentage }}.
- alert: HighLatency
expr: |
histogram_quantile(0.95,
sum by (le) (rate(scrobbler_http_request_duration_seconds_bucket[5m]))) > 1
for: 10m
labels: {severity: warning}
annotations:
summary: API p95 latency is above 1s
description: p95 latency is {{ $value | humanizeDuration }}.
- alert: AuthFailureSpike
expr: sum(rate(scrobbler_auth_failures_total[5m])) > 10
for: 5m
labels: {severity: warning}
annotations:
summary: Unusually many authentication failures
description: "{{ $value | humanize }} failures/s: check for a misconfigured client or credential stuffing."
- alert: ScrobbleIgnoreRateHigh
expr: |
sum(rate(scrobbler_scrobbles_total{result="ignored"}[15m]))
/ sum(rate(scrobbler_scrobbles_total[15m])) > 0.2
for: 15m
labels: {severity: warning}
annotations:
summary: More than 20% of scrobbles are being ignored
description: A client may be sending bad timestamps or empty metadata.
- alert: DBPoolExhausted
expr: |
sum(scrobbler_db_pool_connections{state="checked_out"})
>= sum(scrobbler_db_pool_connections{state="size"})
for: 5m
labels: {severity: warning}
annotations:
summary: Every pooled database connection is in use
description: Workers are running on overflow connections; requests may queue.
- alert: ImportWorkerDown
expr: up{job="scrobbler-worker"} == 0
for: 5m
labels: {severity: warning}
annotations:
summary: The import worker isn't running
description: History imports will wait until it's back.
- alert: ImportJobsWaiting
expr: max(scrobbler_import_jobs{status="pending"}) > 0 and max(scrobbler_import_jobs{status="running"}) == 0
for: 15m
labels: {severity: warning}
annotations:
summary: Imports have been waiting for 15 minutes with nothing running
description: The import worker is probably stopped or stuck.
- alert: PostgresDown
expr: pg_up == 0
for: 2m
labels: {severity: critical}
annotations:
summary: Postgres is unreachable from postgres-exporter