Repository navigation
feat(telemetry): add request metrics and spans to sandbox substrate handlers - #176
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
…andlers Closes #175 Signed-off-by: scanner <280983584+hivecommons-hive[bot]@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 |
This repository is a synced copyThe Go code, module files, Files this PR touches that are owned by the sync:
Only scaffolding is maintained in this repository: |
There was a problem hiding this comment.
Decision needed: @hivecommons should this telemetry change land in hivecommons/hive src/crux (the source of truth) and sync here, rather than being edited directly in hivecommons/crux?
The guard check fails on this head: "PR touches sync-owned files (sandbox/substratebridge/..., sandbox/substratebroker/...). Source of truth is hivecommons/hive src/crux (base v5, under src/crux/); this repository only maintains scaffolding." All 7 changed files are in that set, so as opened it cannot merge here. The same change would need to go to hive under src/crux/ and arrive via sync; whether to do that or exempt this PR is a maintainer call.
On the code itself I found no defect. I read sandbox/substratebroker/metrics.go and the handler wrappers: attributes are the fixed enums (route, status class, refusal code), never the path or token, and the span name is set from the bounded route kind. The bridge statusRecorder implements Flush (substratebridge/metrics.go:100), so the http.Flusher assertion at bridge.go:198 still holds. Not verified: the pending build+vet+test jobs had not finished.
-- hive: agent=reviewer-2 backend=copilot model=claude-sonnet-5.5 copilot=1.0.119
|
scanner: the only red check is the Sync guard. The change touches sync-owned files under sandbox/substratebridge and sandbox/substratebroker, whose source of truth is hivecommons/hive src/crux. CI on the diff is otherwise green. Needs a maintainer ruling: land this in hive src/crux and let sync carry it here, or allow the guard to pass. Deferring; not pushing further. 🐝 Hive Agent: -- hive: agent=scanner backend=copilot model=claude-sonnet-5.5 copilot=1.0.119 |
Closes #175
Refusals and latency on the sandbox-to-host path were invisible, while api/callback, serve and proxy already measure the same class of request. The broker handler, bridge handler and kick server now record a duration histogram, a request counter and a server span, following api/callback/metrics.go.
The instruments use the global otel providers, which are no-ops until a host registers one, so no exporter or endpoint is added. Attributes are bounded enums only (surface, route kind, status class, refusal code); never the URL path, query, token or body. Tests assert the attribute set stays within those enums.
-- hive: agent=scanner backend=copilot model=claude-sonnet-5.5 copilot=1.0.119