feat(dashboard): RealUnit API tracing dashboard#1112
Merged
Conversation
Adds a live dashboard for the RealUnit internal test phase. The screen calls the existing /gs/debug/logs endpoint with the traces-by-message template (filter: RealUnitTrace) and renders summary cards, top endpoints (count / median / p95), top IPs and a recent-activity feed. Auto-refresh every 5s, time ranges 15min/1h/6h/24h. Reachable via /dashboard/realunit-tracing, with a card link added to the main dashboard hub. Admin-guarded; backend gating remains on the existing DEBUG-role endpoint (admins are included via RoleGuard additionalRoles).
- cancellation-safe refresh on range change (H1) - correct API granularity comment (H2) - tighter trace-headline regex (M1) - keep dashboard visible during range refresh (L1) - stable React keys, robust timestamp sort (L2, L5) - default range = 1h, full UUID + interpolated p95 (N1-N3) - drop raw message from client state (S1)
- explicit tightenToMs discriminator on TIME_RANGES (N5) - consistent getTime-based comparison in aggregateIps (N7) - remove redundant parens in percentile (N4)
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.
Summary
Adds a live dashboard for the RealUnit internal test phase under
/dashboard/realunit-tracing.POST /gs/debug/logsendpoint with templatetraces-by-messageand filterRealUnitTrace— no API change required.:address,:id,:uuid)/dashboard.Why no API change
The backend already exposes log queries via
/gs/debug/logswith thetraces-by-messagetemplate. The dashboard parses each[RealUnitTrace] METHOD URL → STATUS (Nms) client=… ip=…headline client-side and aggregates locally. 200-row cap covers ~15 min of activity at current load, which is fine for a live monitoring view.Auth
useAdminGuard(). Backend'sRoleGuard(UserRole.DEBUG)accepts ADMIN/SUPER_ADMIN throughadditionalRoles, so admin users pass both layers. The frontend@dfx.swiss/reactUserRole enum has no DEBUG value, so a pure-DEBUG-role user can't reach the screen via UI — acceptable trade-off for the test phase.Linked
X-Clientheader: feat: tag API requests with X-Client header RealUnitCH/app#520 (merged)Test plan
npm run build:devsucceedsnpx tsc --noEmitcleannpx eslintclean on changed files/dashboard→ click RealUnit Tracing card