Skip to content

feat: add useTimeSeconds in error log - #2819

Merged
seefs001 merged 1 commit into
QuantumNous:mainfrom
feitianbubu:pr/65623826f5d9578addbb73be4739dc54f41acd8b
Feb 4, 2026
Merged

feat: add useTimeSeconds in error log#2819
seefs001 merged 1 commit into
QuantumNous:mainfrom
feitianbubu:pr/65623826f5d9578addbb73be4739dc54f41acd8b

Conversation

@feitianbubu

@feitianbubu feitianbubu commented Feb 3, 2026

Copy link
Copy Markdown
Member

错误日志也增加时长记录
适合排查某些因超时而导致的错误
image

Summary by CodeRabbit

  • Chores
    • Enhanced error logging infrastructure to automatically capture and record request duration metrics alongside all system errors. This improvement strengthens operational observability by providing better visibility into error patterns and timing correlations, enabling faster diagnosis and resolution of operational issues. Results in more effective system monitoring, debugging, and incident response processes.

@coderabbitai

coderabbitai Bot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Added time import and instrumented error logging in the processChannelError function to record actual request duration instead of zero, by extracting the request start time from context and calculating elapsed seconds.

Changes

Cohort / File(s) Summary
Error logging instrumentation
controller/relay.go
Added time import and modified processChannelError to compute and pass actual request duration (calculated from context start time) to error log recording instead of hardcoded zero value.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A hop, a skip, through time we track,
When errors come, we've got their back,
No more zeros, truth we tell,
Request durations ringing bell! 🔔

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add useTimeSeconds in error log' directly and specifically describes the main change: adding duration tracking to error logging.

✏️ 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

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Failure to add the new IP will result in interrupted reviews.


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.

@seefs001
seefs001 merged commit e7d5c61 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
…78addbb73be4739dc54f41acd8b

feat: add useTimeSeconds in error log
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