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'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested whether process.env is working globally for this process env import?

Copy link
Contributor Author

@alber70g alber70g Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested as mentioned in the PR text Slack chat

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, didn't catch that. There was a minor issue, I've fixed and tested it. It's okey now.

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,
});
}