Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 23 additions & 17 deletions indexer/src/kadena-server/plugins/instrument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,29 @@ import { nodeProfilingIntegration } from '@sentry/profiling-node';
/**
* Sentry configuration
*/
const SENTRY_DSN = getRequiredEnvString('SENTRY_DSN');
const SENTRY_DSN = process.env['SENTRY_DSN'];
const SENTRY_ENVIRONMENT = 'production';
const SENTRY_RELEASE = 'v1.0.0';

// Initialize Sentry
console.info('[INFO][SENTRY][INIT] Initializing Sentry error reporting');
Sentry.init({
dsn: SENTRY_DSN,
environment: SENTRY_ENVIRONMENT,
release: SENTRY_RELEASE,
sendDefaultPii: true,
tracesSampleRate: 1.0,
profileSessionSampleRate: 1.0,
profileLifecycle: 'trace',
integrations: [
nodeProfilingIntegration(),
Sentry.graphqlIntegration({ useOperationNameForRootSpan: true }),
],
debug: false,
});
if (!SENTRY_DSN || SENTRY_DSN.trim() === '') {
console.info(
'[INFO][SENTRY][LOG] Not using Sentry as it is disabled by not setting SENTRY_DSN env var',
);
} else {
// Initialize Sentry
console.info('[INFO][SENTRY][INIT] Initializing Sentry error reporting');
Sentry.init({
dsn: SENTRY_DSN,
environment: SENTRY_ENVIRONMENT,
release: SENTRY_RELEASE,
sendDefaultPii: true,
tracesSampleRate: 1.0,
profileSessionSampleRate: 1.0,
profileLifecycle: 'trace',
integrations: [
nodeProfilingIntegration(),
Sentry.graphqlIntegration({ useOperationNameForRootSpan: true }),
],
debug: false,
});
}