chore(logging): reduce log noise - #1276
Conversation
…o for routine logs Changed various logger.info calls to logger.debug in worker and stats-calculator services to reduce verbosity of routine operational log messages and better reflect their importance level. Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
WalkthroughLog verbosity adjustments in worker services: several info-level log statements are downgraded to debug level in stats-calculator and worker modules. No control flow or data model changes; purely logging configuration adjustments. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/worker/src/services/stats-calculator.ts (1)
596-599: Aggregated stats logging downgrade is reasonable; consider keeping a singleinfosummary (optional)Changing the “starting 5‑minute aggregation”, “updated statistics for N providers/models/mappings”, and “completed successfully” logs to
debugsignificantly quiets periodic noise and keeps error visibility intact. This is acceptable given the PR objectives.If ops still wants lightweight confirmation that the aggregation loop is alive in production logs, you might optionally retain a single coarse
logger.infoper run (for example, only the final “completed” line) and keep the detailed counts atdebug. Not required, but could help with quick sanity checks without turning on full debug.Also applies to: 655-657, 711-712, 785-790
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/worker/src/services/stats-calculator.ts(6 hunks)apps/worker/src/worker.ts(3 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{js,ts,jsx,tsx}: Always use top-levelimport, never use require or dynamic imports
No unnecessary code comments
Files:
apps/worker/src/worker.tsapps/worker/src/services/stats-calculator.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use cookies for user-settings which are not saved in the database to ensure SSR works
**/*.{ts,tsx,js,jsx}: Always use tabs for indentation
Always use top-levelimport, never use require or dynamic imports
Avoid unnecessary code comments
Files:
apps/worker/src/worker.tsapps/worker/src/services/stats-calculator.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Use Drizzle ORM with latest object syntax for database operations
For database reads: Usedb().query.<table>.findMany()ordb().query.<table>.findFirst()Never use
anyoras anyin TypeScript code unless absolutely necessary
Files:
apps/worker/src/worker.tsapps/worker/src/services/stats-calculator.ts
**/*.ts
📄 CodeRabbit inference engine (CLAUDE.md)
For database reads, use
db().query.<table>.findMany()ordb().query.<table>.findFirst()with Drizzle ORM
Files:
apps/worker/src/worker.tsapps/worker/src/services/stats-calculator.ts
🧠 Learnings (1)
📚 Learning: 2025-08-04T21:46:14.112Z
Learnt from: mowdl
Repo: theopenco/llmgateway PR: 572
File: apps/gateway/src/worker.ts:292-298
Timestamp: 2025-08-04T21:46:14.112Z
Learning: In the LLMGateway system, API key usage should be tracked for all keys regardless of project billing mode. This dual tracking approach allows credit deduction for non-"api-keys" mode projects while maintaining comprehensive usage statistics across all API keys for monitoring and analytics purposes.
Applied to files:
apps/worker/src/worker.ts
🧬 Code graph analysis (2)
apps/worker/src/worker.ts (1)
packages/logger/src/index.ts (1)
logger(181-181)
apps/worker/src/services/stats-calculator.ts (1)
packages/logger/src/index.ts (1)
logger(181-181)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: build / run
- GitHub Check: test / run
- GitHub Check: lint / run
- GitHub Check: autofix
🔇 Additional comments (2)
apps/worker/src/services/stats-calculator.ts (1)
550-565: Minutely history logs moved todebugare consistent with reduced-noise intentThe start and per‑minute summary logs in
calculateMinutelyHistorybeing downgraded tologger.debugmatch the goal of avoiding high‑frequencyinfospam, while errors remain aterror. There’s no change to the actual history computation or DB writes, so runtime behavior is preserved.apps/worker/src/worker.ts (1)
646-678: Log level downgrade inbatchProcessLogsis correct and behavior-preservingDowngrading the per-organization credit deduction (line 657), per-API-key usage (line 709), and "marked logs as processed" (line 721) messages from
infotodebugis appropriate. The accounting logic remains unchanged—credits are still deducted, API key usage is still tracked, and referral earnings are still calculated. A batch-levelinfolog at line 564 preserves observability for the overall operation. No tests or alerts in the codebase depend on the downgraded log messages.
Summary
Changes
Logging Level Adjustments
Rationale
Test plan
🌿 Generated by Terry
ℹ️ Tag @terragon-labs to ask questions and address PR feedback
📎 Task: https://www.terragonlabs.com/task/d9ce4ce2-b8a9-4804-8963-86687d385f8f
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.