Implement Baselime monitoring and update error handling

This commit introduces the integration of Baselime for monitoring, accounting for various error scenarios and improved console error logging. Request handling has been updated to assign unique IDs for each request, aiding in tracing/logs. The environment variable key was updated, and the `MonitoringProvider` was nested in the root providers. In the base monitoring service, a function to format errors for logging was added. The provider logic was updated to create a new instance of service for each request, improving memory efficiency.
This commit is contained in:
giancarlo
2024-04-22 18:41:38 +08:00
parent 7e1be64707
commit a074e1ec3b
10 changed files with 172 additions and 36 deletions

View File

@@ -1314,7 +1314,7 @@ NEXT_PUBLIC_MONITORING_PROVIDER=sentry
To use Baselime, you need to set the following environment variables:
```bash
BASELIME_KEY=your_key
NEXT_PUBLIC_BASELIME_KEY=your_key
NEXT_PUBLIC_MONITORING_PROVIDER=baselime
```