managarten/scripts
Till JS 0bf01f434e feat(mana-ai): Prometheus /metrics endpoint + status.mana.how integration
Wires mana-ai into the existing observability stack so tick throughput,
plan-failure rates, planner latencies, and snapshot refresh health are
visible in Grafana + Prometheus, and the service's uptime surfaces on
status.mana.how under the "Internal" section.

- `src/metrics.ts` — prom-client Registry with `mana_ai_` prefix.
  Counters: ticks_total, plans_produced_total, plans_written_back_total,
  parse_failures_total, mission_errors_total, snapshots_new/updated,
  snapshot_rows_applied_total, http_requests_total.
  Histograms: tick_duration_seconds (0.1–120s), planner_request_
  duration_seconds (0.25–60s), http_request_duration_seconds (0.005–10s).
- `src/index.ts` — HTTP middleware labels every request by
  method/path/status; `/metrics` serves the Prometheus text format.
- `src/cron/tick.ts` — increments counters + wraps the tick with
  `tickDuration.startTimer()`. Snapshot stats fold through.
- `src/planner/client.ts` — wraps `complete()` in a latency histogram
  timer so planner tail latency shows up separately from tick duration.
- `docker/prometheus/prometheus.yml` —
  1. New `mana-ai` scrape job against `mana-ai:3066/metrics` (30s).
  2. `/health` added to the `blackbox-internal` job so uptime shows on
     status.mana.how alongside mana-geocoding.
- `scripts/generate-status-page.sh` — friendly label for the new probe:
  `mana-ai:3066/health` → "Mana AI Runner" (generator already iterates
  `blackbox-internal`, no other changes needed).
- `package.json` — prom-client ^15.1.3

All 17 Bun tests still pass; tsc clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 01:41:40 +02:00
..
dev chore(dev): add setup-dev-user script for local founder accounts 2026-04-09 12:23:15 +02:00
mac-mini refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
test-data feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
test-reporting chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
audit-complexity.mjs chore(audit): module complexity reports + workbench map 2026-04-14 19:47:42 +02:00
audit-module-coupling.mjs chore(audit): module complexity reports + workbench map 2026-04-14 19:47:42 +02:00
audit-modules.mjs chore(audit): module complexity reports + workbench map 2026-04-14 19:47:42 +02:00
audit-workspace-deps.mjs refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
backup-monitoring.sh feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
build-complexity-map.mjs chore(audit): module complexity reports + workbench map 2026-04-14 19:47:42 +02:00
check-status.sh feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
create-gift-codes.mjs feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
deploy-metrics.sh fix(deploy): fix image size measurement in deploy metrics 2026-03-20 21:13:03 +01:00
ecosystem-audit.mjs feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
fix-mixed-imports.mjs Fix wrong type 2025-12-04 23:25:25 +01:00
generate-dockerfiles.mjs feat(infra): extend Dockerfile validator to backends and services 2026-03-25 08:57:10 +01:00
generate-env.mjs refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
generate-status-page.sh feat(mana-ai): Prometheus /metrics endpoint + status.mana.how integration 2026-04-15 01:41:40 +02:00
lighthouse-audit.sh refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
run-integration-tests.sh fix(mana-auth): account lockout was structurally dead + add failure-path tests 2026-04-08 18:29:00 +02:00
run-tests-with-coverage.sh feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
setup-databases.sh chore(mail): add infra — port 3042, DB schema setup, pnpm install 2026-04-13 20:42:12 +02:00
setup-secrets.mjs feat(env): persistent dev secrets via .env.secrets override 2026-04-08 17:50:37 +02:00
test-chat-auth.sh chore: tidy root files + reorganize a few stale docs 2026-04-08 12:15:27 +02:00
validate-cloudflared-config.mjs chore(infra): pre-commit validator for cloudflared-config.yml 2026-04-09 18:02:51 +02:00
validate-dockerfiles.mjs refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
validate-monorepo.mjs refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00