feat(webui): surface user, client IP and user agent in API traces (#10886, #10887)#10907
Merged
Conversation
…0886, #10887) The Operate → Traces "API Traces" panel already recorded who made each request (user_id/user_name) but never showed it, and did not capture the caller's network identity at all. Operators asked to see the requesting user (#10886) and the client IP + user agent (#10887) so a trace can be attributed to who/what issued it. Backend: add ClientIP and UserAgent to APIExchange and populate them from echo's c.RealIP() (honours X-Forwarded-For / X-Real-IP behind a trusted proxy) and the request's User-Agent header. Both are omitempty and the /api/traces swagger response is map[string]any, so this is additive. UI: add a sortable "User" column to the API traces table and a metadata block (User / Client IP / User Agent) at the top of the expanded row detail. Fields render only when present, so older buffered traces and unauthenticated/local requests degrade cleanly. Adds an e2e spec covering the new column value and the expanded metadata. Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Assisted-by: Claude:opus-4.8 [Claude Code]
mudler
approved these changes
Jul 17, 2026
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
The Operate → Traces → API Traces panel already recorded who issued each request (
user_id/user_name) but never displayed it, and did not capture the caller's network identity at all. This adds the requested fields:so an operator can attribute a trace to who/what made the request.
Changes
Backend (
core/http/middleware/trace.go)ClientIPandUserAgenttoAPIExchange, populated from echo'sc.RealIP()(honoursX-Forwarded-For/X-Real-IPbehind a trusted proxy) and the request'sUser-Agentheader.omitempty; the/api/tracesswagger response ismap[string]any, so the change is purely additive — no schema regen needed.UI (
core/http/react-ui/src/pages/Traces.jsx)Tests — new
e2e/traces-metadata.spec.jscovering the User column value and the expanded Client IP / User Agent metadata.Notes
Verification
npm run buildandeslinton the changed UI pass (0 errors).gofmt-clean; the full Go build / browser e2e gate run in CI (the local box lacks the generated-protobuf toolchain to build the UI test server).Closes #10886
Closes #10887
Assisted-by: Claude:opus-4.8 [Claude Code]