You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context: REES (review-enrichment/, a standalone first-party TypeScript/Node HTTP service, src/server.ts) has zero observability today — confirmed live: GET /metrics returns 404. It runs --profile rees-gated, reached only in-network at http://rees:8080, and does heavier/external/historical PR analysis work for the main review engine (analyzers can time out, fail, or degrade — none of that is currently visible).
Requirements:
Add a lightweight in-process Prometheus text-format metrics registry to REES, analogous to src/selfhost/metrics.ts's pattern in the main app (counters/gauges/histograms, a renderMetrics()-style function, a # HELP/# TYPE registry) — scaled to REES's actual needs, not a wholesale copy of the main app's registry.
Instrument the meaningful signal REES already has internally but doesn't expose: per-analyzer request counts, success/failure/timeout counts, and duration histograms; overall /v1/enrich request counts and duration.
Add a GET /metrics route to REES's own src/server.ts.
Add a rees scrape target to prometheus/prometheus.yml, gated the same way the existing GPU/backup targets are documented ("absent target just shows down, no alert fires" — since --profile rees is optional).
Full test coverage in review-enrichment/test/ (REES has its own test suite, run via node --test) plus any repo-root observability-config tests that need updating (selfhost-observability-config.test.ts, validate-observability-configs.mjs-covered files).
Deliverables:
New metrics module + /metrics route in review-enrichment/src/.
Analyzer-level instrumentation (success/failure/timeout/duration) wired into REES's existing analyzer-dispatch code path.
prometheus.yml scrape target.
Dashboard panel(s) for REES-specific signal.
Tests in both review-enrichment/test/ and the root test suite as needed.
Expected outcomes: An operator running --profile rees can see, in Grafana, which analyzers are failing/timing out and how often, and REES's overall request volume/latency — instead of only finding out an analyzer is broken when a PR review visibly lacks enrichment context.
Links/resources:
src/selfhost/metrics.ts — the main app's existing metrics-registry pattern to reference (not copy wholesale; REES is a much smaller service).
review-enrichment/src/server.ts, review-enrichment/package.json — REES's own structure (Node ≥20, tsc build, node --test test runner).
The gpu/gittensory-backup scrape-target comments in prometheus/prometheus.yml for the "optional profile, absent target is fine" convention to mirror.
Part of #5365.
Context: REES (
review-enrichment/, a standalone first-party TypeScript/Node HTTP service,src/server.ts) has zero observability today — confirmed live:GET /metricsreturns 404. It runs--profile rees-gated, reached only in-network athttp://rees:8080, and does heavier/external/historical PR analysis work for the main review engine (analyzers can time out, fail, or degrade — none of that is currently visible).Requirements:
src/selfhost/metrics.ts's pattern in the main app (counters/gauges/histograms, arenderMetrics()-style function, a# HELP/# TYPEregistry) — scaled to REES's actual needs, not a wholesale copy of the main app's registry./v1/enrichrequest counts and duration.GET /metricsroute to REES's ownsrc/server.ts.reesscrape target toprometheus/prometheus.yml, gated the same way the existing GPU/backup targets are documented ("absent target just shows down, no alert fires" — since--profile reesis optional).review-enrichment/test/(REES has its own test suite, run vianode --test) plus any repo-root observability-config tests that need updating (selfhost-observability-config.test.ts,validate-observability-configs.mjs-covered files).Deliverables:
/metricsroute inreview-enrichment/src/.prometheus.ymlscrape target.review-enrichment/test/and the root test suite as needed.Expected outcomes: An operator running
--profile reescan see, in Grafana, which analyzers are failing/timing out and how often, and REES's overall request volume/latency — instead of only finding out an analyzer is broken when a PR review visibly lacks enrichment context.Links/resources:
src/selfhost/metrics.ts— the main app's existing metrics-registry pattern to reference (not copy wholesale; REES is a much smaller service).review-enrichment/src/server.ts,review-enrichment/package.json— REES's own structure (Node ≥20,tscbuild,node --testtest runner).gpu/gittensory-backupscrape-target comments inprometheus/prometheus.ymlfor the "optional profile, absent target is fine" convention to mirror.