feat: endpoint type log - #2038
Conversation
WalkthroughAdds request_path logging to error and quota logs; refactors RelayInfo generation with centralized construction and stricter type checks; changes GenerateMjOtherInfo to accept RelayInfo and updates callers; updates frontend logs to display request_path with new i18n entries. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client
participant Controller as Controller (relay)
participant RelayInfo as RelayInfo Builder
participant Service as Service.LogInfo
participant MJ as MJ Proxy Handler
participant UI as Web UI
Client->>Controller: Incoming request
Controller->>RelayInfo: GenRelayInfo(request)
RelayInfo-->>Controller: RelayInfo (with RequestURLPath)
Controller->>Service: appendRequestPath(ctx, RelayInfo) [internal]
note right of Service: Augments metadata with request_path
Controller->>MJ: GenerateMjOtherInfo(RelayInfo, priceData)
MJ-->>Controller: Other info (includes request_path)
Controller-->>Client: Response
UI->>UI: Render usage log
UI->>UI: If other.request_path, display “Request path”
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (10)
🧰 Additional context used🧬 Code graph analysis (5)web/src/hooks/usage-logs/useUsageLogsData.jsx (1)
relay/mjproxy_handler.go (1)
relay/common/relay_info.go (3)
relay/relay_task.go (1)
service/log_info_generate.go (2)
🔇 Additional comments (10)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…pe_log feat: endpoint type log
Summary by CodeRabbit
New Features
Documentation