AletheiaFact / AletheiaFact/aletheia
Enhancement: Investigate and Implement Error Monitoring Solution in Production
- Dominant language
- TypeScript
- Stars
- 55
- Forks
- 20
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 2
Description
## Background Information
Currently, critical runtime error handling in both the frontend and backend primarily uses `console.error()`. In production environments, this prevents proactive error visibility, as logs are confined to the user's browser console.
The absence of a centralized system prevents the tracking, aggregation, notification, and prioritization of bugs that impact the user experience.
## Steps to Reproduce
The problem is not reproducible; rather, it's an architectural failure in observability:
1. A JavaScript error/Exception occurs on the client or server.
2. The exception is caught, and `console.error(e)` is called.
3. The error is not reported to any centralized system, making real-time tracking, aggregation, and alerting impossible.
## How
The objective is to integrate an open-source error monitoring solution (e.g., GlitchTip or self-hosted Sentry) and refactor our code to utilize it.
### Sub-tasks
1. **Investigation & Selection:** Evaluate and select the open-source monitoring solution that best integrates with our infrastructure and tech stack.
2. **Infra Setup:** Configure and provision the monitoring tool instance in our environment (whether via SaaS or self-hosted).
3. **Logger Implementation:** Create a logging abstraction layer (`LoggerService`) that routes errors based on the environment:
* `development`: Logs to `console.error` (local).
* `production`: Sends to the monitoring service.
4. **Code Refactoring:** Replace all critical calls to `console.error(e)` with `LoggerService.trackError(e, context)`.
5. **Alert Configuration:** Set up basic alerts (Slack/Email) to notify the team about new critical errors or error spikes.
## Expected Behavior
Production code will no longer rely solely on `console.error`. When an error occurs:
* The exception will be captured with the complete context (app version, user, stack trace).
* The error will be sent to a centralized dashboard.
* Errors will be aggregated by frequency and type.
* The team will be proactively notified about critical issues.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.