Skip to content

feat: log search field request_id && conversion_path display - #2825

Merged
Calcium-Ion merged 3 commits into
QuantumNous:mainfrom
seefs001:feature/request-id-log-column
Feb 4, 2026
Merged

feat: log search field request_id && conversion_path display#2825
Calcium-Ion merged 3 commits into
QuantumNous:mainfrom
seefs001:feature/request-id-log-column

Conversation

@seefs001

@seefs001 seefs001 commented Feb 3, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Added a Request ID filter to the Usage Logs UI so you can search and filter log entries by Request ID.
    • Logging now records and surfaces a Request ID with each relevant log entry, improving traceability and making it easier to correlate logs to external requests.

@coderabbitai

coderabbitai Bot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Adds request ID support across logging: frontend filter and query param, controller reads request_id and forwards it, and model stores/filters logs by a new RequestId field.

Changes

Cohort / File(s) Summary
Backend controller
controller/log.go
Reads request_id query parameter and passes it to model log retrieval functions.
Backend model
model/log.go
Adds RequestId string to Log; updates GetAllLogs(...) and GetUserLogs(...) signatures to accept requestId and filter by it; populates RequestId when creating logs; removed request_conversion from formatted user output.
Frontend filters & data
web/src/components/table/usage-logs/UsageLogsFilters.jsx, web/src/hooks/usage-logs/useUsageLogsData.jsx
Adds request_id form field and default value; includes request_id in API query params for admin/non-admin log endpoints; renders "Request ID" row when present in log items.

Sequence Diagram(s)

sequenceDiagram
  participant UI as "User / Browser"
  participant FE as "Frontend hook\n(useUsageLogsData)"
  participant API as "Controller\n(controller/log.go)"
  participant Model as "Model\n(model/log.go)"
  participant DB as "Database"

  UI->>FE: enter filters (including request_id)
  FE->>API: GET /logs?request_id=... (admin/non-admin endpoint)
  API->>Model: GetAllLogs/GetUserLogs(..., requestId)
  Model->>DB: SELECT ... WHERE logs.request_id = ? (if provided)
  DB-->>Model: rows
  Model-->>API: log list (with RequestId field)
  API-->>FE: JSON response
  FE-->>UI: render logs (show Request ID row when present)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I hopped through forms and server lanes,
Carried tiny request-id reins,
From field to model, stored with care,
Now every log knows which path it bears. 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions 'request_id' field and 'conversion_path display', both of which are addressed in the changeset. The request_id feature is implemented across controller, model, and frontend components. However, the title references 'conversion_path display' which contradicts the actual changes—the code explicitly removed the conversion_path field from user logs output. Update the title to accurately reflect the changes: 'feat: add request_id log search field' or similar, removing the misleading reference to conversion_path display which was actually removed.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Calcium-Ion
Calcium-Ion merged commit 89b2782 into QuantumNous:main Feb 4, 2026
1 check passed
ennnnny pushed a commit to ennnnny/new-api that referenced this pull request Mar 17, 2026
…log-column

feat: log search field request_id && conversion_path display
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants