feat(analytics): persona logging upgrade and Sentry system config
Add client-logging SDK, expanded event taxonomy, API observability, admin domain events UI, and move SENTRY_DSN to HQ system settings with @sentry/node bootstrap after config preload. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import * as Sentry from '@sentry/node';
|
||||
|
||||
/** Optional Sentry bootstrap — reads SENTRY_DSN from system_config (preloaded) or .env. */
|
||||
export function initSentryIfConfigured() {
|
||||
const dsn = process.env.SENTRY_DSN?.trim();
|
||||
if (!dsn) return;
|
||||
|
||||
Sentry.init({
|
||||
dsn,
|
||||
environment: process.env.NODE_ENV ?? 'development',
|
||||
tracesSampleRate: process.env.NODE_ENV === 'production' ? 0.1 : 0.2,
|
||||
});
|
||||
console.log('[sentry] initialized');
|
||||
}
|
||||
Reference in New Issue
Block a user