feat(pry): Phase 0 infra hardening — metrics, redis/postgres, pinned deps, observability #8

Closed
cryptorugmunch wants to merge 5 commits from feat/phase0-rebased into main

Reconciles the Phase 0 infra-hardening commits on top of the latest main (post Alembic/SQLAlchemy migration PRs).

Changes:

  • Adds /metrics endpoint + Prometheus counters/histograms for requests and scrapes
  • Wires REQUEST_COUNT and REQUEST_LATENCY into PryHttpMiddleware
  • Tracks scrape metrics in routers/scraping.py (direct, lazy, crawl, map, batch)
  • Adds Redis + Postgres services to docker-compose.yml
  • Fixes Ollama URL default to Talos (100.104.130.92:11434)
  • Adds LLMRegistry.complete_or_empty() graceful fallback for API boundaries
  • Regenerates requirements.txt; adds pinned requirements.lock
  • Updates STATUS.md

Verification:

  • ruff check . clean
  • pytest tests/test_api_scraping.py tests/test_api_templates.py tests/test_api.py tests/test_apify_schema.py — 23 passed
Reconciles the Phase 0 infra-hardening commits on top of the latest main (post Alembic/SQLAlchemy migration PRs). Changes: - Adds `/metrics` endpoint + Prometheus counters/histograms for requests and scrapes - Wires `REQUEST_COUNT` and `REQUEST_LATENCY` into `PryHttpMiddleware` - Tracks scrape metrics in `routers/scraping.py` (`direct`, `lazy`, `crawl`, `map`, `batch`) - Adds Redis + Postgres services to `docker-compose.yml` - Fixes Ollama URL default to Talos (`100.104.130.92:11434`) - Adds `LLMRegistry.complete_or_empty()` graceful fallback for API boundaries - Regenerates `requirements.txt`; adds pinned `requirements.lock` - Updates `STATUS.md` Verification: - `ruff check .` clean - `pytest tests/test_api_scraping.py tests/test_api_templates.py tests/test_api.py tests/test_apify_schema.py` — 23 passed
cryptorugmunch added 5 commits 2026-07-03 03:05:15 +02:00
cryptorugmunch closed this pull request 2026-07-06 10:07:02 +02:00
Some checks are pending
CI / lint (pull_request) Failing after 49s
CI / typecheck (pull_request) Successful in 54s
CI / Secret scan (gitleaks) (pull_request) Successful in 32s
CI / Security audit (bandit) (pull_request) Successful in 34s
CI / test (pull_request) Successful in 1m19s
lint
Required
test
Required
typecheck
Required

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: RugMunchMedia/pryscraper#8
No description provided.