Repository navigation
feat(portal): enable vendored telemetry (/events + /metrics) - #66
Merged
Merged
Conversation
Wire the vendored _portal_telemetry (forge/PortalEvent/1) into the
portal adapter: EventRecorder as adapter.event_sink so PortalServer
records every op boundary (operation.start/end, request.rejected),
plus the GET /events and GET /metrics read ops. A GET
/tasks/{task_id}/events op joins the existing /tasks surface.
Includes the vendored module + portal/manifest.json telemetry hash
entries, and re-binds the economy receipt validated_sha to the branch
base (HEAD~1). Real-HTTP coverage in test_telemetria_events_e_metrics.
EdgarSocrates98
force-pushed
the
feat/portal-telemetry
branch
from
October 18, 2026 11:35
84cf9cc to
67b4953
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Wires the vendored
_portal_telemetry.py(forge/PortalEvent/1) intoPlatformForgePortal:self._telemetry_recorder = _pt.EventRecorder()+self.event_sink = self._telemetry_recorder.emit—PortalServerpicks the sink up automatically, so every op boundary is recorded for free (operation.start/operation.endwithcorrelation_id,status,duration_ms, plusrequest.rejectedrefusals).*_pt.operations(recorder, self)— adds read-onlyGET /api/v1/events(fullforge/PortalEventReport/1window withcorrelation_id/type/status/limitfilters) andGET /api/v1/metrics(the §5.4 MetricsReport projection)._pt.task_events_op(recorder, lambda: list(self._tasks))—GET /api/v1/tasks/{task_id}/events, joining the existing/taskssurface (links viametadata.task_idor the task's owncorrelation_id, never timing guesses).Also commits the vendored module itself + the
portal/manifest.jsontelemetry hash entries, and re-binds the economy receiptvalidated_shato the branch base (HEAD~1) per the receipt contract.Evidence
test_telemetria_events_e_metrics(authenticatedGET /api/v1/health→GET /api/v1/eventsreturns the recordedoperation.endevent with schema/correlation_id/status/duration_ms →GET /api/v1/metricsreturns the report envelope with counters).pytest tests/test_portal_adapter.py— 19 passed.pytest tests/test_economy_closure.py— 33 passed;scripts/validate.py --gate economy-receipt— PASS.ruff check .— clean.Empty buffer returns
[]honestly; events live in a bounded in-process buffer (capacity 500), nothing leaves the machine.