Files
Scrobbler/docker/api-entrypoint.sh
T
mattandClaude Opus 5.5 ea705589f1
CI / lint (push) Successful in 9s
CI / test (push) Successful in 36s
CI / notify (push) Successful in 5s
Monitoring stack, containers and dashboards
- API image (uv multi-stage, non-root, gunicorn, migrations on start,
  health check) and UI image (nginx, CSP, config.js rendered from
  API_BASE_URL); /healthz documented in OpenAPI
- docker compose runs db, api and ui; the "monitoring" profile adds
  Prometheus, postgres-exporter and Grafana, all provisioned from files
- Grafana dashboards: API overview (RED), Last.fm API, Usage, Database
- Prometheus alert rules: API down, error rate, latency, auth failure
  spike, ignored scrobbles, DB pool saturation, Postgres down
- Pool checkout gauge counts events (the pool's own counters lag the
  checkin event); error ratios show 0 instead of "No data"
- Tests check dashboards and alerts only use metrics that exist
- scripts/generate_traffic.py drives realistic traffic for demos

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

9 lines
310 B
Bash
Executable File

#!/bin/sh
# Apply database migrations (unless RUN_MIGRATIONS=0), then start the given command.
set -e
if [ "${RUN_MIGRATIONS:-1}" = "1" ]; then
# Not under gunicorn, so don't use (or pollute) the multiprocess metrics directory.
env -u PROMETHEUS_MULTIPROC_DIR flask --app scrobbler db upgrade
fi
exec "$@"