Category: New Features & Improvements
Difficulty: High
Description:
None of the four services expose Prometheus-compatible metrics. There are no:
- HTTP request counters, duration histograms, or in-flight request gauges
- Database query duration and error counters
- Redis connection health metrics
- BullMQ queue depth, job duration, and failure counters
- Business-level metrics (payments created, settlements processed, events indexed)
- Rate-limit hit counters
Without observability, it is impossible to monitor production health, detect performance regressions, or set up alerting for anomalies. A shared @fastify/metrics or prom-client setup should be added to all services.
Location:
All four services (no metrics implementation exists)
Acceptance Criteria:
Technical Notes:
@fastify/metrics automatically registers HTTP metrics. Pair it with prom-client for custom metrics.
- BullMQ v5+ has
<queue>.getJobCounts() for queue depth; wrap in a Gauge collector.
Category: New Features & Improvements
Difficulty: High
Description:
None of the four services expose Prometheus-compatible metrics. There are no:
Without observability, it is impossible to monitor production health, detect performance regressions, or set up alerting for anomalies. A shared
@fastify/metricsorprom-clientsetup should be added to all services.Location:
All four services (no metrics implementation exists)
Acceptance Criteria:
@fastify/metricsplugin to all four services (or a custom/metricsendpoint usingprom-client)bettapay_payments_total,bettapay_settlements_total,bettapay_events_indexed_totalbullmq_queue_depth,bullmq_job_duration_secondsGET /metricsendpoint (protected byserviceAuth) exposing all metrics in Prometheus text formatdocs/grafana-dashboard.json) with panels for each service/metricsendpoint returns valid Prometheus-formatted outputTechnical Notes:
@fastify/metricsautomatically registers HTTP metrics. Pair it withprom-clientfor custom metrics.<queue>.getJobCounts()for queue depth; wrap in aGaugecollector.