Repository navigation
✨ metrics: authenticated GET /metrics for tool calls, upstreams and adapters - #55
Conversation
…dapters
Adds a dependency-free Prometheus text endpoint on the existing loopback
listener, behind the same bearer as /mcp:
- quorum_tool_calls_total{tool,outcome} and
quorum_tool_call_duration_seconds{tool}; tool is bounded to the contract
list ("unknown" otherwise)
- quorum_upstream_requests_total{service,outcome} and
quorum_upstream_duration_seconds{service} for transcribe, tts and vexa
- quorum_adapter_connected{adapter} for discord, vexa and companion
No exporter, collector or off-box data flow. Documented in docs/contract.md.
Hive-Run: hivecommons#54
Hive-Plan: issue hivecommons#54 recommendation, bounded metrics and /metrics endpoint
Hive-Spec: docs/contract.md#metrics
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Merged by hive contributor-lane auto-merge: CI green for ≥10m, reviewer verdict approve, @Danathar holds the merger tier in this hive's contributor registry. |
|
Needs a decision, not a merge: the lane reported Head: verdict approved @57dd455, 4/4 checks green, DCO yes, soak 10m0s elapsed. How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
Closes #54
What
A dependency-free, hand-rolled Prometheus text endpoint,
GET /metrics, on the existing loopback listener. It uses the same bearer as/mcpand/eventsand answers 401 without it. Nothing is pushed anywhere, and there is no OTel exporter, collector or off-box flow, as the issue asked.quorum_tool_calls_totaltool,outcome(ok,error)quorum_tool_call_duration_seconds(histogram)toolquorum_upstream_requests_totalservice(transcribe,tts,vexa),outcomequorum_upstream_duration_seconds(histogram)servicequorum_adapter_connected(gauge)adapter(discord,vexa,companion)toolcomes from the contract tool list; any other client-supplied name isunknown(the same boundinglogToolCallalready uses). No meeting ids, user ids, URLs or error strings are labels.outcome=okmeans a 2xx answer.quorum_adapter_connectedis read at scrape time. Discord: gateway login finished. Vexa: websocket open, or no meeting followed (the socket only exists for live meetings, so idle counts as connected). Companion:QUORUM_TRANSCRIBE_URLis set. An unconfigured adapter has no series.docs/contract.mdhas a new Metrics section and README links to it.Not included
The optional
/healthzdegradedflag or/readyzis left out. The gauge gives the same signal without changing the health contract that hive supervises against. Happy to follow up if wanted.Testing
npm run lint,typecheck,test:coverage(359 tests, above the 90% gate),buildandsmokepass. Newtest/metrics.test.tscovers:/metricsrejecting a missing or wrong bearer, and GET onlyNote: upstream
maintracks a straynode_modulessymlink; I left it untouched.-- hive: backend=claude model=claude-sonnet-5-5
🤖 Generated with Claude Code
🐝 Hive Agent:
contributor| SHA:57dd455