feat(observability): register 26 missing metrics, add memory limits to 4 more services#5310
Conversation
…o 4 more services Phase C of the observability audit: src/selfhost/metrics.ts's DEFAULT_METRIC_META registry was missing HELP/TYPE metadata for 26 metrics that are actually emitted throughout src/ (agent-action permission denials, AI review reuse/tiebreak counters, grounding/impact-map/linked-issue-satisfaction/repo-culture-profile/ review-memory cache hit/miss, orb relay registration/malformed-events, PR outcomes, public-origin acknowledgement, and maintenance trickle-admission) -- each one rendered as an undocumented bare sample at /metrics forever. Added a drift-guard test that scans every incr()/gauge()/gaugeVector()/observe() call site in src/ so a future ungated metric fails CI instead of silently missing its HELP/TYPE lines again. Also adds deploy.resources.limits.memory to alertmanager, promtail, otel-collector, and docker-proxy in docker-compose.yml, for consistency with prometheus/grafana/loki/tempo (which already had caps) -- extends the existing resource-limits test + .env.example documentation to match.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5310 +/- ##
=======================================
Coverage 94.37% 94.37%
=======================================
Files 474 474
Lines 40128 40128
Branches 14631 14631
=======================================
Hits 37869 37869
Misses 1583 1583
Partials 676 676
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-12 13:49:53 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
Phase C of the observability audit (follow-up to #5302).
src/selfhost/metrics.ts'sDEFAULT_METRIC_METAregistry was missingHELP/TYPE metadata for 26 metrics that are actually emitted throughout
src/(agent-actionpermission denials, AI review reuse/tiebreak counters, grounding/impact-map/linked-issue-satisfaction/
repo-culture-profile/review-memory cache hit/miss, orb relay registration/malformed-events, PR
outcomes, public-origin acknowledgement, and maintenance trickle-admission). Each one rendered as an
undocumented bare sample at
/metrics(no# HELP/# TYPElines) forever. Found via a systematicscan of every
incr()/gauge()/gaugeVector()/observe()call site insrc/against the registry.selfhost-metrics.test.ts) that repeats that same scan and fails CI ifa future metric call site is ever added without a matching registry entry — closes this exact gap
class for good instead of just fixing today's instance of it.
deploy.resources.limits.memorytoalertmanager,promtail,otel-collector, anddocker-proxyindocker-compose.yml, for consistency withprometheus/grafana/loki/tempo(which already had caps, per perf(selfhost): profile stack resources and tune defaults #1828/fix(selfhost): add memory/CPU resource limits to docker-compose services #2495). Extended theexisting
selfhost-compose-resource-limits.test.tsand.env.exampledocumentation to match.Test plan
npm run typecheck— cleannpm run test:ci— full local gate greenselfhost-metrics.test.ts(scanssrc/for every literal metric name,asserts each has a registered HELP/TYPE entry — sanity-checks it found >50 real call sites)
selfhost-compose-resource-limits.test.tsto cover the 4 newly-capped services