Skip to content

✨ metrics: authenticated GET /metrics for tool calls, upstreams and adapters - #55

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:mainfrom
Danathar:feat/metrics-endpoint
Nov 19, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:mainfrom
Danathar:feat/metrics-endpoint

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Closes #54

What

A dependency-free, hand-rolled Prometheus text endpoint, GET /metrics, on the existing loopback listener. It uses the same bearer as /mcp and /events and answers 401 without it. Nothing is pushed anywhere, and there is no OTel exporter, collector or off-box flow, as the issue asked.

Metric Labels
quorum_tool_calls_total tool, outcome (ok, error)
quorum_tool_call_duration_seconds (histogram) tool
quorum_upstream_requests_total service (transcribe, tts, vexa), outcome
quorum_upstream_duration_seconds (histogram) service
quorum_adapter_connected (gauge) adapter (discord, vexa, companion)
  • tool comes from the contract tool list; any other client-supplied name is unknown (the same bounding logToolCall already uses). No meeting ids, user ids, URLs or error strings are labels.
  • Upstream metrics wrap each HTTP request in the Transcriber, TtsClient and VexaClient, so a retried transcription is several requests. outcome=ok means a 2xx answer.
  • quorum_adapter_connected is 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_URL is set. An unconfigured adapter has no series.
  • docs/contract.md has a new Metrics section and README links to it.

Not included

The optional /healthz degraded flag or /readyz is 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), build and smoke pass. New test/metrics.test.ts covers:

  • text rendering and label escaping
  • the label sets staying within the contract tool list
  • /metrics rejecting a missing or wrong bearer, and GET only
  • upstream outcomes for all three clients
  • adapter gauges

Note: upstream main tracks a stray node_modules symlink; I left it untouched.

-- hive: backend=claude model=claude-sonnet-5-5

🤖 Generated with Claude Code


🐝 Hive Agent: contributor | SHA: 57dd455

…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>
@kubestellar-prow

Copy link
Copy Markdown

[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.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hivecommons-hive
hivecommons-hive Bot merged commit 33cc802 into hivecommons:main Nov 19, 2026
7 of 8 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

Evidence bundle `#5557dd455` sha256:681f559cbc643f821659e06cdf57662df79fb96c439dae06273e9df9c02fdacf — download from the dashboard or `hivectl review evidence #55`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

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.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Needs a decision, not a merge: the lane reported author-permission-missing.

Head: verdict approved @57dd455, 4/4 checks green, DCO yes, soak 10m0s elapsed.

How to release it:

  • A maintainer must resolve the lane condition named above or review and merge manually; /hive approve does not override that condition.

Clear the cause and the hive re-evaluates on its next pass; the stage moves to stage/090-ready-for-human-merge, stage/095-pre-merge-soak or the merge queue on its own. Approval does not bypass CI, hold labels or other merge gates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[telemetry] Observability audit: no metrics for tool calls or upstream services (recommendation)

1 participant